Sozdai LogoDocs
Endpoints/Media

Submit media task

Submit asynchronous media generation tasks (e.g. text-to-image, text-to-video, AI music). The API returns a task ID immediately and freezes user credits, processing the generation asynchronously in the background.

POSThttps://api.sozdai.ai/v1/media/generations

#Authentication

All requests carry your API key in the Authorization header.

http
Authorization: Bearer sk-corr-...

#Request Parameters

ParameterTypeRequiredDescription
modelstringYesID of the media model to use, e.g. gpt-image-2 or kling-video
promptstringYesThe text prompt describing the content to generate
...anyNoOther model-specific parameters (refer to the individual model pages for details)

#Request Example

bash
curl https://api.sozdai.ai/v1/media/generations \
  -H "Authorization: Bearer $CORRY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "a futuristic city skyline in vaporwave style"
  }'

#Response Example

Returns the newly created media task's status and ID.

json
{
  "id": "task_abc123",
  "status": "pending"
}

Polling notice

After obtaining the task ID, you need to call the Query Media Task API to retrieve the generated media URL. Once the status becomes succeeded, result.urls will contain permanent file links.