Create an AI image with advanced model selection and quality controls.
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
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 - 5 credits/image
z-image-turbo - 5 credits/image
seedream - 30 credits/image
nano-banana-pro - 150 credits/image
default, flux-schnell, z-image-turbo, seedream, nano-banana-pro "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 for the generated image.
Options:
auto - Automatic resolution (all tiers, default)2k - Up to 2048px (requires Pro or Business tier)4k - Up to 4096px (requires Business tier)Note: Resolution availability depends on the model and your subscription tier. See model field for which resolutions each model supports. Defaults to auto if not specified.
auto, 2k, 4k "auto"
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