Skip to content

Commit 3d6a32b

Browse files
committed
Partial fixes
1 parent c543908 commit 3d6a32b

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
title: OpenAI Compatibility
33
pcx_content_type: configuration
44
sidebar:
5-
order: 5
5+
order: 4
66
---
77

88
Cloudflare's AI Gateway offers an OpenAI-compatible `/chat/completions` endpoint, enabling integration with multiple AI providers using a single URL. This feature simplifies the integration process, allowing for seamless switching between different models without significant code modifications.
99

10-
## Key benefits
11-
12-
- Standardization: Provides a unified format compatible with OpenAI's schema, reducing the need for code refactoring.
13-
- Ease of Development: Switch between different models and providers quickly using a consistent API structure.
14-
1510
## Endpoint URL
1611

1712
```txt
@@ -20,19 +15,19 @@ https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat/chat/compl
2015

2116
Replace `{account_id}` and `{gateway_id}` with your Cloudflare account and gateway IDs.
2217

23-
## Using the Unified Interface
18+
## Parameters
2419

2520
Switch providers by changing the `model` and `apiKey` parameters.
2621

27-
## Model Parameter Format
28-
2922
Specify the model using `{provider}/{model}` format. For example:
3023

3124
- `openai/gpt-4o-mini`
3225
- `google-ai-studio/gemini-2.0-flash`
3326
- `anthropic/claude-3-haiku`
3427

35-
## Example with OpenAI JavaScript SDK
28+
## Examples
29+
30+
### OpenAI SDK
3631

3732
```js
3833
import OpenAI from "openai";
@@ -50,7 +45,7 @@ const response = await client.chat.completions.create({
5045
console.log(response.choices[0].message.content);
5146
```
5247

53-
## `curl` Example
48+
### cURL
5449

5550
```bash
5651
curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat/chat/completions \
@@ -67,6 +62,10 @@ curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/comp
6762
}'
6863
```
6964

65+
### Universal provider
66+
67+
TBD
68+
7069
## Supported Providers
7170

7271
The OpenAI-compatible endpoint supports models from the following providers:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Configuration
44
sidebar:
55
group:
66
hideIndex: true
7-
order: 4
7+
order: 5
88
---
99

1010
import { DirectoryListing } from "~/components";

src/content/docs/ai-gateway/providers/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Model providers
44
sidebar:
55
group:
66
hideIndex: true
7-
order: 3
7+
order: 4
88
---
99

1010
Here is a quick list of the providers we support:

src/content/docs/ai-gateway/websockets-api/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pcx_content_type: configuration
44
sidebar:
55
group:
66
badge: Beta
7-
order: 3
7+
order: 4
88
---
99

1010
The AI Gateway WebSockets API provides a persistent connection for AI interactions, eliminating repeated handshakes and reducing latency. This API is divided into two categories:

src/content/partials/ai-gateway/chat-completions-providers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Code } from "~/components";
88

99
## OpenAI-Compatible Endpoint
1010

11-
You can also use the OpenAI-compatible endpoint (`/ai-gateway/chat-completion/`) to access {props.name} models using the OpenAI API schema. To do so, send your requests to:
11+
You can also use the [OpenAI-compatible endpoint](/ai-gateway/chat-completion/) (`/ai-gateway/chat-completion/`) to access {props.name} models using the OpenAI API schema. To do so, send your requests to:
1212

1313
```txt
1414
https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat/chat/completions

0 commit comments

Comments
 (0)