Asosiy mazmunga oʻtish

Synthesize speech

POSThttps://my.neuronai.uz/api/v1/tts/synthesize

Turns text into speech with a stock voice or one of your voice clones, and answers with the audio as WAV.

The cost, the characters billed and your balance come back in the response headers. For long texts, queue a job with POST /v1/tts/jobs instead.

tts:write ruxsatli API kalit kerak.

Narx
har bir belgi uchun
Default voice
0,3 kredit
Voice clone
0,5 kredit

Sarlavhalar

  • Idempotency-KeystringIxtiyoriy

    Makes a retry safe: the same key again returns the original audio and headers instead of synthesizing and charging again. At most 191 characters, scoped to your organization and kept for 7 days.

Soʻrov tanasi

application/json

JSON obyekt.

  • textstringMajburiy

    The text to speak. Emotion tags such as [laughter] or [sigh] are acted out, not read aloud, and count as one character each. The tags: [laughter], [sigh], [dissatisfaction-hnn], [confirmation-en], [question-en], [question-ah], [question-oh], [question-ei], [question-yi], [surprise-ah], [surprise-oh], [surprise-wa], [surprise-yo].

    Min. uzunlik: 1

  • voice_idstring | nullIxtiyoriy

    A stock voice or one of your voice clones (GET /v1/tts/voices).

    Maks. uzunlik: 128

  • languagestring | nullIxtiyoriy

    The language of the text.

    Ruxsat etilgan qiymatlar:uzruenkkkytktgaz

  • qualitystring | nullIxtiyoriy

    fast for the lowest latency, standard (the default) for balance, or high for the best fidelity.

    Ruxsat etilgan qiymatlar:faststandardhighnull

  • speednumber | nullIxtiyoriy

    How fast the voice speaks, from 0.5 to 2. 1 is normal.

    Eng kami: 0.5 · Eng koʻpi: 2

Javob

200audio/wav

WAV audio of the synthesized speech. Pricing, latency and the request id are in headers.

Sarlavhalar

  • X-CostnumberIxtiyoriy

    The price billed, in credits.

  • X-BalancenumberIxtiyoriy

    Your balance after the charge, in credits.

  • X-Character-CountintegerIxtiyoriy

    The characters billed. An emotion tag counts as one.

  • X-Voice-CustomstringIxtiyoriy

    1 when the voice is one of your clones, 0 for a stock voice.

    Ruxsat etilgan qiymatlar:01

  • X-Latency-MsnumberIxtiyoriy

    Time the voice took, in milliseconds. May have a fraction.

  • Idempotency-ReplayedstringIxtiyoriy

    1 when the answer is a replay of an earlier request with the same Idempotency-Key.

  • X-Request-IdstringIxtiyoriy

    Identifies this request. A JSON body carries it as request_id too; quote it to support.

    Format: uuid

  • X-RateLimit-LimitintegerIxtiyoriy

    The requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.

  • X-RateLimit-RemainingintegerIxtiyoriy

    How many of them are left this minute.

Xatolar

  • 400

    The Idempotency-Key is over 191 characters: invalid_request.

  • 401

    The API key is missing or not recognized (invalid_api_key), revoked (api_key_revoked), disabled (api_key_disabled) or expired (api_key_expired).

  • 402

    Not enough balance (insufficient_balance), or the charge would pass this key's monthly spend limit (spend_limit_exceeded).

  • 403

    The key lacks the permission (insufficient_permissions), the IP is not allowed (ip_not_allowed), or the voice cannot be used (voice_unavailable).

  • 409

    The Idempotency-Key was already used with a different body: idempotency_conflict.

  • 422

    The request failed validation (invalid_request). error.fields names each invalid field.

  • 429

    A rate or concurrency limit was reached (rate_limit_exceeded, concurrency_limit_exceeded). Retry after Retry-After seconds.

  • 500

    Synthesis failed (synthesis_failed) or something else went wrong (server_error). Nothing is charged.

  • 503

    Either the audio was made but could not be stored for an idempotent retry (storage_failed), or the API itself is down for maintenance (service_unavailable).

  • default

    Any other error, in the same shape, such as server_error (500) or service_unavailable (503).