AI Gateway でリアルタイム音声・通話・文字起こしがサポートされるように
本文の状態
日本語全文を表示中
詳細モードで約3分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Vercel Blog
Vercel は AI Gateway に音声およびオーディオモデルのサポートを追加し、リアルタイム音声エージェントの構築やテキストから音声への生成、音声の文字起こし機能をベータ版として提供開始した。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
AI Gateway は現在、音声およびオーディオモデルをサポートしています。リアルタイム音声エージェントの構築、テキストからの音声生成、オーディオからテキストへの書き起こしが可能になりました。これにより、AI Gateway 内のテキスト、画像、ビデオモデルと同様の可観測性、支出管理、BYOK(Bring Your Own Key)サポートが提供され、追加料金やプラットフォーム手数料は発生しません。これらの機能はベータ版であり、AI SDK 7 を経由して利用可能です。
リアルタイムサポートにより、単一のモデルが入力と出力の両方でオーディオを処理するため、ユーザーは別々のモデルの連鎖を待たずに、ほぼリアルタイムで対話を行い、応答を聞くことができます。
機能
その役割
リアルタイム音声エージェント
モデルがユーザーの発言を聞き取り、応答を算出して、ライブかつ低遅延の会話として発話します。会話中にツールを呼び出して情報を検索したり、アクションを実行したりすることも可能です。useRealtime フックはマイクからのキャプチャと再生を処理します。
テキストから音声へ
選択可能な音声と MP3 などの出力形式を選択して、テキストから音声オーディオを生成します。ナレーション、文章コンテンツの音声版、音声応答などに使用できます。
音声からテキストへ
ファイルバッファ、Base64 文字列、または URL から録音内容をテキストに書き起こします。ボイスメモやその他の書き起こし用途に使用できます。
開始方法はいくつかあります:
以下のリアルタイム例またはリアルタイムクイックスタートに従って、アプリに音声エージェントを追加してください。
プレイグラウンドを使用してください。AI Gateway Playground でブラウザ上でコード不要でリアルタイムモデルと対話できます。
リアルタイム例
音声エージェントには2つの構成要素があります。1つは、API キーがクライアントに到達しないように短期有効なトークンを発行するサーバールートであり、もう1つはそれと接続するブラウザコンポーネントです。
トークンルートを追加します:
次に、ブラウザから接続します。useRealtimeフックはこのルートをフェッチし、WebSocket 接続(WebSocket connection)、マイクキャプチャ、オーディオ再生を管理します:
プレイグラウンド
コードを書かずに音声モデルを試すこともできます。モデルページを開き、特定のモデルをクリックして、ブラウザ内で直接対話してください:
リアルタイムモデルに話しかけて音声会話を行う
テキストを送信し、トランスクリプションモデル(transcription model)がそれを読み上げる
オーディオモデルに話しかけ、その言葉の文字起こしを行わせる
AI Gateway 上のリアルタイム音声、音声認識、および文字起こしモデルに関する詳細については、ドキュメントをご覧ください。AI Gateway でサポートされているすべてのリアルタイム音声、音声認識、および文字起こしモデルの一覧を表示するには、こちらで完全リストを確認してください。
さらに読む
原文を表示
AI Gateway 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 AI SDK 7.
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.
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 useRealtime 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.
Two ways to get started:
Follow the realtime example below or the realtime quickstart to add a voice agent to your app.
Use the playground. Talk to a realtime model in the browser, no code required, in the AI Gateway Playground.
Realtime example
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 useRealtime hook fetches that route and manages the WebSocket connection, microphone capture, and audio playback:
Playground
You can also try audio models without writing any code. Open the models page, click into a model, and interact with it right in the browser:
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
For more information on realtime voice, speech, and transcription models on AI Gateway, see the documentation. To view a list of all the supported realtime voice, speech, and transcription models on AI Gateway, check the full list here.
Read more
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み