Riferimento API / AI utilities

AI utilities

Gli endpoint del gruppo AI utilities dell'API Voiceland AI, con parametri, schemi ed esempi curl.

Ultimo aggiornamento:

Le descrizioni degli endpoint e dei campi restano in inglese, esattamente come le pubblica l'API. È una scelta voluta: qui legge ciò che vedrà anche nelle risposte.

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.

Corpo della richiesta

application/json Schema: ChatRequest

Campo Tipo Obbligatorio Descrizione
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.

Risposte

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

Esempio di richiesta

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

Una risposta riuscita restituisce un StructuredResponse.

Esempio di risposta

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

Corpo della richiesta

multipart/form-data

Risposte

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

Esempio di richiesta

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"

Esempio di risposta

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

Schemi#

ChatMessage#

Campo Tipo Obbligatorio Descrizione
content string
role string

ChatRequest#

Ask a question over a transcript.

Campo Tipo Obbligatorio Descrizione
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#

Campo Tipo Obbligatorio Descrizione
completion_tokens integer
prompt_tokens integer
total_tokens integer

Error#

Error envelope returned for non-2xx responses.

Campo Tipo Obbligatorio Descrizione
error object

StructuredResponse#

Campo Tipo Obbligatorio Descrizione
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

La console

Queste pagine sono di sola lettura. La chiamata di prova, le chiavi API e il riferimento API aggiornato si trovano nella console, dove il suo account è connesso.

Apri la console