Skip to content

Commit 5bf49b6

Browse files
renamed open router (#18759)
1 parent 88be979 commit 5bf49b6

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

public/_redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
/ai-gateway/integration/vercel-ai-sdk/ /ai-gateway/integrations/vercel-ai-sdk/ 301
103103
/ai-gateway/integration/aig-workers-ai-binding/ /ai-gateway/integrations/aig-workers-ai-binding/ 301
104104
/ai-gateway/integration/ /ai-gateway/integrations/ 301
105+
/ai-gateway/providers/open-router/ /ai-gateway/providers/openrouter/ 301
105106

106107
# analytics
107108
/analytics/migration-guides/zone-analytics/ /analytics/graphql-api/migration-guides/zone-analytics/ 301

src/content/docs/ai-gateway/providers/open-router.mdx renamed to src/content/docs/ai-gateway/providers/openrouter.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@ curl -X POST https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/openrouter
4343
If you are using the OpenAI SDK with JavaScript, you can set your endpoint like this:
4444

4545
```js title="JavaScript"
46-
import OpenAI from 'openai';
46+
import OpenAI from "openai";
4747

4848
const openai = new OpenAI({
49-
apiKey: env.OPENROUTER_TOKEN,
50-
baseURL: "https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/openrouter"
49+
apiKey: env.OPENROUTER_TOKEN,
50+
baseURL:
51+
"https://gateway.ai.cloudflare.com/v1/ACCOUNT_TAG/GATEWAY/openrouter",
5152
});
5253

5354
try {
54-
const chatCompletion = await openai.chat.completions.create({
55-
model: "openai/gpt-3.5-turbo",
56-
messages: [{ role: "user", content: "What is Cloudflare?" }]
57-
});
55+
const chatCompletion = await openai.chat.completions.create({
56+
model: "openai/gpt-3.5-turbo",
57+
messages: [{ role: "user", content: "What is Cloudflare?" }],
58+
});
5859

59-
const response = chatCompletion.choices[0].message;
60+
const response = chatCompletion.choices[0].message;
6061

61-
return new Response(JSON.stringify(response));
62+
return new Response(JSON.stringify(response));
6263
} catch (e) {
63-
return new Response(e);
64+
return new Response(e);
6465
}
65-
66-
```
66+
```

0 commit comments

Comments
 (0)