MisarMisar Docs
MisarMailMisarBlogMisarReachMisarPostMisarDevMisarCoderMisarSEOMisar PlatformMisar SSO
API Reference

Images

Upload and AI-generate cover images for MisarBlog articles.

Upload an Image

POST/blog/v1/images/upload

Uploads an image to the MisarBlog CDN and returns a permanent URL for use in articles. Send as multipart/form-data. Authenticated with your API key (Authorization: Bearer mbk_...).

Request body

filebinarybodyrequired

Image file. Allowed types: JPEG, PNG, WebP, GIF. Maximum size 8 MB. The file's real content is verified against its declared type (magic-byte check).

Response fields

urlstring

Permanent CDN URL of the uploaded image. Returned with 201 Created.

Request
curl -X POST https://api.misar.io/blog/v1/images/upload \
  -H "Authorization: Bearer mbk_YOUR_KEY" \
  -F "file=@cover.jpg"
201 — Created
{
  "url": "https://supabase-blog.misar.io/storage/v1/object/public/article-images/abc123.jpg"
}

Generate a Cover Image (AI)

POST/blog/v1/images/generate

Generates an AI cover image using a text prompt, stores it on the MisarBlog CDN, and returns the CDN URL. Authenticated with your API key.

Request body

promptstringbodyrequired

Image description. Truncated to 1000 chars before generation.

sizestringbody

Output dimensions: 1024x1024 | 1792x1024 | 1024x1792 (default: 1024x1024). Any other value falls back to 1024x1024.

Response fields

urlstring

Permanent CDN URL of the generated image. Returned with 201 Created. If the CDN upload step fails, the raw generated image URL is returned instead (with 200 OK).

Request
{
  "prompt": "A futuristic city skyline with glowing neon signs and flying cars at dusk",
  "size": "1792x1024"
}
201 — Created
{
  "url": "https://supabase-blog.misar.io/storage/v1/object/public/article-images/gen-abc123.png"
}

Errors

StatusDescription
400Invalid JSON body or missing prompt
401Invalid or missing API key
402Insufficient credits (generate, when the universal wallet is enabled)
413File exceeds the 8 MB limit (upload only)
415Unsupported file type, or content does not match the declared type (upload only)
502AI image generation failed (generate only)
503Image generation is unavailable (generate only)