Skip to main content

Overview

GPT Image 1 is an OpenAI image generation model for prompt-based image creation and reference-guided generation. Use this page when you are ready to call the API after trying the model in the APIXO playground.

Endpoint and authentication

Base URL:
All requests require your APIXO API key:
Submit requests also require:

Copy-paste async quickstart

This minimal request submits a text-to-image task and returns a taskId.
Successful response:
Save the taskId; you need it to poll for the final result.

Poll for result

Processing response:
Success response:
Failed response:
Parse resultJson after state becomes success:

Request body

Text-to-image

Reference-guided generation

Parameters

request_type
string
default:"async"
required
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
callback_url
string
Required when request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.
input
object
required
GPT Image 1 input parameters.

Response format

Submit task response

POST /generateTask/gpt-image-1 returns a task ID when the task is accepted:
code
integer
API status code. 200 means the task was accepted.
message
string
Human-readable status message.
data.taskId
string
Unique task identifier used with the status endpoint.

Status response fields

taskId
string
Unique task identifier.
state
string
Current task state: processing, success, or failed.
resultJson
string
JSON string containing the generated image URLs. Present when state is success.
failCode
string
Machine-readable failure code. Present when state is failed.
failMsg
string
Human-readable failure message. Present when state is failed.
createTime
integer
Task creation timestamp in Unix milliseconds.
completeTime
integer
Task completion timestamp in Unix milliseconds. Present after completion.
costTime
integer
Processing duration in milliseconds. Present after completion.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
See Webhooks for delivery requirements and retry behavior.

Billing

GPT Image 1 is billed per generated image. The selected num_images value determines the number of images requested. For current route and market comparison pricing, see Pricing.

Latency and polling

Actual latency may vary by prompt complexity, reference image count, provider route, and current queue load.
For high-concurrency production workloads, use callback mode to avoid frequent polling.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

Task failure codes

Tips

  • prompt must be a non-empty string and cannot exceed 10000 characters.
  • aspect_ratio is required. Use 1:1 for square outputs, 3:2 for landscape images, or 2:3 for portrait images.
  • num_images is required. Supported values are 1, 2, and 4.
  • image_urls supports JPG, PNG, and WebP reference images, up to 10 MB per image. Use public, direct HTTP(S) image URLs.
  • Result URLs are normally stored for 15 days. Download and store important outputs promptly.
See Error Codes for the full error reference.