跳转到内容
搜索文档

Deepgram

最后更新 查看 MarkdownAgent 设置

Deepgram 提供语音 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 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(...);

这篇文档对您有帮助吗?