POST /audio/v1/generations uses a unified request structure.

Request parameters

ParameterTypeRequiredDescription
modelstringYesModel code from the audio model catalog.
promptstringYesText to synthesize or generate audio from. Cannot be empty.
voicestringNoVoice or speaker identifier; specific values depend on the model.
streambooleanYesWhether to use SSE streaming response.
taskbooleanYesWhether to create an async task.
upstream_optionsobjectNoProvider or model-specific parameters.

stream and task cannot both be true.

upstream_options

Must be a JSON object, not an array or null. Used to pass provider or model-specific parameters.

{
  "upstream_options": {
    "unique_id": "your-business-request-id"
  }
}

Async tasks support upstream_options.unique_id for business-level idempotency.

Request tracing headers

HeaderDescription
x-trace-idBusiness trace ID, recorded in task and usage logs.
x-user-idEnd-user ID from your application.
x-agent-nameCalling agent or service name.

Example:

curl -X POST https://51kik.com/audio/v1/generations \
  -H 'Authorization: Bearer sk-xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -H 'x-trace-id: audio-demo-001' \
  -H 'x-user-id: user-42' \
  -H 'x-agent-name: voice-worker' \
  -d '{"model": "<audio-model>", "prompt": "A sample text.", "stream": false, "task": false}'

Body size limit

Request body limit is 50 MB.