Endpoints/Media
Get media task
Retrieve the status and result of an async media task by its id. Poll this endpoint until status is succeeded or failed.
GET
https://api.sozdai.ai/v1/media/generations/{id}#Authentication
All requests carry your key in the Authorization header.
http
Authorization: Bearer sk-corr-...#Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The task id returned by the create-task endpoint. |
#Request example
bash
curl https://api.sozdai.ai/v1/media/generations/task_abc123 \
-H "Authorization: Bearer $CORRY_KEY"#Response
Returns the task object. Common fields:
| Field | Type | Description |
|---|---|---|
id | string | Get media task id |
status | string | Task status: queued / submitted / succeeded / failed / timeout. |
type | string | Media type: image / video / music. |
model | string | The model you requested. |
result.urls | string[] | Present on success. result.urls is an array of permanent file URLs. |
error | string | Error message, present when the task failed. |
cost | string | Amount charged for this task — a USD string (e.g. "0.1200"). See the currency field. |
Response examples
{
"id": "task_abc123",
"status": "running",
"type": "image",
"model": "gpt-image-2"
}#Status values
| status | Description |
|---|---|
queued | Queued, waiting to start. |
running | Generating on the upstream provider. |
succeeded | Done — result.urls is available. |
failed | Failed — see error. The hold is automatically refunded. |
succeeded
Present on success. result.urls is an array of permanent file URLs.
#Error codes
| Status | Meaning |
|---|---|
401 | Invalid or missing key |
404 | The requested model does not exist or is unavailable |
json
{
"error": {
"message": "Task not found",
"type": "not_found"
}
}