Справочник API / AI utilities
AI utilities
Endpoints группы AI utilities в API Voiceland AI, с параметрами, схемами и примерами curl.
Последнее обновление:
Описания endpoints и полей показаны на английском языке, ровно так, как их публикует API. Это наш выбор: здесь вы читаете то же, что увидите в ответах.
POST /v1/chat#
Ask a question over a transcript. Answers a question about a transcript. freeform returns an answer; structured also returns matched + a summary.
Тело запроса
application/json Схема: ChatRequest
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
history |
array of ChatMessage |
Optional prior turns for multi-turn context. | |
max_tokens |
integer | Optional cap on the response length. | |
mode |
string | Да | freeform (default) returns an answer; structured also returns matched + a summary. |
model |
string | Optional model override from the account catalog. | |
question |
string | Да | The question to answer about the transcript. |
transcript |
string | Да | The conversation text to reason over. |
Ответы
| Код | Описание |
|---|---|
200 |
Success. |
401 |
Missing or invalid API key. |
4XX |
Request error (validation, not-found, etc.). |
5XX |
Server or upstream error. |
Пример запроса
curl -X POST "https://api.voiceland.ai/v1/chat" \
-H "Authorization: Bearer VL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "structured",
"question": "What order number?",
"transcript": "caller: cancel order 4471\nagent: done."
}'
Успешный ответ возвращает StructuredResponse.
Пример ответа
{
"answer": "4471",
"matched": true,
"summary": "Caller cancelled order 4471."
}
POST /v1/transcribe#
Transcribe audio. Transcribes an uploaded audio file. Send multipart/form-data with a file part; optional language, model, and speaker_diarization fields.
Тело запроса
multipart/form-data
Ответы
| Код | Описание |
|---|---|
200 |
Success. |
401 |
Missing or invalid API key. |
4XX |
Request error (validation, not-found, etc.). |
5XX |
Server or upstream error. |
Пример запроса
curl -X POST "https://api.voiceland.ai/v1/transcribe" \
-H "Authorization: Bearer VL_API_KEY" \
-F "file=@audio.wav" \
-F "language=el" \
-F "speaker_diarization=true"
Пример ответа
{
"audio_duration_seconds": 12.3,
"language": "el",
"text": "Καλησπέρα…",
"transcription_id": "…"
}
Схемы#
ChatMessage#
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
content |
string | Да | |
role |
string | Да |
ChatRequest#
Ask a question over a transcript.
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
history |
array of ChatMessage |
Optional prior turns for multi-turn context. | |
max_tokens |
integer | Optional cap on the response length. | |
mode |
string | Да | freeform (default) returns an answer; structured also returns matched + a summary. |
model |
string | Optional model override from the account catalog. | |
question |
string | Да | The question to answer about the transcript. |
transcript |
string | Да | The conversation text to reason over. |
ChatUsage#
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
completion_tokens |
integer | Да | |
prompt_tokens |
integer | Да | |
total_tokens |
integer | Да |
Error#
Error envelope returned for non-2xx responses.
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
error |
object | Да |
StructuredResponse#
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
answer |
string | Да | The extracted answer. |
matched |
boolean | Да | Whether the transcript contained an answer. |
model |
string | Да | |
summary |
string | Да | A short summary of the transcript. |
usage |
ChatUsage |
Да |