curl --request POST \
--url https://api.aiid.edu.kg/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2-2k",
"input": "生成一张 2K 横屏产品海报,白色运动鞋,干净棚拍光线,高级商业摄影风格。",
"stream": false,
"tools": [
{
"type": "image_generation"
}
],
"background": true
}
'{
"id": "resp_xxx",
"created_at": 1780649146,
"error": null,
"incomplete_details": null,
"instructions": null,
"metadata": {
"task_id": "010c31178d26436ca6194cde07931b33"
},
"model": "gpt-image-2-2k",
"object": "response",
"output": [],
"parallel_tool_calls": true,
"temperature": null,
"tool_choice": null,
"tools": null,
"top_p": null,
"max_output_tokens": null,
"previous_response_id": null,
"reasoning": null,
"status": "queued",
"text": null,
"truncation": null,
"usage": null,
"user": null,
"store": null
}Create response (OpenAI Responses API)
OpenAI Responses API, used to create model responses. Supports multi-turn conversations, tool calling, reasoning, and other features.
Add asynchronous image generation examples for OpenAI Responses API. background=true is used to submit background tasks; the create API returns status=queued and the full id immediately, then use that id to call GET /v1/responses/{response_id} to query the result.
Asynchronous image generation flow
- Call
POST /v1/responses, and passtools=[{ "type": "image_generation" }]andbackground=truein the request body. - Save the full
idreturned by the create API, for exampleresp_xxx. Do not truncate, rewrite, or save onlymetadata.task_id. - Call
GET /v1/responses/{response_id}to query untilstatus=completedorstatus=failed. - After success, read
output[].urlto get the image URL.
Example of creating an asynchronous image task
POST /v1/responses
Content-Type: application/json
{
"model": "gpt-image-2-2k",
"input": "生成一张 2K 横屏产品海报,白色运动鞋,干净棚拍光线,高级商业摄影风格。",
"stream": false,
"tools": [
{
"type": "image_generation"
}
],
"background": true
}
Edit Using a Reference Image and Specify Aspect Ratio
input can pass a message array; mix input_text and input_image in the content of the same user message. tools[].ratio specifies the aspect ratio for generation.
{
"model": "gpt-image-2-2k",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "生成新图片 4K, 16:9"
},
{
"type": "input_image",
"image_url": "https://imageproxy.zhongzhuan.chat/api/proxy/image/70a98de9c9d48160812454b4ee21edbf.jpg",
"detail": "auto"
}
]
}
],
"stream": false,
"tools": [
{
"type": "image_generation",
"ratio": "16:9"
}
],
"background": true
}
In this example, model is gpt-image-2-2k; if you need the 4K tier, use gpt-image-2-4k instead—do not just write “4K” in the prompt.
Create API response example:
{
"id": "resp_xxx",
"created_at": 1780649146,
"error": null,
"incomplete_details": null,
"instructions": null,
"metadata": {
"task_id": "010c31178d26436ca6194cde07931b33"
},
"model": "gpt-image-2-2k",
"object": "response",
"output": [],
"parallel_tool_calls": true,
"temperature": null,
"tool_choice": null,
"tools": null,
"top_p": null,
"max_output_tokens": null,
"previous_response_id": null,
"reasoning": null,
"status": "queued",
"text": null,
"truncation": null,
"usage": null,
"user": null,
"store": null
}
Supported models: gpt-image-2-2k, gpt-image-2-4k, and nano-banana-pro.
curl --request POST \
--url https://api.aiid.edu.kg/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2-2k",
"input": "生成一张 2K 横屏产品海报,白色运动鞋,干净棚拍光线,高级商业摄影风格。",
"stream": false,
"tools": [
{
"type": "image_generation"
}
],
"background": true
}
'{
"id": "resp_xxx",
"created_at": 1780649146,
"error": null,
"incomplete_details": null,
"instructions": null,
"metadata": {
"task_id": "010c31178d26436ca6194cde07931b33"
},
"model": "gpt-image-2-2k",
"object": "response",
"output": [],
"parallel_tool_calls": true,
"temperature": null,
"tool_choice": null,
"tools": null,
"top_p": null,
"max_output_tokens": null,
"previous_response_id": null,
"reasoning": null,
"status": "queued",
"text": null,
"truncation": null,
"usage": null,
"user": null,
"store": null
}Authorizations
Use Bearer Token authentication.
Format: Authorization: Bearer sk-xxxxxx
Body
The body is of type object.
Response
Response created successfully
"response"
completed, failed, in_progress, incomplete Hide child attributes
Hide child attributes
Prompt Tokens
Completion Tokens
Total Tokens
