Skip to content
OneAPIDocs
ModelsOpen console

API reference

Speech to text

OpenAI's transcription request. Upload a WAV file and the text comes back. See the Voice guide.

POSThttps://api.oneapi.id/v1/audio/transcriptions
Key header
Authorization: Bearer
Body
multipart/form-data, up to 200 MB
Billed
Seconds of audio, rounded up, at the input price

Form fields

modelstring required

A public model route, usually an stt model from GET /v1/audio/models.

filefile required

A WAV file holding 16-bit mono PCM, at a rate the model takes. Any other format answers 415.

languagestring

A hint such as id. Without it the model detects the language where it can.

response_formatstring

json (default), text or verbose_json, which adds segments and timings.

timestamp_granularities[]string

word asks for word timings, on models that offer them.

diarizationstring

true labels each segment with its speaker, on models that offer it.

Example

Request
curl https://api.oneapi.id/v1/audio/transcriptions \
  -H "Authorization: Bearer $ONEAPI_API_KEY" \
  -F model=muse-voice-transcribe-1.0 \
  -F language=id \
  -F response_format=verbose_json \
  -F [email protected]
200 OK with verbose_json, shape only
{
  "task": "transcribe",
  "text": "Halo, ini tes suara.",
  "language": "id",
  "duration": 2,
  "segments": [{ "id": 0, "text": "Halo, ini tes suara.", "start": 0, "end": 1.5 }],
  "words": []
}

Errors

Errors use the standard shape. A 415 means the file is not 16-bit WAV, or this model does not take its sample rate or channels. sample_rates in GET /v1/audio/models lists the rates each model takes.