POST
/omni/media/v1/audio/generationsSpeech generation (TTS)
Text-to-speech is synchronous — text in, one audio file out as a signed URL. Same base URL and atp- key. The gateway routes your unified model to an audio provider (e.g. fish-s2-pro) and speaks the right dialect. There is no async task; GET /omni/media/v1/audio/tasks/{id} always returns 404.
- Output is written to object storage and returned as a signed edge URL (
https://media-<env>.atptoken.ai/v/...) with a 30-minute TTL — never inline base64. Fetch it promptly. - Requests are refused with
402 insufficient_quotawhen the project balance is ≤ 0.
Generate speech#
curl https://api.atptoken.ai/omni/media/v1/audio/generations \
-H "Authorization: Bearer atp-..." -H "Content-Type: application/json" \
-d '{ "model": "fish-s2-pro", "text": "Hello from ATP Token.", "format": "mp3" }'OpenAI-style clients: OpenAI TTS models also accept the OpenAI shape — input, voice, response_format — which the gateway maps.
Response#
200
{
"created": 1781776187,
"data": [
{ "url": "https://media-prod.atptoken.ai/v/audio/aud_....mp3?exp=...&sig=..." }
]
}Errors#
400
missing `model` / `text`, or an invalid `format`.
402
`insufficient_quota`: project balance ≤ 0; top up and retry (don't hammer).
422
the model has no audio provider.
Next steps
Was this page helpful?