Skip to content

Commit b32b372

Browse files
authored
feat: ai gateway add deepgram provider (#26254)
1 parent 38e0d11 commit b32b372

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Deepgram
3+
pcx_content_type: get-started
4+
---
5+
6+
[Deepgram](https://developers.deepgram.com/home) provides Voice AI APIs for speech-to-text, text-to-speech, and voice agents.
7+
8+
:::note
9+
10+
Deepgram is also available through Workers AI, see [Deepgram Workers AI](/ai-gateway/usage/websockets-api/realtime-api/#deepgram-workers-ai).
11+
12+
:::
13+
14+
## Endpoint
15+
16+
```txt
17+
https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepgram
18+
```
19+
20+
## URL Structure
21+
22+
When making requests to Deepgram, replace `https://api.deepgram.com/` in the URL you are currently using with `https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepgram/`.
23+
24+
## Prerequisites
25+
26+
When making requests to Deepgram, ensure you have the following:
27+
28+
- Your AI Gateway Account ID.
29+
- Your AI Gateway gateway name.
30+
- An active Deepgram API token.
31+
32+
## Example
33+
34+
### SDK
35+
36+
```ts title="TS"
37+
import { createClient, LiveTranscriptionEvents } from "@deepgram/sdk";
38+
39+
40+
const deepgram = createClient("{deepgram_api_key}", {
41+
global: {
42+
websocket: {
43+
options: {
44+
url: "wss://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepgram/",
45+
_nodeOnlyHeaders: {
46+
"cf-aig-authorization": "Bearer {CF_AIG_TOKEN}"
47+
}
48+
}
49+
}
50+
}
51+
});
52+
53+
54+
const connection = deepgram.listen.live({
55+
model: "nova-3",
56+
language: "en-US",
57+
smart_format: true,
58+
});
59+
60+
connection.send(...);
61+
```

0 commit comments

Comments
 (0)