Overview
GoModel exposes the OpenAI-compatible audio endpoints for text-to-speech (TTS) and speech-to-text (STT). Clients and SDKs that already call OpenAI’s/v1/audio/* routes can point at GoModel unchanged.
Requests route by model through the same registry used for chat and
embeddings, so model selection, provider hints, virtual models, per-key model
access rules (user paths), and budgets all apply. Audio is
served by OpenAI and the OpenAI-compatible providers (OpenRouter, Azure OpenAI,
vLLM, Oracle, Z.ai), plus providers whose native audio APIs GoModel translates
behind the same endpoints: Xiaomi MiMo (TTS and ASR via chat
completions), Cohere (transcription), and
MiniMax (TTS via its native t2a_v2 API). A provider that
doesn’t support audio returns a clear error rather than mis-routing.
Supported endpoints
JSON transcription and translation bodies are normalized to the OpenAI shape:
Groq’s vendor
x_groq member is removed from json and verbose_json
responses, so a client written against OpenAI sees the same fields everywhere.
Text-to-speech
model and input are required. voice is optional: when it is omitted,
OpenAI and Azure OpenAI use alloy, and other providers use their own default
speaker. ElevenLabs and MiniMax have no default and need a voice ID. Voice
names are provider-specific, so OpenAI’s alloy/nova/… only work on OpenAI
and Azure. Optional fields — instructions, response_format (mp3 default,
plus opus, aac, flac, wav, pcm), and speed — are forwarded to the
provider. The response Content-Type is the one
the upstream returns, falling back to the type implied by response_format (for
example wav → audio/wav).
voice may also be an object with an id, the form OpenAI uses for
custom voices:
"voice": {"id": "voice_1234"}. OpenAI-compatible providers receive the object
unchanged; ElevenLabs, MiniMax, Xiaomi and audio.cpp use its id as the voice.
An object without a non-blank string id returns 400. A compatible provider
that does not support custom voices may reject the object.
OpenAI accepts a custom voice only in the object form. For OpenAI
(api.openai.com and its regional hosts) GoModel therefore sends a string
that starts with voice_ as {"id": "voice_…"}, so an id from
voice discovery also works as a
plain string.
Synthesized audio is relayed as the provider produces it — see
Streaming.
Speech-to-text
file and model are required. Optional form fields — language, prompt,
response_format, temperature, and timestamp_granularities[] — are forwarded.
response_format controls the response shape: json and verbose_json return a
JSON object; text, srt, and vtt return a text/plain body.
Add stream=true to receive the transcript as it is produced — see
Streaming.
Self-hosted speech-to-text servers
Many self-hosted STT servers serve/v1/audio/transcriptions but no /v1/models.
Register one as an openai provider and list the model it serves:
/models answers 404 or 405, GoModel serves the configured models and
reports the provider as healthy. Other /models failures still mark it as
degraded.
Streaming
GoModel forwards an audio body to the client as the provider produces it, so time-to-first-byte tracks the provider instead of the whole generation:Incremental transcript
transcript.text.done event reports, and
streamed speech from the duration of the audio that passed through. Both are
measured as the response streams rather than from a buffered copy of it, so a
response of any length is billed in full.
A streamed response cannot be retried once its first bytes have reached the
client, so — as with streamed chat completions — GoModel does not retry a
failed upstream attempt on
/v1/audio/speech or on a stream: true
transcription. A plain transcription request keeps the usual retries.Streaming applies to the OpenAI-compatible upstreams. Providers whose native
audio API GoModel translates (Xiaomi MiMo, Cohere, MiniMax, ElevenLabs) return
a complete body, which GoModel forwards as one response.
Parameter forwarding
Any parameter GoModel does not name above is forwarded to the provider unchanged, so newer OpenAI options and provider-native extras work without waiting for a gateway release (ADR-0011 rule 1):/v1/audio/speech— unknown JSON members (for examplestream_format) are merged back into the upstream body./v1/audio/transcriptionsand/v1/audio/translations— unknown form values (for exampleinclude[]=logprobs,chunking_strategy,stream) are written into the upstream multipart body, repeated values included.
model, file,
and the routing hint provider, plus the transcription options it re-emits —
language, prompt, response_format, temperature, and both
timestamp_granularities[] and its unbracketed alias
timestamp_granularities), and extra file parts on a transcription
upload; only the audio in file is sent.
Forwarded values are not stored in the request log:
because they are arbitrary client input that may carry provider credentials,
the entry records only the field names under forwarded_fields.
Forwarding applies to the OpenAI-compatible upstreams. Providers whose native
audio API GoModel translates (Xiaomi MiMo, Cohere, MiniMax, ElevenLabs) build
their own request shape and ignore extra parameters.
Cost tracking
Every/v1/audio/* call is recorded in usage tracking
under its own endpoint path. Audio models are priced by the unit the provider
bills, not by tokens:
- Speech (
/v1/audio/speech) records the input character count (input_characters, priced withper_character_input, astts-1is billed) and the duration of the synthesized audio (audio_output_seconds, priced withper_second_output, asgpt-4o-mini-ttsis billed). Duration is measured from the returnedwav,pcm, ormp3; other codecs (opus,aac,flac) cannot be measured without decoding, and the row carries a cost caveat saying so. - Transcriptions and translations are priced by the duration of the uploaded
audio (
audio_seconds, priced withper_second_input). GoModel takes the duration the provider reports inusage.secondsorverbose_json’sduration, and otherwise measures the upload itself — so the cost does not depend on theresponse_formatthe client asked for, and providers that report no usage at all (Groq, ElevenLabs) are still metered. - Token-billed transcription models (
gpt-4o-transcribeand similar) report tokenusageand are priced withinput_per_mtok/output_per_mtokinstead. A model that publishes both a token rate and a per-second rate is billed by whichever unit the provider reported, never both.
m4a, ogg, flac, webm) —
the usage row is flagged with a cost-calculation caveat instead of a $0 cost.
Limitations
The audio endpoints are a thin, model-routed pass to the provider and do not run through the full inference orchestrator. Compared with/v1/chat/completions:
- No failover, guardrails, or response cache — these stages are skipped.
Requests are still authorized, budget-checked, metered (see
cost tracking), and written to the
request log under their
/v1/audio/*path. - OpenAI request shape in, provider dialect out — clients always send OpenAI’s audio format. OpenAI-compatible upstreams receive it unchanged; Xiaomi MiMo, Cohere, and MiniMax requests are translated to each provider’s native audio contract. Providers beyond those are not adapted behind this endpoint.
- No retries for a streamed response — see Streaming.
- Realtime voice-to-voice runs on the realtime websocket, not on these endpoints; see API endpoints.
/p/{provider}/v1/audio/...) to
forward bytes verbatim to that upstream.
Request logging
Audio requests appear in the request log like any other model interaction. Because audio payloads are binary and large, their bodies are gated by a dedicated setting,LOGGING_LOG_AUDIO_BODIES
(default false), which refines LOGGING_LOG_BODIES — it has no effect
unless body logging is enabled:
- Body logging off (
LOGGING_LOG_BODIES=false) — no audio body is stored, regardless of this setting. - Body logging on, audio off (the default) — the audio response is recorded
as a lightweight
{__audio__, content_type, bytes, stored: false}placeholder; no audio bytes are stored. - Body logging on, audio on —
/v1/audio/speechstores its text input and the generated audio so the dashboard renders an inline player, and/v1/audio/transcriptionsstores the uploaded audio (also playable in the dashboard) alongside the upload metadata (filename, model, params).
media_id and the dashboard
fetches the file through GET /admin/media/{id}. Nothing caps the size, and a
streamed response is stored as it is relayed. Files are kept as long as the
request log entries that reference them (LOGGING_RETENTION_DAYS).