Skip to content

Commit 3d531c2

Browse files
thebongyTarushpalashgoOxyjun
authored
[AI Gateway] Restructure AI Gateway Docs + Add new features (#24499)
* feat: dynamic routing + byok drafts * [AI Gateway] Restructure sidebar and add new features * fix a few broken links and content * reorder the sidebar * feat: improve byok, dynamic routing docs * fix: build, remove unused files * fix: broken links * feat: improve aig getting started, fix redirects * Update src/content/docs/ai-gateway/features/dynamic-routing/index.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/features/dynamic-routing/index.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/features/dynamic-routing/usage.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/features/dynamic-routing/json-configuration.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/features/dynamic-routing/index.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/features/dynamic-routing/index.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/features/dynamic-routing/index.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/features/dynamic-routing/index.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/features/dynamic-routing/json-configuration.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/features/dynamic-routing/json-configuration.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/configuration/bring-your-own-keys.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/configuration/bring-your-own-keys.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/configuration/bring-your-own-keys.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/configuration/bring-your-own-keys.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/configuration/bring-your-own-keys.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/get-started.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/get-started.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/get-started.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/get-started.mdx Co-authored-by: Jun Lee <[email protected]> * Update src/content/docs/ai-gateway/get-started.mdx Co-authored-by: Jun Lee <[email protected]> --------- Co-authored-by: Tarush <[email protected]> Co-authored-by: Palash Golecha <[email protected]> Co-authored-by: Palash <[email protected]> Co-authored-by: Jun Lee <[email protected]>
1 parent d171ace commit 3d531c2

File tree

76 files changed

+908
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+908
-268
lines changed

public/__redirects

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,14 @@
163163
/ai-gateway/integration/vercel-ai-sdk/ /ai-gateway/integrations/vercel-ai-sdk/ 301
164164
/ai-gateway/integration/aig-workers-ai-binding/ /ai-gateway/integrations/aig-workers-ai-binding/ 301
165165
/ai-gateway/integration/ /ai-gateway/integrations/ 301
166-
/ai-gateway/providers/open-router/ /ai-gateway/providers/openrouter/ 301
167-
/ai-gateway/providers/universal/ /ai-gateway/universal/ 301
168-
/ai-gateway/configuration/websockets-api/ /ai-gateway/websockets-api/ 301
169-
/ai-gateway/configuration/websockets-api/non-realtime-api/ /ai-gateway/websockets-api/non-realtime-api/ 301
170-
/ai-gateway/configuration/websockets-api/realtime-api/ /ai-gateway/websockets-api/realtime-api/ 301
166+
/ai-gateway/providers/open-router/ /ai-gateway/usage/providers/openrouter/ 301
167+
/ai-gateway/providers/universal/ /ai-gateway/usage/universal/ 301
168+
/ai-gateway/configuration/websockets-api/ /ai-gateway/usage/websockets-api/ 301
169+
/ai-gateway/configuration/websockets-api/non-realtime-api/ /ai-gateway/usage/websockets-api/non-realtime-api/ 301
170+
/ai-gateway/configuration/websockets-api/realtime-api/ /ai-gateway/usage/websockets-api/realtime-api/ 301
171+
/ai-gateway/configuration/caching/ /ai-gateway/features/caching/ 301
172+
/ai-gateway/configuration/rate-limiting/ /ai-gateway/features/rate-limiting/ 301
173+
/ai-gateway/configuration/custom-metadata/ /ai-gateway/observability/custom-metadata/ 301
171174

172175
# agents
173176
/agents/capabilities/mcp-server/ /agents/model-context-protocol/ 301
@@ -2347,6 +2350,11 @@
23472350
# Calls
23482351
/calls/* /realtime/:splat 301
23492352

2353+
# AI Gateway
2354+
/ai-gateway/providers/* /ai-gateway/usage/providers/:splat 301
2355+
/ai-gateway/guardrails/* /ai-gateway/features/guardrails/:splat 301
2356+
/ai-gateway/websockets-api/* /ai-gateway/usage/websockets-api/:splat 301
2357+
23502358
# Realtime
23512359
/realtime/limits /realtime/sfu/limits 302
23522360
/realtime/sessions-tracks /realtime/sfu/sessions-tracks/ 302
@@ -2362,4 +2370,4 @@
23622370

23632371
/realtime/realtimekit/get-started /realtime/realtimekit/getting-started/ 302
23642372
/realtime/introduction /realtime/realtimekit/introduction 302
2365-
/realtime/concepts /realtime/realtimekit/concepts 302
2373+
/realtime/concepts /realtime/realtimekit/concepts 302
221 KB
Loading

src/content/changelog/ai-gateway/2025-01-07-aig-provider-deepseek.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ products:
66
date: 2025-01-02
77
---
88

9-
[**AI Gateway**](/ai-gateway/) now supports [**DeepSeek**](/ai-gateway/providers/deepseek/), including their cutting-edge DeepSeek-V3 model. With this addition, you have even more flexibility to manage and optimize your AI workloads using AI Gateway. Whether you're leveraging DeepSeek or other providers, like OpenAI, Anthropic, or [Workers AI](/workers-ai/), AI Gateway empowers you to:
9+
[**AI Gateway**](/ai-gateway/) now supports [**DeepSeek**](/ai-gateway/usage/providers/deepseek/), including their cutting-edge DeepSeek-V3 model. With this addition, you have even more flexibility to manage and optimize your AI workloads using AI Gateway. Whether you're leveraging DeepSeek or other providers, like OpenAI, Anthropic, or [Workers AI](/workers-ai/), AI Gateway empowers you to:
1010

1111
- **Monitor**: Gain actionable insights with analytics and logs.
1212
- **Control**: Implement caching, rate limiting, and fallbacks.
@@ -31,4 +31,4 @@ curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/deepseek/cha
3131
}'
3232
```
3333

34-
For detailed setup instructions, see our [DeepSeek provider documentation](/ai-gateway/providers/deepseek/).
34+
For detailed setup instructions, see our [DeepSeek provider documentation](/ai-gateway/usage/providers/deepseek/).

src/content/changelog/ai-gateway/2025-01-26-worker-binding-methods.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ With the new AI Gateway binding methods, you can now:
1616

1717
- Send feedback and update metadata with `patchLog`.
1818
- Retrieve detailed log information using `getLog`.
19-
- Execute [universal requests](/ai-gateway/universal/) to any AI Gateway provider with `run`.
19+
- Execute [universal requests](/ai-gateway/usage/universal/) to any AI Gateway provider with `run`.
2020

2121
For example, to send feedback and update metadata using `patchLog`:
2222

src/content/changelog/ai-gateway/2025-02-04-aig-provider-cartesia-eleven-cerebras.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ products:
66
date: 2025-02-05
77
---
88

9-
[AI Gateway](/ai-gateway/) has added three new providers: [Cartesia](/ai-gateway/providers/cartesia/), [Cerebras](/ai-gateway/providers/cerebras/), and [ElevenLabs](/ai-gateway/providers/elevenlabs/), giving you more even more options for providers you can use through AI Gateway. Here's a brief overview of each:
9+
[AI Gateway](/ai-gateway/) has added three new providers: [Cartesia](/ai-gateway/usage/providers/cartesia/), [Cerebras](/ai-gateway/usage/providers/cerebras/), and [ElevenLabs](/ai-gateway/usage/providers/elevenlabs/), giving you more even more options for providers you can use through AI Gateway. Here's a brief overview of each:
1010

11-
- [Cartesia](/ai-gateway/providers/cartesia/) provides text-to-speech models that produce natural-sounding speech with low latency.
12-
- [Cerebras](/ai-gateway/providers/cerebras/) delivers low-latency AI inference to Meta's Llama 3.1 8B and Llama 3.3 70B models.
13-
- [ElevenLabs](/ai-gateway/providers/elevenlabs/) offers text-to-speech models with human-like voices in 32 languages.
11+
- [Cartesia](/ai-gateway/usage/providers/cartesia/) provides text-to-speech models that produce natural-sounding speech with low latency.
12+
- [Cerebras](/ai-gateway/usage/providers/cerebras/) delivers low-latency AI inference to Meta's Llama 3.1 8B and Llama 3.3 70B models.
13+
- [ElevenLabs](/ai-gateway/usage/providers/elevenlabs/) offers text-to-speech models with human-like voices in 32 languages.
1414

1515
![Example of Cerebras log in AI Gateway](~/assets/images/ai-gateway/cerebras2.png)
1616

17-
To get started with AI Gateway, just update the base URL. Here's how you can send a request to [Cerebras](/ai-gateway/providers/cerebras/) using cURL:
17+
To get started with AI Gateway, just update the base URL. Here's how you can send a request to [Cerebras](/ai-gateway/usage/providers/cerebras/) using cURL:
1818

1919
```bash title="Example fetch request"
2020
curl -X POST https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/cerebras/chat/completions \

src/content/changelog/ai-gateway/2025-02-05-aig-request-handling.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ date: 2025-02-06
88

99
AI Gateway adds additional ways to handle requests - [Request Timeouts](/ai-gateway/configuration/request-handling/#request-timeouts) and [Request Retries](/ai-gateway/configuration/request-handling/#request-retries), making it easier to keep your applications responsive and reliable.
1010

11-
Timeouts and retries can be used on both the [Universal Endpoint](/ai-gateway/universal/) or directly to a [supported provider](/ai-gateway/providers/).
11+
Timeouts and retries can be used on both the [Universal Endpoint](/ai-gateway/usage/universal/) or directly to a [supported provider](/ai-gateway/usage/providers/).
1212

1313
**Request timeouts**
1414
A [request timeout](/ai-gateway/configuration/request-handling/#request-timeouts) allows you to trigger [fallbacks](/ai-gateway/configuration/fallbacks/) or a retry if a provider takes too long to respond.

src/content/changelog/ai-gateway/2025-02-26-guardrails.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ date: 2025-02-26
55
preview_image: ~/assets/images/changelog/ai-gateway/guardrails-social-preview.png
66
---
77

8-
[AI Gateway](/ai-gateway/) now includes [Guardrails](/ai-gateway/guardrails/), to help you monitor your AI apps for harmful or inappropriate content and deploy safely.
8+
[AI Gateway](/ai-gateway/) now includes [Guardrails](/ai-gateway/features/guardrails/), to help you monitor your AI apps for harmful or inappropriate content and deploy safely.
99

1010
Within the AI Gateway settings, you can configure:
1111

@@ -15,4 +15,4 @@ Within the AI Gateway settings, you can configure:
1515

1616
![Guardrails in AI Gateway](~/assets/images/ai-gateway/Guardrails.png)
1717

18-
Learn more in the [blog](https://blog.cloudflare.com/guardrails-in-ai-gateway/) or our [documentation](/ai-gateway/guardrails/).
18+
Learn more in the [blog](https://blog.cloudflare.com/guardrails-in-ai-gateway/) or our [documentation](/ai-gateway/features/guardrails/).

src/content/changelog/ai-gateway/2025-03-20-websockets.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: AI Gateway now supports end-to-end, client-to-provider WebSockets
44
date: 2025-03-21
55
---
66

7-
We are excited to announce that [AI Gateway](/ai-gateway/) now supports real-time AI interactions with the new [Realtime WebSockets API](/ai-gateway/websockets-api/realtime-api/).
7+
We are excited to announce that [AI Gateway](/ai-gateway/) now supports real-time AI interactions with the new [Realtime WebSockets API](/ai-gateway/usage/websockets-api/realtime-api/).
88

99
This new capability allows developers to establish persistent, low-latency connections between their applications and AI models, enabling natural, real-time conversational AI experiences, including speech-to-speech interactions.
1010

@@ -36,4 +36,4 @@ ws.send(
3636
);
3737
```
3838

39-
Get started by checking out the [Realtime WebSockets API](/ai-gateway/websockets-api/realtime-api/) documentation.
39+
Get started by checking out the [Realtime WebSockets API](/ai-gateway/usage/websockets-api/realtime-api/) documentation.

src/content/changelog/ai-gateway/2025-06-03-aig-openai-compatible-endpoint.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ products:
66
date: 2025-06-03
77
---
88

9-
Users can now use an [OpenAI Compatible endpoint](/ai-gateway/chat-completion/) in AI Gateway to easily switch between providers, while keeping the exact same request and response formats. We're launching now with the chat completions endpoint, with the embeddings endpoint coming up next.
9+
Users can now use an [OpenAI Compatible endpoint](/ai-gateway/usage/chat-completion/) in AI Gateway to easily switch between providers, while keeping the exact same request and response formats. We're launching now with the chat completions endpoint, with the embeddings endpoint coming up next.
1010

1111
To get started, use the OpenAI compatible chat completions endpoint URL with your own account id and gateway id and switch between providers by changing the `model` and `apiKey` parameters.
1212

@@ -26,6 +26,6 @@ const response = await client.chat.completions.create({
2626
console.log(response.choices[0].message.content);
2727
```
2828

29-
Additionally, the [OpenAI Compatible endpoint](/ai-gateway/chat-completion/) can be combined with our [Universal Endpoint](/ai-gateway/universal/) to add fallbacks across multiple providers. That means AI Gateway will return every response in the same standardized format, no extra parsing logic required!
29+
Additionally, the [OpenAI Compatible endpoint](/ai-gateway/usage/chat-completion/) can be combined with our [Universal Endpoint](/ai-gateway/usage/universal/) to add fallbacks across multiple providers. That means AI Gateway will return every response in the same standardized format, no extra parsing logic required!
3030

31-
Learn more in the [OpenAI Compatibility](/ai-gateway/chat-completion/) documentation.
31+
Learn more in the [OpenAI Compatibility](/ai-gateway/usage/chat-completion/) documentation.

src/content/changelog/workers-ai/2025-02-25-json-mode.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default {
3737
const client = new OpenAI({
3838
apiKey: env.OPENAI_API_KEY,
3939
// Optional: use AI Gateway to bring logs, evals & caching to your AI requests
40-
// https://developers.cloudflare.com/ai-gateway/providers/openai/
40+
// https://developers.cloudflare.com/ai-gateway/usage/providers/openai/
4141
// baseUrl: "https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/openai"
4242
});
4343

0 commit comments

Comments
 (0)