Перейти к содержанию

Create a synthesis job

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

Queues a synthesis and answers at once, so a long text never keeps the connection waiting.

The body is the same as for POST /v1/tts/synthesize. Check the job with GET /v1/tts/jobs/{id} until it has succeeded or failed, then download its audio. You are charged only when the job succeeds.

Нужен API-ключ с tts:write.

Стоимость
за символ
Default voice
0,3 кредита
Voice clone
0,5 кредита

Заголовки

  • Idempotency-KeystringНеобязательный

    Makes a retry safe: the same key again answers 200 with the job it created, whatever its state, instead of queuing another. At most 191 characters, scoped to your organization, and released 24 hours after the job finishes.

Тело запроса

application/json

JSON-объект.

  • textstringОбязательно

    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].

    Мин. длина: 1

  • voice_idstring | nullНеобязательный

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

    Макс. длина: 128

  • languagestring | nullНеобязательный

    The language of the text.

    Допустимые значения:uzruenkkkytktgaz

  • qualitystring | nullНеобязательный

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

    Допустимые значения:faststandardhighnull

  • speednumber | nullНеобязательный

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

    Минимум: 0.5 · Максимум: 2

Ответ

200application/json

An idempotent replay: the job this Idempotency-Key already created.

  • dataobjectОбязательно
  • request_idstringОбязательно

    Формат: uuid

Заголовки

  • Idempotency-ReplayedstringНеобязательный

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

  • X-Request-IdstringНеобязательный

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

    Формат: uuid

  • X-RateLimit-LimitintegerНеобязательный

    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-RemainingintegerНеобязательный

    How many of them are left this minute.

Ошибки

  • 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

    Too many jobs in progress (too_many_active_jobs), or the rate limit is used up (rate_limit_exceeded). Retry after Retry-After seconds.

  • default

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