OpenAI Async Image API
One endpoint for text-to-image and edit. The path is chosen from whetherimage is present.
Models
How It Works
1
Create a task
POST /openai/images:- No
image→ generate - With
image→ edit - With
image+mask→ inpaint
{ "taskId": "..." }.2
Poll
GET /openai/tasks?taskId=<taskId> until completed or failed.3
Read the result
result follows response_format: default url (our S3). Set b64_json for base64. Only one field is returned.Quick Examples
Parameters
Size
Presets:auto 1024x1024 1536x1024 1024x1536 2048x2048 2048x1152 3840x2160 2160x3840
Custom WxH (e.g. 1280x960) must satisfy all:
- Each side ≤ 3840 px
- Width and height are multiples of 16
- Long : short ≤ 3:1
- Total pixels ∈ [655360, 8294400]
Task Status
Terminal results include
elapsedMs.
Endpoints
Sync official SDK? See OpenAI Compat.