Misar Docs
MisarMailMisar.BlogMisarReachMisarPostMisar.DevMisar PlatformMisar IdentityMisar Posts API
Api Reference

Images

Upload and AI-generate cover images for MisarBlog articles.

Upload an Image

POST/images/upload

Uploads an image to the MisarBlog CDN and returns a permanent URL for use in articles. Send as multipart/form-data.

Request body

filebinarybodyrequired

Image file (JPEG, PNG, WebP — max 10 MB).

typestringbody

cover | inline (default: inline).

Response fields

urlstring

Permanent CDN URL of the uploaded image.

widthinteger

Image width in pixels.

heightinteger

Image height in pixels.

size_bytesinteger

File size in bytes.

curl -X POST https://api.misar.io/blog/v1/images/upload \
  -H "Authorization: Bearer mbk_YOUR_KEY" \
  -F "[email protected]" \
  -F "type=cover"
{
  "url": "https://supabase-blog.misar.io/storage/v1/object/public/covers/abc123.jpg",
  "width": 1280,
  "height": 720,
  "size_bytes": 204800
}

Generate a Cover Image (AI)

POST/images/generate

Generates an AI cover image using a text prompt and returns a CDN URL. Generation typically takes 3–8 seconds. The URL is permanent and CDN-cached.

Request body

promptstringbodyrequired

Image description (max 500 chars).

stylestringbody

photorealistic | illustration | minimal (default: photorealistic).

aspect_ratiostringbody

16:9 | 1:1 | 4:3 (default: 16:9).

Response fields

urlstring

Permanent CDN URL of the generated image.

promptstring

The prompt used for generation.

widthinteger

Image width in pixels.

heightinteger

Image height in pixels.

{
  "prompt": "A futuristic city skyline with glowing neon signs and flying cars at dusk",
  "style": "photorealistic",
  "aspect_ratio": "16:9"
}
{
  "url": "https://supabase-blog.misar.io/storage/v1/object/public/ai-covers/gen_abc123.jpg",
  "prompt": "A futuristic city skyline...",
  "width": 1280,
  "height": 720
}

Plan Limits

PlanAI Generations/month
Free5
Pro50
Business500

Errors

StatusDescription
400Invalid aspect ratio or style
401Invalid or missing API key
413File too large (upload only)
429Rate limit or generation quota exceeded