diff options
| author | Matt Silverlock <[email protected]> | 2025-12-23 18:31:58 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-23 17:31:58 -0600 |
| commit | 9898fbe8ef7584002691e1e9b6d6da4b526caa63 (patch) | |
| tree | 4eb8f446630891414831d8f0df915ad9cd4ea8bd /packages/web/src/content/docs | |
| parent | 1bd8e617198b7e1592142849accbc7889ae2526b (diff) | |
| download | opencode-9898fbe8ef7584002691e1e9b6d6da4b526caa63.tar.gz opencode-9898fbe8ef7584002691e1e9b6d6da4b526caa63.zip | |
providers: add Cloudflare AI Gateway (#5174)
Diffstat (limited to 'packages/web/src/content/docs')
| -rw-r--r-- | packages/web/src/content/docs/providers.mdx | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/packages/web/src/content/docs/providers.mdx b/packages/web/src/content/docs/providers.mdx index 5f9b040d4..e38c0dff1 100644 --- a/packages/web/src/content/docs/providers.mdx +++ b/packages/web/src/content/docs/providers.mdx @@ -323,6 +323,64 @@ If you encounter "I'm sorry, but I cannot assist with that request" errors, try --- +### Cloudflare AI Gateway + +Cloudflare AI Gateway lets you access models from OpenAI, Anthropic, Workers AI, and more through a unified endpoint. With [Unified Billing](https://developers.cloudflare.com/ai-gateway/features/unified-billing/) you don't need separate API keys for each provider. + +1. Head over to the [Cloudflare dashboard](https://dash.cloudflare.com/), navigate to **AI** > **AI Gateway**, and create a new gateway. + +2. Set your Account ID and Gateway ID as environment variables. + + ```bash title="~/.bash_profile" + export CLOUDFLARE_ACCOUNT_ID=your-32-character-account-id + export CLOUDFLARE_GATEWAY_ID=your-gateway-id + ``` + +3. Run the `/connect` command and search for **Cloudflare AI Gateway**. + + ```txt + /connect + ``` + +4. Enter your Cloudflare API token. + + ```txt + ┌ API key + │ + │ + └ enter + ``` + + Or set it as an environment variable. + + ```bash title="~/.bash_profile" + export CLOUDFLARE_API_TOKEN=your-api-token + ``` + +5. Run the `/models` command to select a model. + + ```txt + /models + ``` + + You can also add models through your opencode config. + + ```json title="opencode.json" + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "cloudflare-ai-gateway": { + "models": { + "openai/gpt-4o": {}, + "anthropic/claude-sonnet-4": {} + } + } + } + } + ``` + +--- + ### Cortecs 1. Head over to the [Cortecs console](https://cortecs.ai/), create an account, and generate an API key. |
