Skip to main content
A transcription model turns speech into text: voice messages, video soundtracks, recordings. On request, it also returns timestamps per segment or per word. POST /api/v1/hub/audio/transcriptions transcribes one audio file synchronously, with the OpenAI Audio Transcriptions contract. A client built with an OpenAI SDK only needs to change its base URL to https://fanifyai.com/api/v1/hub.

Transcribe a file

Find transcription models in GET /api/v1/hub/models: their output_modalities contain transcription. Examples: voxtral-mini-transcribe-3-0, voxtral-small-transcribe-3-0, qwen3-asr-1.7b, whisper-large-v3-turbo. Call a transcription model through this route only; other routes, including POST /api/v1/hub/generations, reject it with 400 invalid_input, and this route rejects chat, decision, embeddings, and media models the same way.

Request

Send the audio file itself, as multipart/form-data (recommended) or as JSON. The Hub never downloads an audio URL, and it does not accept a sha256: reference to an uploaded file.

multipart/form-data

diarize and keyterms are forwarded to models that support them. Unknown parts are ignored. Part names are accepted with or without quotes.

JSON

body.json
input_audio.data is the file encoded in raw base64, without a data:audio/…;base64, prefix; decoded, it must not exceed 25 MB. input_audio.format gives the audio format. The other fields are the same as in multipart; timestamp_granularities is then an array. input_audio.url is refused. Prefer multipart: base64 makes the request a third larger.

Audio formats

Accepted formats: mp3, wav, ogg, webm, m4a, mp4, flac, aac. The Hub determines the format from input_audio.format, otherwise from the file name extension, otherwise from the part’s Content-Type, otherwise from the file content. When none of these gives a format, the request is refused with 400 unsupported_audio_format. Supported formats and languages can vary by model. 25 MB is about 36 minutes of voice at 96 kbps. A very long recording can still exceed the model’s processing time and fail with provider_error: split it into shorter files. Authentication, the Hub pause, and audio capacity are checked before the file is read: a refused request does not wait for the upload to finish.

Response

With response_format: json:
With response_format: verbose_json and timestamp_granularities[] set to segment and word:
The model’s response is forwarded as is, with these changes: usage.cost is the billed amount in EUR, and provider details are removed. text, segments, words, language, and duration are never modified. Timestamps are in seconds. verbose_json, word timestamps, diarize, and keyterms depend on the model: a model that does not support them returns provider_error. A 200 response also includes:
The response body has no id: the generation identifier is in X-Fanify-Generation-Id. X-Fanify-Billed-Cost is the billed amount in EUR, always written with a dot as decimal separator. Each transcription is recorded as a generation with is_llm: true: it appears in GET /api/v1/hub/generations (excluded by media_only=true) and triggers the generation.running and generation.completed webhooks, whose data contains the response. The audio is never stored: it is deleted as soon as the call ends. The transcribed text is kept for the retention period, to serve replays.

Idempotency

Use one new Idempotency-Key per audio file, and keep it when you retry after a network failure. Keys share one space across all Hub routes: a key already used by another request replays that request’s result.
  • A replay with the same key, the same audio, and the same fields returns the same body and headers, without a new model call or charge. This also holds when you switch between multipart and JSON, and whatever the order of the parts. A failed request replays the same error.
  • A replay while the request is still running returns 503 generation_in_progress with Retry-After: 5.
  • The same key with another audio file or another field value (for example language) returns 422 idempotency_conflict.
  • After the retention period of the stored response (24 hours by default), a replay returns 410 file_expired.

Errors

Errors use the OpenAI-compatible envelope:
error.metadata.provider_name is present only on a provider_error, when the routed model failed. Errors raised by the Hub itself (validation, credits, rate limit, capacity, pause) have no metadata, except the replay of a failed generation, which returns its original envelope with metadata.provider_name. An authentication failure returns 401 unauthorized as Problem Details, before the audio is read. Transcriptions have their own request rate limit per key, separate from the other Hub routes. A failed request is never billed. See Errors for the meaning of each code.

Pricing

A transcription is billed per second of audio, at the price_per_audio_second rate shown for your account in GET /api/v1/hub/models. Transcription models have no per-token rate. usage.seconds is the audio duration counted by the model. The billed amount is rounded up to six decimal places: a call with a non-zero cost is billed at least €0.000001, never €0.