Batch Text-to-Speech

    Generate spoken audio from text in a single synchronous request using VALSEA voice aliases. For low-latency streaming playback, use Real-time Voice.

    Voices

    VALSEA exposes stable voice aliases. The same alias maps to the appropriate voice for the requested language.

    VoiceDescription
    valsea-neutralDefault balanced voice
    valsea-maleMale voice
    valsea-femaleFemale voice

    The three aliases above apply to every supported language except Arabic. Arabic uses one of these dedicated voice presets:

    VoiceDescription
    valsea-arabic-mid-female-emiratiMid-Female (Emirati)
    valsea-arabic-lively-female-emiratiLively-Female (Emirati)
    valsea-arabic-calm-male-emiratiCalm-Male (Emirati)
    valsea-arabic-calm-mid-male-emiratiCalm-Mid-Male (Emirati)

    Each Arabic preset has tuned default speed and stability values. Omit either field or pass "default" to use the preset default.

    Batch vs. Real-time TTS

    Batch and real-time TTS generate speech from text, but they are separate delivery modes:

    ModeEndpointModelDelivery
    Batch TTSPOST /v1/audio/speechvalsea-ttsReturns the complete audio response
    Real-time TTSWS /v1/realtime/ttsvalsea-tts-realtimeStreams audio chunks as they are generated

    Both modes use the same stable VALSEA voice names, including the dedicated Arabic presets. Language availability differs slightly by mode.

    Supported Languages

    Batch TTS accepts vietnamese, english, english-in, hindi, bengali-in, kannada, malayalam, marathi, odia (also accepted as oriya), punjabi, tamil, telugu, gujarati, sinhala, and arabic.

    Audio samples

    Vietnamese sample

    English sample

    Request body

    ParameterTypeRequiredDescription
    modelvalsea-ttsYesPublic TTS model name.
    inputstringYesText to synthesize, up to 10,000 characters. Requests exceeding this limit are rejected with a 400 error (not truncated).
    voicevalsea-neutral | valsea-male | valsea-female | an Arabic presetYesVoice name. Arabic presets are valid only with language: "arabic"; Arabic requires an Arabic preset.
    languagevietnamese | english | english-in | hindi | bengali-in | kannada | malayalam | marathi | odia | oriya | punjabi | tamil | telugu | gujarati | sinhala | arabicNoLanguage for voice routing. Default: vietnamese.
    response_formatmp3 | wavNoAudio response format. Default: mp3.
    speednumber | "default"NoPlayback speed from 0.25 to 4. Omit or use "default" for the platform or Arabic-preset default.
    stabilitynumber | "default"NoStability from 0 to 1. Used by Arabic presets; omit or use "default" for the preset default.
    normalizationno | basic | advancedNoText normalization level. Default: basic.
    audio_qualityintegerNoBitrate/quality value. Supported: 32, 64, 128, 192, 256, 320. Default: 64.

    Code examples

    import fs from 'fs/promises';
    import OpenAI from 'openai';
    
    const client = new OpenAI({
      apiKey: 'YOUR_API_KEY',
      baseURL: 'https://api.valsea.ai/v1',
    });
    
    const response = await client.audio.speech.create({
      model: 'valsea-tts',
      voice: 'valsea-neutral',
      input: 'Xin chao, day la giong noi VALSEA.',
      response_format: 'mp3',
      extra_body: { language: 'vietnamese' },
    });
    
    const buffer = Buffer.from(await response.arrayBuffer());
    await fs.writeFile('speech.mp3', buffer);
    

    Billing

    TTS is billed by generated audio duration, rounded up to the next whole minute. The response includes normal credit headers such as X-Credits-Used.

    Was this page helpful?