API-Referenz / AI utilities

AI utilities

Die Endpoints der Gruppe AI utilities der Voiceland AI API, mit Parametern, Schemata und Beispielen mit curl.

Zuletzt aktualisiert:

Die Beschreibungen der Endpoints und der Felder erscheinen auf Englisch, genau so, wie die API sie ausliefert. Das ist Absicht: Sie lesen hier, was Sie auch in den Antworten sehen.

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.

Anfragetext

application/json Schema: ChatRequest

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

Antworten

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

Beispielanfrage

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

Eine erfolgreiche Antwort liefert ein StructuredResponse.

Beispielantwort

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

Anfragetext

multipart/form-data

Antworten

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

Beispielanfrage

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"

Beispielantwort

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

Schemata#

ChatMessage#

Feld Typ Erforderlich Beschreibung
content string Ja
role string Ja

ChatRequest#

Ask a question over a transcript.

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

ChatUsage#

Feld Typ Erforderlich Beschreibung
completion_tokens integer Ja
prompt_tokens integer Ja
total_tokens integer Ja

Error#

Error envelope returned for non-2xx responses.

Feld Typ Erforderlich Beschreibung
error object Ja

StructuredResponse#

Feld Typ Erforderlich Beschreibung
answer string Ja The extracted answer.
matched boolean Ja Whether the transcript contained an answer.
model string Ja
summary string Ja A short summary of the transcript.
usage ChatUsage Ja

Die Konsole

Diese Seiten sind schreibgeschützt. Der Testanruf, die API-Schlüssel und die aktuelle API-Referenz finden Sie in der Konsole, in der Ihr Konto angemeldet ist.

Konsole öffnen