API reference
Speech to text
OpenAI's transcription request. Upload a WAV file and the text comes back. See the Voice guide.
POST
https://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 requiredA public model route, usually an stt model from GET /v1/audio/models.
filefile requiredA WAV file holding 16-bit mono PCM, at a rate the model takes. Any other format answers 415.
languagestringA hint such as id. Without it the model detects the language where it can.
response_formatstringjson (default), text or verbose_json, which adds segments and timings.
timestamp_granularities[]stringword asks for word timings, on models that offer them.
diarizationstringtrue labels each segment with its speaker, on models that offer it.
Example
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]{
"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.