К обзору модели

API-документация

Подробное подключение Task API для ElevenLabs Text-to-Dialogue V3

API-документация

Эндпоинт

Базовый URLhttps://api.mashagpt.ru/v1
Эндпоинт
POST
/v1/tasks/elevenlabs-text-to-dialogue-v3
Авторизация
x-api-key: YOUR_API_KEY
илиAuthorization: Bearer YOUR_API_KEY

Параметры запроса

ПараметрТипОписание
dialogue*
arrayArray of dialogue lines, each with text and voice. Total text across all lines max 5000 characters. Пример — [{"text":"[excitedly] Hey Jessica! Have you tried the new ElevenLabs V3?","voice":"Liam"},{"text":"[curiously] Yeah, just got it! The emotion is so amazing. I can actually do whispers now— [whispering] like this!","voice":"Jessica"}].
stability
numberVoice stability control. The Eleven v3 dialogue endpoint only accepts the discrete modes 0 (Creative), 0.5 (Natural) and 1 (Robust); other values are snapped to the nearest mode before submission. Диапазон 0–1. По умолчанию — 0.5.
languageCode
stringДопустимые значения: auto, af, ar, hy, as, az, be, bn, bs, bg, ca, ceb, ny, hr, cs, da, nl, en, et, fil, fi, fr, gl, ka, de, el, gu, ha, he, hi, hu, is, id, ga, it, ja, jv, kn, kk, ky, ko, lv, ln, lt, lb, mk, ms, ml, zh, mr, ne, no, ps, fa, pl, pt, pa, ro, ru, sr, sd, sk, sl, so, es, sw, sv, ta, te, th, tr, uk, ur, vi, cy. Language code for generation. Use "auto" for auto-detection or specify a language code. По умолчанию — auto.

Пример запроса и ответа

Запрос
curl -X POST https://api.mashagpt.ru/v1/tasks/elevenlabs-text-to-dialogue-v3 \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "dialogue": [
    {
      "text": "[excitedly] Hey Jessica! Have you tried the new ElevenLabs V3?",
      "voice": "Liam"
    },
    {
      "text": "[curiously] Yeah, just got it! The emotion is so amazing. I can actually do whispers now— [whispering] like this!",
      "voice": "Jessica"
    }
  ],
  "stability": 0.5,
  "languageCode": "auto"
}'
Ответ
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "550e8400-e29b-41d4-a716-446655440000",
    "state": "queued"
  }
}

Асинхронная обработка

Модель работает асинхронно. После запроса вы получите taskId задачи для отслеживания статуса.

GET
/v1/tasks/{id}статус задачи
Проверка статуса задачи:
curl -X GET "https://api.mashagpt.ru/v1/tasks/{task_id}" \
  -H "x-api-key: YOUR_API_KEY"

Жизненный цикл задачи:

queuedprocessingcompleted|failed