Transcription
Turn speech into text with the OpenAI transcription API, billed per second of audio.
POST /v1/audio/transcriptions accepts the OpenAI transcription request and forwards it to the provider that serves the requested model. Tokamak changes the model field to the provider's own model id and relays the provider's answer.
Use your Tokamak inference key. Transcription models are priced per second (audio_input_second); openai/gpt-transcribe is the current one. Like every voice model it is left out of the default Models list (add X-PROVIDER-DATA: true to see it). openai/gpt-live-transcribe and openai/gpt-realtime-whisper transcribe only in a Realtime session (intent=transcription); this endpoint refuses them with 400 unsupported_value.
Transcribe a file
curl -sS https://api.tokamak.sh/v1/audio/transcriptions \
-H "Authorization: Bearer $TOKAMAK_API_KEY" \
-F "model=openai/gpt-transcribe" \
-F "[email protected]"{
"text": "Hello from the meeting.",
"languages": [{ "code": "en" }],
"usage": { "type": "duration", "seconds": 3 }
}With the OpenAI SDK, only the base URL and the key change:
from openai import OpenAI
client = OpenAI(base_url="https://api.tokamak.sh/v1", api_key=TOKAMAK_API_KEY)
with open("meeting.wav", "rb") as f:
t = client.audio.transcriptions.create(model="openai/gpt-transcribe", file=f)
print(t.text, t.usage.seconds)Formats and streaming
response_format:json(default) ortext. Fortext, Tokamak asks the provider for JSON, which carries the usage it bills from, and returns the transcript astext/plainthe way OpenAI does.srt,vtt,verbose_jsonanddiarized_jsonare refused with400 unsupported_value:gpt-transcribedoes not offer them, andsrt/vttcarry no usage.stream=truereturns OpenAI's server-sent events; the last event,transcript.text.done, carries the usage.
Billing and limits
- Billing is per second of audio, in whole seconds as the provider reports them (
usage.seconds, rounded up). - Before the request is sent, Tokamak reads the duration from the file's container (WAV, FLAC, MP3, MP4/M4A, Ogg Opus or Vorbis, or WebM, including browser MediaRecorder output) and holds credit for it plus a second. The hold is released at settlement; you are charged only for the reported seconds.
- A file whose duration cannot be read is refused with
422when your organization is charged for usage. - Files up to 25 MB, as at OpenAI.
- The recording goes to the provider as uploaded, so a key a guardrail policy applies to gets
403 guardrail_policy_unsupported, unless an organization admin turned on Allow unscreened voice for that policy. Apromptis screened like any text. /v1/audio/translationsis not served: OpenAI retireswhisper-1translations on 2027-02-26, and they report no usage. For text read aloud, see Speech.- Tokamak's own errors use the OpenAI error shape. Provider errors are returned as the provider sent them.
The settled generation id is returned in the X-Tokamak-Execution-Id response header.