Synthesize a dialogue
https://my.neuronai.uz/api/v1/tts/dialogueTurns a script of up to 100 turns, each spoken by its own voice, into one WAV file.
Each turn is billed at its own voice's rate. The X-Turns header says where each turn starts and ends in the audio, so a player can jump to a line.
Нужен API-ключ с tts:write.
Стоимость
за символ- Default voice
- 0,3 кредита
- Voice clone
- 0,5 кредита
Заголовки
Idempotency-KeystringНеобязательный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.
Тело запроса
application/jsonJSON-объект.
languagestring | nullНеобязательныйThe language of every turn that does not name its own.
Допустимые значения:
uzruenkkkytktgazgap_msinteger | nullНеобязательныйSilence between turns, in milliseconds, from 0 to 5000.
Минимум: 0 · Максимум: 5000
qualitystring | nullНеобязательныйfast,standard(the default) orhigh, for every turn that does not name its own.Допустимые значения:
faststandardhighnullspeednumber | nullНеобязательныйFrom 0.5 to 2, for every turn that does not name its own.
Минимум: 0.5 · Максимум: 2
turnsobject[]ОбязательноThe script, in order: 1 to 100 turns, at most 10000 characters in all.
Ответ
200audio/wavWAV audio of the stitched dialogue. Per-turn offsets are in X-Turns; pricing, latency and the request id are in headers.
Заголовки
X-CostnumberНеобязательныйThe price billed, in credits.
X-BalancenumberНеобязательныйYour balance after the charge, in credits.
X-Character-CountintegerНеобязательныйThe characters billed. An emotion tag counts as one.
X-Voice-CustomstringНеобязательный1when any turn used one of your clones, else0.Допустимые значения:
01X-Latency-MsnumberНеобязательныйTime the voices took, in milliseconds. May have a fraction.
Idempotency-ReplayedstringНеобязательный1when the answer is a replay of an earlier request with the sameIdempotency-Key.X-TurnsstringНеобязательныйWhere each turn is in the audio, so a client can seek to a line: a JSON array with one object per turn, holding
index,voice_id,start_s,end_sandduration_s. The times are in seconds.X-Turn-CountintegerНеобязательныйThe number of turns rendered.
X-Request-IdstringНеобязательныйIdentifies this request. A JSON body carries it as
request_idtoo; 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-Keyis 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-Keywas already used with a different body:idempotency_conflict. - 413
Either the script is over 10000 characters in total, or the request body itself is larger than the server accepts — either way,
input_too_large. - 422
The request failed validation (
invalid_request).error.fieldsnames each invalid field. - 429
A rate or concurrency limit was reached (
rate_limit_exceeded,concurrency_limit_exceeded). Retry afterRetry-Afterseconds. - 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) orservice_unavailable(503).