Skip to content

    Development documentation — this describes the current development branch. Documented behavior may not exist in the latest release.

    OpenAI-compatible API

    Everything under /v1 follows the OpenAI audio API shape. Interactive docs are at /docs. These routes require the bearer key when API_KEY is set.

    Transcribe speech in its source language.

    FieldRequiredDefaultNotes
    fileyesAudio upload (multipart)
    modelnowhisper-1Accepted for compatibility, then ignored
    languagenoauto / DEFAULT_LANGUAGEForce a source language (e.g. es); unsupported codes return 400
    promptnoInitial decoding context (names, jargon)
    response_formatnojsontext, json, verbose_json, srt, vtt
    timestamp_granularities[]noSet to word with verbose_json for word timings
    temperatureno0.0Accepted for compatibility, then ignored
    Terminal window
    # Plain text (text/plain), OpenAI-compatible
    curl -X POST http://localhost:8000/v1/audio/transcriptions \
    -F 'file=@audio.mp3' -F 'response_format=text'
    # {"text": "..."}
    curl -X POST http://localhost:8000/v1/audio/transcriptions \
    -F 'file=@audio.mp3' -F 'response_format=json'

    Translate speech into English. Same multipart body as transcription minus language and timestamp_granularities — the source language is always auto-detected.

    Terminal window
    curl -X POST http://localhost:8000/v1/audio/translations \
    -F 'file=@spanish.mp3' -F 'response_format=text'
    ValueBodyContent type
    textRaw transcripttext/plain
    json{"text": "..."}application/json
    verbose_jsonObject (see below)application/json
    srtSubRip subtitles (HH:MM:SS,mmm)text/plain
    vttWebVTT subtitles (WEBVTT + HH:MM:SS.mmm)text/plain
    {
    "task": "transcribe",
    "language": "en",
    "duration": 11.0,
    "text": "...",
    "segments": [
    {
    "id": 0, "seek": 0, "start": 0.0, "end": 3.2, "text": "...",
    "tokens": [50364, 400],
    "temperature": 0.0, "avg_logprob": -0.21,
    "compression_ratio": 1.4, "no_speech_prob": 0.02
    }
    ],
    "words": [
    { "word": "Ask", "start": 0.0, "end": 0.3, "probability": 0.98 }
    ]
    }
    • segments[] is always present in verbose_json.
    • words[] is a flattened top-level array present only when timestamp_granularities[]=word was requested. Words are not nested inside segments (this matches the OpenAI shape).
    • For translations, task is translate and there is no words[].
    Terminal window
    curl -X POST http://localhost:8000/v1/audio/transcriptions \
    -F 'file=@audio.mp3' \
    -F 'response_format=verbose_json' \
    -F 'timestamp_granularities[]=word'

    Lists the configured model. Returns an OpenAI-style list whose ids include whisper-1 plus the loaded size (for example tiny or large-v3). Requires the bearer key when API_KEY is set; it answers 200 even while the model is warming.

    Errors use an OpenAI-shaped envelope:

    { "error": { "message": "...", "type": "invalid_request_error", "code": 400 } }

    A detail field is included alongside for the web console. Common cases:

    StatusCode / detailCause
    400Unsupported response_formatUnknown response_format
    400Unsupported language: <code>Unknown language
    401Invalid API keyMissing/invalid bearer key
    413Uploaded file is too largeBody exceeds MAX_UPLOAD_BYTES
    503model_warming / model_failedModel not ready (see Health and readiness)
    503queue_full / queue_timeoutAdmission gate shed load

    See Common errors for handling guidance and Compatibility for parity notes.