Asynchronous image generation and editing with task ID based result retrieval.
POST https://123api.co/v1/images/generations
curl --request POST \
--url https://123api.co/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-4o-image",
"prompt": "An ancient castle under the starry sky",
"size": "1:1",
"n": 1
}'curl --request POST \
--url https://123api.co/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-4o-image",
"prompt": "Turn this product shot into a clean studio-style advertising image",
"size": "1:1",
"n": 1,
"image_urls": [
"https://your-uploaded-image-url.example.com/source.png"
]
}'| Field | Type | Description |
|---|---|---|
model | string | Example: gpt-4o-image |
prompt | string | Image instruction |
size | string | Output aspect ratio or size option |
n | number | Number of images to generate |
image_urls | array | Optional reference images for edit workflows |
{
"task_id": "task-unified-123456",
"status": "queued",
"model": "gpt-4o-image"
}The response typically returns a task ID. Query task status to retrieve the final result.
n