Audio Generation

POSThttps://api.oneinfer.ai/v1/ula/generate-audio

Generate audio from text using the universal text-to-speech API. Name a TTS model and provide the text to speak; OneInfer picks the provider that serves the model.

Request headers

Authorizationstringrequired
Bearer token for authentication. Format: Bearer <YOUR_TOKEN>. Exchange your API key for a token via the Authentication endpoint.
Content-Typestringrequired
Set to application/json for all audio generation requests.

Request parameters

modelstringrequired
The speech model, by its name in the model catalog (e.g. "hexgrad/Kokoro-82M", "Qwen/Qwen3-TTS-VoiceDesign", "sarvam/bulbul:v3"). OneInfer picks the provider that serves it; the response's provider field says which one did.
promptstringrequired
Text to synthesize into speech. Each model takes up to a set number of characters; the Get Supported Voice for Audio Models endpoint gives it as max_characters.
streamboolean
If true, returns chunked audio bytes directly instead of JSON metadata.
voice_idstring
The voice. Most models take a preset voice name; get each model's voices and default from the Get Supported Voice for Audio Models endpoint. For Qwen/Qwen3-TTS-VoiceDesign, describe the voice in words instead, e.g. "a calm, deep male narrator with a British accent". Leave it out for models that have their own voice, such as ResembleAI/chatterbox-turbo.
formatstring
Output audio format (e.g. mp3, wav). Use mp3 when streaming.

Example request

Example TTS Request
{
    "model": "sarvam/bulbul:v3",
    "prompt": "Namaste from OneInfer audio generation.",
    "stream": false,
    "voice_id": "shubh",
    "format": "mp3",
    "speed": 1.0,
    "volume": 1.0,
    "pitch": 0
}
Example TTS Request: a voice described in words (Qwen3-TTS VoiceDesign)
{
    "model": "Qwen/Qwen3-TTS-VoiceDesign",
    "prompt": "Welcome back. Here is what changed this week.",
    "stream": false,
    "voice_id": "a calm, deep male narrator with a British accent",
    "format": "mp3"
}

Response

JSON
{
    "api_details": {
        "api_status": "success",
        "api_message": "API has returned response successfully."
    },
    "data": {
        "id": "aud_12345abcde",
        "created": 1711468800,
        "text": "Generated audio for prompt: Namaste from OneInfer audio generation.",
        "finish_reason": "stop",
        "provider": "sarvam",
        "model": "bulbul:v3",
        "usage": {
            "prompt_tokens": 7,
            "completion_tokens": 0,
            "total_tokens": 7
        },
        "latency_ms": 980,
        "audios": [
            {
                "url": "data:audio/mpeg;base64,....",
                "format": "mp3",
                "base64_data": "...",
                "mime_type": "audio/mpeg"
            }
        ]
    },
    "error": {}
}

Error status codes

CodeStatusDescription
200OKAudio generated successfully.
400Bad RequestInvalid request body or unsupported model.
401UnauthorizedMissing or invalid Authorization header / Bearer token.
403ForbiddenInsufficient credit balance.
422Unprocessable EntityRequest body failed schema validation.
500Internal Server ErrorUnexpected error during audio generation.

Response

202 - application/json