Generate image
POST/ai/generate-image
Generate an AI image from a text prompt. The image is stored in your media library and can be attached to posts via media_ids.
Requires the ai scope on your API key.
Available models:
| Model | Credits | Speed | Best for |
|---|---|---|---|
nano-banana-pro | 15 | ~5s | Best overall quality |
ideogram-v2 | 8 | ~5s | Text in images |
gemini-3-pro | 5 | ~8s | Smart/contextual |
flux-schnell | 1 | ~2s | Fast drafts |
Request
Responses
- 201
- 400
- 401
- 402
- 429
- 500
Image generated successfully
Invalid prompt, aspect ratio, or model
Missing or invalid API key
Insufficient AI credits
Rate limit exceeded
Response Headers
X-RateLimit-Limit
Request limit per window
X-RateLimit-Remaining
Remaining requests in current window
X-RateLimit-Reset
Unix timestamp when the window resets
Retry-After
Seconds to wait before retrying
Internal server error