Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

Deepgram

最終更新 Markdown で表示Agent セットアップ

Deepgram は、音声認識、テキスト読み上げ、ボイスエージェント向けの Voice AI API を提供します。

エンドポイント

https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepgram

URL の構成

Deepgram へリクエストするときは、現在使っている 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 トークン。

SDK

TSts
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(...);

役に立ちましたか?