Référence de l'API / AI utilities

AI utilities

Les endpoints du groupe AI utilities de l'API Voiceland AI, avec les paramètres, les schémas et des exemples curl.

Dernière mise à jour:

Les descriptions des endpoints et des champs restent en anglais, telles que l'API les publie. C'est un choix délibéré : vous lisez ici ce que vous verrez aussi dans les réponses.

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.

Corps de la requête

application/json Schéma : ChatRequest

Champ Type Requis Description
history array of ChatMessage Optional prior turns for multi-turn context.
max_tokens integer Optional cap on the response length.
mode string Oui freeform (default) returns an answer; structured also returns matched + a summary.
model string Optional model override from the account catalog.
question string Oui The question to answer about the transcript.
transcript string Oui The conversation text to reason over.

Réponses

Code Description
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Exemple de requête

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."
}'

Une réponse réussie renvoie un StructuredResponse.

Exemple de réponse

{
  "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.

Corps de la requête

multipart/form-data

Réponses

Code Description
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Exemple de requête

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"

Exemple de réponse

{
  "audio_duration_seconds": 12.3,
  "language": "el",
  "text": "Καλησπέρα…",
  "transcription_id": "…"
}

Schémas#

ChatMessage#

Champ Type Requis Description
content string Oui
role string Oui

ChatRequest#

Ask a question over a transcript.

Champ Type Requis Description
history array of ChatMessage Optional prior turns for multi-turn context.
max_tokens integer Optional cap on the response length.
mode string Oui freeform (default) returns an answer; structured also returns matched + a summary.
model string Optional model override from the account catalog.
question string Oui The question to answer about the transcript.
transcript string Oui The conversation text to reason over.

ChatUsage#

Champ Type Requis Description
completion_tokens integer Oui
prompt_tokens integer Oui
total_tokens integer Oui

Error#

Error envelope returned for non-2xx responses.

Champ Type Requis Description
error object Oui

StructuredResponse#

Champ Type Requis Description
answer string Oui The extracted answer.
matched boolean Oui Whether the transcript contained an answer.
model string Oui
summary string Oui A short summary of the transcript.
usage ChatUsage Oui

La console

Ces pages sont en lecture seule. L'appel de test, les clés API et la référence de l'API à jour se trouvent dans la console, où votre compte est connecté.

Ouvrir la console