Image Generation
Submit an asynchronous task using native ChatArt parameters.
Send Authorization: Bearer YOUR_API_KEY. Create a key in API Keys after signing in with a ChatArt account. New keys are stored encrypted and can be revealed in API Keys; authentication uses their hashes. Older hash-only keys cannot be revealed. Deleting a key revokes it immediately. Keys and tasks are isolated by account and application.
Request body
Use JSON, maximum 32KB. Unsupported fields and invalid model settings are rejected.
| Field | Type | Required | Description |
|---|---|---|---|
| gpt_type | string | Required | Native ChatArt identifier returned by GET /v1/models. |
| description | string | Required | Image prompt. |
| picture_counts | integer | Optional | Default 1; native validation also enforces model/scene limits. |
| picture_scale | string | Optional | Model-supported aspect ratio. |
| reference_image | string[] | Optional | Reference images. Defaults to an empty list. |
| image_definition | integer | Optional | Native resolution: 1=1K, 2=2K, 3=4K. Art 5.0 and Seedream 5.0 Lite use 3=3K. Default 1; override where required by the model quote. |
| quality | string | Optional | Thinking quality for GPT Image models. Defaults to low; choose a tier listed in Models. |
Further native fields: style, detailed, gen_content, scene_id, style_url, product_images, person_image, reference_templates, product_type, is_fast_channel_switch. Ordinary text/reference image scenes are selected from the supplied references. Only ordinary text/image scenes 4 and 13 are enabled for API billing; special scenes are rejected.
curl -X POST "$CHATART_API_BASE_URL/v1/images" \
-H "Authorization: Bearer $CHATART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gpt_type": "gpt-image-2.6-flare",
"description": "A quiet ocean at sunrise",
"picture_scale": "1:1",
"picture_counts": 1,
"image_definition": 1,
"quality": "low"
}'Reference input examples
curl -X POST "$CHATART_API_BASE_URL/v1/images" \
-H "Authorization: Bearer $CHATART_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"gpt_type": "gpt-image-2.6-flare",
"description": "A quiet ocean at sunrise",
"picture_scale": "1:1",
"picture_counts": 1,
"image_definition": 1,
"quality": "low",
"reference_image": [
"https://cdn.example.com/character.png",
"https://cdn.example.com/scene.png"
]
}'Response
{
"code": 200,
"message": "success",
"data": {
"task_id": "task_example",
"status": "processing"
}
}Billing and retries
Each successful POST creates a new task and reserve API credits. Idempotency keys are not implemented. Do not automatically retry after a timeout or an uncertain submission. Check the portal Logs and ChatArt generation history first. Interrupted submissions appear as submission_unknown; they are never automatically submitted again.
Success responses use {code:200,message,data}. Creation returns HTTP 202; reads return 200. Errors use HTTP 400/401/402/403/404/409/422/500 and the same envelope with data:null. HTTP 402 indicates insufficient independent API credits. Native validation errors retain their business error codes. A model appearing in the web catalogue does not imply all parameter combinations are supported.
Image status
Use the returned task_id to poll progress and retrieve result URLs. See Task Status for response fields and terminal states.