POST /audio/v1/generations uses a unified request structure.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model code from the audio model catalog. |
prompt | string | Yes | Text to synthesize or generate audio from. Cannot be empty. |
voice | string | No | Voice or speaker identifier; specific values depend on the model. |
stream | boolean | Yes | Whether to use SSE streaming response. |
task | boolean | Yes | Whether to create an async task. |
upstream_options | object | No | Provider 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
| Header | Description |
|---|---|
x-trace-id | Business trace ID, recorded in task and usage logs. |
x-user-id | End-user ID from your application. |
x-agent-name | Calling 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.