Image Projects

AI Image Generator

Create an AI image with advanced model selection and quality controls.

post/v1/ai-image-generator

Request body

namestring

Give your image a custom name for easy identification.

image_countinteger required

Number of images to generate. Maximum varies by model.

model'default' | 'nano-banana-2' | 'gpt-image-2' | 'z-image-turbo' | 'flux-2-klein' | 'nano-banana-2-lite' | 'seedream-v4' | 'seedream-v5-pro' | 'nano-banana' | 'nano-banana-pro' | 'flux-schnell' | 'seedream'

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-2-klein - from 5 credits/image
    • Supported resolutions: 640px, 1k, 2k
    • Available for tiers: free, creator, pro, business
    • Image count allowed: 1
  • 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
  • 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
  • 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-2-lite - from 50 credits/image
    • Supported resolutions: 640px, 1k
    • Available for tiers: creator, pro, business
    • Image count allowed: 1, 2, 3, 4
  • 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
  • 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
  • seedream-v5-pro - from 75 credits/image
    • Supported resolutions: 640px, 1k, 2k
    • Available for tiers: 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

Deprecated Enum Values:

  • seedream - Use seedream-v4 instead.
aspect_ratio'1:1' | '16:9' | '9:16'

The aspect ratio of the output image(s). If not specified, defaults to 1:1 (square).

resolution'auto' | '640px' | '1k' | '2k' | '4k'

Maximum resolution (longest edge) for the output image.

Options:

  • 640px — up to 640px
  • 1k — up to 1024px
  • 2k — up to 2048px
  • 4k — up to 4096px
  • autoDeprecated. Mapped server-side from your subscription tier to the best matching resolution the model supports

Per-model support:

  • flux-2-klein - 640px, 1k, 2k
  • flux-schnell - 640px, 1k, 2k
  • gpt-image-2 - 640px, 1k, 2k, 4k
  • nano-banana - 640px, 1k
  • nano-banana-2 - 640px, 1k, 2k, 4k
  • nano-banana-2-lite - 640px, 1k
  • nano-banana-pro - 1k, 2k, 4k
  • seedream-v4 - 640px, 1k, 2k, 4k
  • seedream-v5-pro - 640px, 1k, 2k
  • z-image-turbo - 640px, 1k, 2k

Note: Resolution availability depends on the model and your subscription tier.

Example request

{
  "name": "My Ai Image image",
  "image_count": 1,
  "model": "default",
  "aspect_ratio": "1:1",
  "resolution": "auto",
  "style": {
    "prompt": "Cool image",
    "tool": "ai-anime-generator"
  }
}

Response

Success

idstring required

Unique ID of the image. Use it with the Get image Project API to fetch status and downloads.

credits_chargedinteger required

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.

Example response

{
  "id": "cuid-example",
  "credits_charged": 5
}

Changes

Changed in 11 of the 58 revisions of this API.2222

    • added the non-success response with the status

      response-non-success-status-added

    • removed the Not Found enum value from the response property for the response status

      response-property-enum-value-removed

    • removed the Unauthorized enum value from the response property for the response status

      response-property-enum-value-removed

    • added the required property to the response with the status

      response-required-property-added

    • added the required property to the response with the status

      response-required-property-added

    • added the required property to the response with the status

      response-required-property-added

    • added the required property to the response with the status

      response-required-property-added

    • added the required property to the response with the status

      response-required-property-added

    • added the new seedream-v5-pro enum value to the request property

      request-property-enum-value-added

    • added the new nano-banana-2-lite enum value to the request property

      request-property-enum-value-added

    • added the new flux-2-klein enum value to the request property

      request-property-enum-value-added

    • added the new gpt-image-2 enum value to the request property

      request-property-enum-value-added

    • added the new 1k enum value to the request property

      request-property-enum-value-added

    • added the new 640px enum value to the request property

      request-property-enum-value-added

    • added the new seedream-v4 enum value to the request property

      request-property-enum-value-added

    • the / request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • added the non-success response with the status

      response-non-success-status-added

    • added the new nano-banana enum value to the request property

      request-property-enum-value-added

    • added the new nano-banana-2 enum value to the request property

      request-property-enum-value-added

  • 9d8b16a5971524See the full diff
    • removed the request property

      request-property-removed

    • removed the request property /

      request-property-removed

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • the request property's max was increased from 4.00 to 16.00

      request-property-max-increased