Realtime voice, speech, and transcription now supported on AI Gateway
AI Gateway now supports voice and audio models for building realtime voice agents, generating speech from text, and transcribing audio. These capabilities provide the same observability, spend controls, and bring-your-own-key support as existing model types, with no markup or platform fees.
now supports voice and audio models. You can build realtime voice agents, generate speech from text, and transcribe audio to text. This provides the same observability, spend controls, and bring-your-own-key support as text, image, and video models in AI Gateway, with no markup or platform fees. These capabilities are in beta and available via 7.AI GatewayAI SDK
With realtime support, a single model takes audio in and audio out, so a user can talk and hear a reply back in near real time instead of waiting on a chain of separate models.
Two ways to get started:
A voice agent has two pieces: a server route that mints a short-lived token, so your API key never reaches the client, and a browser component that connects with it.
Add the token route:
Then connect from the browser. The hook fetches that route and manages the WebSocket connection, microphone capture, and audio playback:useRealtime
You can also try audio models without writing any code. Open the , click into a , and interact with it right in the browser:models pagemodel
For more information on , , and models on AI Gateway, see the documentation. To view a list of all the supported , , and models on AI Gateway, check the full list .realtime voicespeechtranscriptionrealtime voicespeechtranscriptionhere
Capability | What it does |
|---|---|
Realtime voice agents | Model listens to the user, works out a response, and speaks it back in a live, low-latency conversation. It can call your tools mid-conversation to look something up or take an action. The hook handles microphone capture and playback. |
Text to speech | Generate spoken audio from text, with a selectable voice and output format such as MP3. Use it for voiceovers, audio versions of written content, and spoken responses. |
Speech to text | Transcribe recordings into text, from a file buffer, base64 string, or URL. Use it for voice notes or other transcriptions. |
Follow the realtime example below or the to add a voice agent to your app.realtime quickstart
Use the . Talk to a realtime model in the browser, no code required, in the AI Gateway Playground.playground
Realtime example
Playground
Talk to a realtime model to hold a voice conversation
Send text and have a transcription model read it back
Speak to an audio model and have it transcribe your words
Source: original entry ↗