Skip to content
Docs menu

Image models

GPT Image 2

On this page

GPT Image 2 — fast, high-fidelity AI image generation & editing.

modelIdgpt-image-2-text-to-image
Modalityimage
PricingSee this model on the Pricing page for the current per-call price (with your markup).

Operations

OperationEndpointDescription
Text to imagePOST /api/v1/generateBase generation from a text prompt.
Poll taskGET /api/v1/task/{id}?model=gpt-image-2-text-to-imageRetrieve state and result URLs.

Input parameters

FieldTypeRequiredValues / example
prompttextarearequiredEnter your text here...
aspect_ratioselectoptionalauto, 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 2:1, 1:2, 3:1, 1:3, 21:9, 9:21, 5:4, 4:5
resolutionselectoptional1K, 2K, 4K

Example request

bash
curl -X POST https://you.bot/api/v1/generate \
  -H "Authorization: Bearer $YOUBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modelId":"gpt-image-2-text-to-image","input":{"prompt":"A vintage brass diving helmet overgrown with coral and tiny anemones, resting on pale sand in slanting shafts of turquoise underwater light.","aspect_ratio":"auto","resolution":"1K"}}'