You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dynamic routing is in closed beta. Request for access
15
+
:::
16
+
13
17
## Introduction
14
18
15
19
Dynamic routing enables you to create request routing flows through a **visual interface** or a **JSON-based configuration**. Instead of hard-coding a single model, with Dynamic Routing you compose a small flow that evaluates conditions, enforces quotas, and chooses models with fallbacks. You can iterate without touching application code—publish a new route version and you’re done. With dynamic routing, you can easily implement advanced use cases such as
When you enable authentication on gateway each request is required to include a valid cloudflare token, adding an extra layer of security. We recommend using an authenticated gateway when storing logs to prevent unauthorized access and protect against invalid requests that can inflate log storage usage and make it harder to find the data you need. [Learn more](/ai-gateway/configuration/authentication/).
27
26
28
-
## Create gateway
27
+
## Provider Authentication
29
28
30
-
Then, create a new AI Gateway.
29
+
Authenticate with your upstream provider using one of the following options:
31
30
32
-
<Renderfile="create-gateway" />
31
+
-**BYOK (Store Keys):** Store your credentials in Cloudflare and AI Gateway will include them at runtime. See [BYOK](/ai-gateway/configuration/bring-your-own-keys/).
32
+
-**Request headers:** Include your provider key in the request headers as you normally would (e.g., `Authorization: Bearer <PROVIDER_API_KEY>`).
33
+
34
+
## Integration Options
33
35
34
-
##Choosing gateway authentication
36
+
### Unified API (OpenAI-Compatible) Endpoint
35
37
36
-
When setting up a new gateway, you can choose between an authenticated and unauthenticated gateway. Enabling an authenticated gateway requires each request to include a valid authorization token, adding an extra layer of security. We recommend using an authenticated gateway when storing logs to prevent unauthorized access and protect against invalid requests that can inflate log storage usage and make it harder to find the data you need. Learn more about setting up an [Authenticated Gateway](/ai-gateway/configuration/authentication/).
The easiest way to get started with AI Gateway is through our OpenAI-compatible `/chat/completions` endpoint. This allows you to use existing OpenAI SDKs and tools with minimal code changes while gaining access to multiple AI providers.
There are multiple other ways to send a request to AI Gateway check out the [usage](/ai-gateway/usage/) section for more details.
73
+
[Learn more about OpenAI compatibility →](/ai-gateway/usage/chat-completion/)
82
74
83
-
## View analytics
75
+
### Provider-Specific Endpoints
84
76
85
-
Now that you have sent your first request to AI Gateway, you can view analytics for requests going through your gateway.
77
+
For direct integration with specific AI providers, use dedicated endpoints that maintain the original provider's API schema while adding AI Gateway features.
The cost metric is an estimation based on the number of tokens sent and received in requests. While this metric can help you monitor and predict cost trends, refer to your provider's dashboard for the most accurate cost details.
83
+
**Available providers:**
94
84
95
-
:::
85
+
-[OpenAI](/ai-gateway/usage/providers/openai/) - GPT models and embeddings
86
+
-[Anthropic](/ai-gateway/usage/providers/anthropic/) - Claude models
87
+
-[Google AI Studio](/ai-gateway/usage/providers/google-ai-studio/) - Gemini models
Copy file name to clipboardExpand all lines: src/content/docs/ai-gateway/usage/index.mdx
+3-96Lines changed: 3 additions & 96 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,101 +3,8 @@ title: Using AI Gateway
3
3
pcx_content_type: get-started
4
4
sidebar:
5
5
order: 3
6
+
group:
7
+
hideIndex: true
6
8
---
7
9
8
-
import { Render, Badge } from"~/components";
9
-
10
-
AI Gateway provides multiple ways to integrate with AI providers, offering flexibility and advanced features like caching, analytics, rate limiting, and fallbacks. Choose the integration method that best fits your needs.
The easiest way to get started with AI Gateway is through our OpenAI-compatible `/chat/completions` endpoint. This allows you to use existing OpenAI SDKs and tools with minimal code changes while gaining access to multiple AI providers.
[Learn more about OpenAI compatibility →](/ai-gateway/usage/chat-completion/)
31
-
32
-
### Provider-Specific Endpoints
33
-
34
-
For direct integration with specific AI providers, use dedicated endpoints that maintain the original provider's API schema while adding AI Gateway features.
-[AWS Bedrock](/ai-gateway/usage/providers/bedrock/) - Amazon's managed AI service
47
-
-[Azure OpenAI](/ai-gateway/usage/providers/azureopenai/) - Microsoft's OpenAI service
48
-
-[and more...](/ai-gateway/usage/providers/)
49
-
50
-
### WebSockets API <Badgetext="beta"variant="tip"size="small" />
51
-
52
-
For real-time applications requiring persistent connections, AI Gateway offers WebSockets support. This enables streaming responses and continuous communication with AI providers.
1.**[Set up your first gateway](/ai-gateway/get-started/)** if you haven't already
99
-
2.**Choose your integration method** based on your requirements
100
-
3.**Configure advanced features** like [caching](/ai-gateway/features/caching/), [rate limiting](/ai-gateway/features/rate-limiting/), and [analytics](/ai-gateway/observability/)
101
-
4.**Explore provider-specific documentation** for detailed implementation guides
102
-
103
-
For more advanced configuration options, see the [Configuration](/ai-gateway/configuration/) section.
0 commit comments