Text to Image
gpt-image-2-official
Official-channel image generation with text, reference-image, and mask workflows.
Commercial useAsync APIfrom 28 Credits
API reference
Submit this model to the capability endpoint, then poll the returned job until it is terminal. Only the parameters below are accepted.
Required headers
Authorization: Bearer $ARTANY_API_KEY Content-Type: application/json Idempotency-Key: unique-request-id
Use a new 8–128 character Idempotency-Key for each logical generation. Retrying the same request with the same key will not double-charge.
Request body
{
"model": "gpt-image-2-official",
"prompt": "A detailed poster of a night market in the rain",
"n": 1,
"size": "16:9",
"resolution": "2k",
"quality": "high",
"background": "auto",
"moderation": "auto",
"output_format": "png"
}Parameters
| Field | Type | Required | Description | Default | Constraints |
|---|---|---|---|---|---|
| model | string | Yes | Stable Artany public model ID. | gpt-image-2-official | This exact public model ID. |
| n | integer | No | Model-specific image generation option. See its allowed values and constraints in this row. | 1 | Range: 1–4 |
| size | string | No | Requested output image aspect ratio or canvas size. Available values are model-specific. | "1:1" | Allowed: auto, 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 3:1, 1:3, 21:9, 9:21 |
| prompt | string | Yes | Natural-language instruction describing the desired image or video. Include subject, setting, composition, motion, lighting, and style as needed. | — | Length: 1–12000 |
| quality | string | No | Requested quality tier for a supported image model. It may affect latency and price. | "auto" | Allowed: auto, low, medium, high |
| mask_url | string | No | Public URL of a mask image that identifies the editable area in a supported image-editing request. | — | Format: uri |
| background | string | No | Background handling option for image output when transparency or a solid background is supported. | "auto" | Allowed: auto, opaque |
| image_urls | array (string items) | No | Public image URLs or supported image data used as source or reference images. | — | Items: 1–16 |
| moderation | string | No | Provider moderation setting used when the selected image workflow supports it. | "auto" | Allowed: auto, low |
| resolution | string | No | Requested output quality tier. Available values are model-specific and can affect price. | "1k" | Allowed: 1k, 2k, 4k |
| output_format | string | No | Requested file format for the generated image when the selected model supports format selection. | "png" | Allowed: png, jpeg, webp |
| output_compression | integer | No | Compression level for a supported output format. Higher compression may reduce file size and fidelity. | — | Range: 0–100 |
Accepted response
The submit endpoint returns HTTP 202 with a normalized job. Poll GET /v1/jobs/{jobId} until the status is terminal.
{
"id": "job_…",
"object": "generation.job",
"model": "gpt-image-2-official",
"status": "queued",
"progress": 0,
"output": null,
"error": null,
"billing": {
"estimated_credits": "28",
"frozen_credits": "…",
"charged_credits": "0",
"state": "frozen",
"price_version": "2026-07-18.picverse-parity"
},
"created_at": "2026-07-21T00:00:00.000Z",
"completed_at": null
}Lifecycle and failures
- queued / running — wait and poll again.
- succeeded — read output URLs from
output; the actual charge is settled. - failed / canceled — inspect
error; frozen Credits are released. - For a schema error, the API returns an error object and identifies the invalid field in
paramwhen applicable.
Input
Runs are billed to your Credits at the listed price — same engine as the public API.
Output
Run the model to see results here
Pricing details
Fixed catalog pricing — the listed price is exactly what a run settles for. Version 2026-07-18.picverse-parity.
| Model | n | size | quality | resolution | Price |
|---|---|---|---|---|---|
| gpt-image-2-official | 1 | 1:2 | low | 2k | 1Credits · ~$0.0100 |
| gpt-image-2-official | 1 | 1:2 | auto | 2k | 1Credits · ~$0.0100 |
| gpt-image-2-official | 1 | 1:3 | low | 1k | 1Credits · ~$0.0100 |
| gpt-image-2-official | 1 | 1:3 | auto | 1k | 1Credits · ~$0.0100 |
| gpt-image-2-official | 1 | 1:3 | low | 2k | 1Credits · ~$0.0100 |
| gpt-image-2-official | 1 | 1:3 | auto | 2k | 1Credits · ~$0.0100 |
| gpt-image-2-official | 1 | 1:3 | low | 4k | 1Credits · ~$0.0100 |
| gpt-image-2-official | 1 | 1:3 | auto | 4k | 1Credits · ~$0.0100 |
Integrate in minutes
curl -X POST "https://api.artany.ai/v1/images/generations" \
-H "Authorization: Bearer $ARTANY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: unique-request-id" \
-d '{"model":"gpt-image-2-official","prompt":"A detailed poster of a night market in the rain","n":1,"size":"16:9","resolution":"2k","quality":"high","background":"auto","moderation":"auto","output_format":"png"}'
# poll until terminal
curl "https://api.artany.ai/v1/jobs/{job_id}" \
-H "Authorization: Bearer $ARTANY_API_KEY"