Deepgram ↗ は、音声認識、テキスト読み上げ、ボイスエージェント向けの Voice AI API を提供します。
https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepgramDeepgram へリクエストするときは、現在使っている URL の https://api.deepgram.com/ を https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepgram/ に置き換えます。
Deepgram へリクエストするときは、次を用意してください。
- AI Gateway の Account ID。
- AI Gateway のゲートウェイ名。
- 有効な Deepgram API トークン。
import { createClient, LiveTranscriptionEvents } from "@deepgram/sdk";
const deepgram = createClient("{deepgram_api_key}", {
global: {
websocket: {
options: {
url: "wss://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepgram/",
_nodeOnlyHeaders: {
"cf-aig-authorization": "Bearer {CF_AIG_TOKEN}"
}
}
}
}
});
const connection = deepgram.listen.live({
model: "nova-3",
language: "en-US",
smart_format: true,
});
connection.send(...);