Endpoint
Parameters
string
required
Model ID used when the task was submitted (e.g.,
nano-banana, flux-2).string
required
Task ID returned from the Generate Task endpoint.
Headers
string
required
Bearer token for API authentication. Format:
Bearer YOUR_API_KEYResponse
Task States
Response Fields
string
Unique task identifier.
string
Current task state:
pending, processing, success, or failed.string
JSON string containing
resultUrls array. Only present when state is success. Parse with JSON.parse().integer
Processing time in milliseconds. Only present on completion.
integer
Task creation timestamp (Unix milliseconds).
integer
Task completion timestamp (Unix milliseconds). Only present on completion.
string
Error code. Only present when
state is failed.string
Human-readable error message. Only present when
state is failed.State-Specific Responses
Pending / Processing
Success
Failed
HTTP
200 with state: "failed" means the API request succeeded but the task itself failed. Check failCode and failMsg for the reason. See Errors for all failure codes.Result URLs
TheresultUrls array contains direct links to generated content:
Examples
- cURL
- JavaScript
- Python
Polling Example
- JavaScript
- Python
Error Responses
See Errors for detailed error handling.