AI Image Generator API Reference - Magic Hour Docs
Create an AI image with advanced model selection and quality controls.
Documentation Index
Fetch the complete documentation index at: https://magichour-update-openapi-spec.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Bearer authentication header of the form Bearer <api_key>, where <api_key> is your API key. To get your API key, go to Developer Hub and click "Create new API Key".
Body
Body
Number of images to generate. Maximum varies by model.
1 <= x <= 161
The art style to use for image generation.
Give your image a custom name for easy identification.
"My Ai Image image"
The AI model to use for image generation. Each model has different capabilities and costs.
Models:
default- Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior.flux-schnell- from 5 credits/image- Supported resolutions: 640px, 1k, 2k
- Available for tiers: free, creator, pro, business
- Image count allowed: 1, 2, 3, 4
z-image-turbo- from 5 credits/image- Supported resolutions: 640px, 1k, 2k
- Available for tiers: free, creator, pro, business
- Image count allowed: 1, 2, 3, 4
seedream-v4- from 40 credits/image- Supported resolutions: 640px, 1k, 2k, 4k
- Available for tiers: creator, pro, business
- Image count allowed: 1, 2, 3, 4
nano-banana- from 50 credits/image- Supported resolutions: 640px, 1k
- Available for tiers: creator, pro, business
- Image count allowed: 1, 2, 3, 4
nano-banana-2- from 100 credits/image- Supported resolutions: 640px, 1k, 2k, 4k
- Available for tiers: creator, pro, business
- Image count allowed: 1, 4, 9, 16
nano-banana-pro- from 150 credits/image- Supported resolutions: 1k, 2k, 4k
- Available for tiers: creator, pro, business
- Image count allowed: 1, 4, 9, 16
gpt-image-2- from 50 credits/image- Supported resolutions: 640px, 1k, 2k, 4k
- Available for tiers: creator, pro, business
- Image count allowed: 1, 2, 3, 4
Deprecated Enum Values:
seedream- Useseedream-v4instead.
default, flux-schnell, z-image-turbo, seedream-v4, nano-banana, nano-banana-2, nano-banana-pro, gpt-image-2, seedream "default"
The aspect ratio of the output image(s). If not specified, defaults to 1:1 (square).
1:1, 16:9, 9:16 "1:1"
Maximum resolution (longest edge) for the output image.
Options:
640px— up to 640px1k— up to 1024px2k— up to 2048px4k— up to 4096pxauto— Deprecated. Mapped server-side from your subscription tier to the best matching resolution the model supports
Per-model support:
flux-schnell- 640px, 1k, 2kz-image-turbo- 640px, 1k, 2kseedream-v4- 640px, 1k, 2k, 4knano-banana- 640px, 1knano-banana-2- 640px, 1k, 2k, 4knano-banana-pro- 1k, 2k, 4kgpt-image-2- 640px, 1k, 2k, 4k
Note: Resolution availability depends on the model and your subscription tier.
auto, 640px, 1k, 2k, 4k "auto"
Response
Success
Success
Unique ID of the image. Use it with the Get image Project API to fetch status and downloads.
"cuid-example"
The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
5