Skip to content

Commit 38b31ee

Browse files
committed
fix: update ai gateway model ids
1 parent 7495bef commit 38b31ee

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

src/content/docs/ai-gateway/configuration/authentication.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/openai/chat/
2929
--header 'cf-aig-authorization: Bearer {CF_AIG_TOKEN}' \
3030
--header 'Authorization: Bearer OPENAI_TOKEN' \
3131
--header 'Content-Type: application/json' \
32-
--data '{"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "What is Cloudflare?"}]}'
32+
--data '{"model": "gpt-5-mini", "messages": [{"role": "user", "content": "What is Cloudflare?"}]}'
3333
```
3434

3535
Using the OpenAI SDK:

src/content/docs/ai-gateway/features/dynamic-routing/usage.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/comp
4949
--header 'cf-aig-authorization: Bearer {CF_AIG_TOKEN}' \
5050
--header 'Content-Type: application/json' \
5151
--data '{
52-
"model": "dynamic/gemini-2.0-flash",
52+
"model": "dynamic/<your-dynamic-route-name>",
5353
"messages": [
5454
{
5555
"role": "user",
@@ -68,12 +68,12 @@ export interface Env {
6868

6969
export default {
7070
async fetch(request: Request, env: Env) {
71-
const response = await env.AI.gateway("dfD").run({
71+
const response = await env.AI.gateway("default").run({
7272
provider: "compat",
7373
endpoint: "chat/completion",
7474
headers: {},
7575
query: {
76-
model: "dynamic/support",
76+
model: "dynamic/<your-dynamic-route-name>",
7777
messages: [
7878
{
7979
role: "user",

src/content/docs/ai-gateway/get-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const client = new OpenAI({
6666

6767
// Use different providers by changing the model parameter
6868
const response = await client.chat.completions.create({
69-
model: "google-ai-studio/gemini-2.0-flash", // or "openai/gpt-4o", "anthropic/claude-3-haiku"
69+
model: "google-ai-studio/gemini-2.5-flash", // or "openai/gpt-5-mini", "anthropic/claude-sonnet-4-5"
7070
messages: [{ role: "user", content: "Hello, world!" }],
7171
});
7272
```

src/content/docs/ai-gateway/usage/chat-completion.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Switch providers by changing the `model` and `apiKey` parameters.
2323

2424
Specify the model using `{provider}/{model}` format. For example:
2525

26-
- `openai/gpt-4o-mini`
27-
- `google-ai-studio/gemini-2.0-flash`
28-
- `anthropic/claude-3-haiku`
26+
- `openai/gpt-5-mini`
27+
- `google-ai-studio/gemini-2.5-flash`
28+
- `anthropic/claude-sonnet-4-5`
2929

3030
## Examples
3131

@@ -41,7 +41,7 @@ const client = new OpenAI({
4141
});
4242

4343
const response = await client.chat.completions.create({
44-
model: "google-ai-studio/gemini-2.0-flash",
44+
model: "google-ai-studio/gemini-2.5-flash",
4545
messages: [{ role: "user", content: "What is Cloudflare?" }],
4646
});
4747

@@ -55,7 +55,7 @@ curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/comp
5555
--header 'Authorization: Bearer {GOOGLE_GENERATIVE_AI_API_KEY}' \
5656
--header 'Content-Type: application/json' \
5757
--data '{
58-
"model": "google-ai-studio/gemini-2.0-flash",
58+
"model": "google-ai-studio/gemini-2.5-flash",
5959
"messages": [
6060
{
6161
"role": "user",

src/content/docs/ai-gateway/usage/providers/anthropic.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/anthropic/v1
3232
--header 'anthropic-version: 2023-06-01' \
3333
--header 'Content-Type: application/json' \
3434
--data '{
35-
"model": "claude-3-opus-20240229",
35+
"model": "claude-sonnet-4-5",
3636
"max_tokens": 1024,
3737
"messages": [
3838
{"role": "user", "content": "What is Cloudflare?"}
@@ -57,7 +57,7 @@ const anthropic = new Anthropic({
5757
baseURL,
5858
});
5959

60-
const model = "claude-3-opus-20240229";
60+
const model = "claude-sonnet-4-5";
6161
const messages = [{ role: "user", content: "What is Cloudflare?" }];
6262
const maxTokens = 1024;
6363

src/content/docs/ai-gateway/usage/providers/google-ai-studio.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ So your final URL will come together as: `https://gateway.ai.cloudflare.com/v1/{
3535
### cURL
3636

3737
```bash title="Example fetch request"
38-
curl "https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_name}/google-ai-studio/v1/models/gemini-1.0-pro:generateContent" \
38+
curl "https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_name}/google-ai-studio/v1/models/gemini-2.5-flash:generateContent" \
3939
--header 'content-type: application/json' \
4040
--header 'x-goog-api-key: {google_studio_api_key}' \
4141
--data '{
@@ -63,7 +63,7 @@ const gateway_name = "";
6363

6464
const genAI = new GoogleGenerativeAI(api_token);
6565
const model = genAI.getGenerativeModel(
66-
{ model: "gemini-1.5-flash" },
66+
{ model: "gemini-2.5-flash" },
6767
{
6868
baseUrl: `https://gateway.ai.cloudflare.com/v1/${account_id}/${gateway_name}/google-ai-studio`,
6969
},

src/content/docs/ai-gateway/usage/providers/openai.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const openai = new OpenAI({
7171
});
7272

7373
try {
74-
const model = "gpt-3.5-turbo-0613";
74+
const model = "gpt-5-mini";
7575
const messages = [{ role: "user", content: "What is a neuron?" }];
7676
const maxTokens = 100;
7777
const chatCompletion = await openai.chat.completions.create({

src/content/docs/ai-gateway/usage/providers/openrouter.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/open
3333
--header 'content-type: application/json' \
3434
--header 'Authorization: Bearer OPENROUTER_TOKEN' \
3535
--data '{
36-
"model": "openai/gpt-3.5-turbo",
36+
"model": "openai/gpt-5-mini",
3737
"messages": [
3838
{
3939
"role": "user",
@@ -59,7 +59,7 @@ const openai = new OpenAI({
5959

6060
try {
6161
const chatCompletion = await openai.chat.completions.create({
62-
model: "openai/gpt-3.5-turbo",
62+
model: "openai/gpt-5-mini",
6363
messages: [{ role: "user", content: "What is Cloudflare?" }],
6464
});
6565

src/content/docs/ai-gateway/usage/providers/vertex.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Your new base URL will use the data above in this structure: `https://gateway.ai
3838

3939
Then you can append the endpoint you want to hit, for example: `/publishers/google/models/{model}:{generative_ai_rest_resource}`
4040

41-
So your final URL will come together as: `https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/google-vertex-ai/v1/projects/{project_name}/locations/{region}/publishers/google/models/gemini-1.0-pro-001:generateContent`
41+
So your final URL will come together as: `https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/google-vertex-ai/v1/projects/{project_name}/locations/{region}/publishers/google/models/gemini-2.5-flash:generateContent`
4242

4343
## Authenticating with Vertex AI
4444

@@ -85,7 +85,7 @@ This option is only supported for the provider-specific endpoint, not for the un
8585
:::
8686

8787
```bash
88-
curl "https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/google-vertex-ai/v1/projects/{project_name}/locations/{region}/publishers/google/models/gemini-1.0-pro-001:generateContent" \
88+
curl "https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/google-vertex-ai/v1/projects/{project_name}/locations/{region}/publishers/google/models/gemini-2.5-flash:generateContent" \
8989
-H "Authorization: Bearer ya29.c.b0Aaekm1K..." \
9090
-H 'Content-Type: application/json' \
9191
-d '{
@@ -161,7 +161,7 @@ You can also use the provider-specific endpoint to access the full Vertex AI API
161161
### cURL
162162

163163
```bash title="Example fetch request"
164-
curl "https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/google-vertex-ai/v1/projects/{project_name}/locations/{region}/publishers/google/models/gemini-1.0-pro-001:generateContent" \
164+
curl "https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/google-vertex-ai/v1/projects/{project_name}/locations/{region}/publishers/google/models/gemini-2.5-flash:generateContent" \
165165
-H "Authorization: Bearer {vertex_api_key}" \
166166
-H 'Content-Type: application/json' \
167167
-d '{

src/content/docs/ai-gateway/usage/websockets-api/realtime-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ws.on("message", (message) => console.log(message.data));
6868
ws.send(
6969
JSON.stringify({
7070
setup: {
71-
model: "models/gemini-2.0-flash-exp",
71+
model: "models/gemini-2.5-flash",
7272
generationConfig: { responseModalities: ["TEXT"] },
7373
},
7474
}),

0 commit comments

Comments
 (0)