Images
Upload and AI-generate cover images for MisarBlog articles.
Images
Upload an Image
POST /images/upload
Uploads an image to the MisarBlog CDN and returns a permanent URL for use in articles.
Request
Send as multipart/form-data:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| file | binary | Yes | Image file (JPEG, PNG, WebP — max 10 MB) |
| type | string | No | cover | inline (default: inline) |
curl -X POST https://api.misar.io/blog/v1/images/upload \
-H "Authorization: Bearer mbk_YOUR_KEY" \
-F "[email protected]" \
-F "type=cover"
Response
200 OK
{
"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.
Request Body
{
"prompt": "A futuristic city skyline with glowing neon signs and flying cars at dusk",
"style": "photorealistic",
"aspect_ratio": "16:9"
}
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| prompt | string | Yes | Image description (max 500 chars) |
| style | string | No | photorealistic | illustration | minimal (default: photorealistic) |
| aspect_ratio | string | No | 16:9 | 1:1 | 4:3 (default: 16:9) |
Response
200 OK
{
"url": "https://supabase-blog.misar.io/storage/v1/object/public/ai-covers/gen_abc123.jpg",
"prompt": "A futuristic city skyline...",
"width": 1280,
"height": 720
}
Generation typically takes 3–8 seconds. The URL is permanent and CDN-cached.
Plan Limits
| Plan | AI Generations/month | |------|---------------------| | Free | 5 | | Pro | 50 | | Business | 500 |
Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid aspect ratio or style |
| 401 | Invalid or missing API key |
| 413 | File too large (upload only) |
| 429 | Rate limit or generation quota exceeded |