diff --git a/docs/ai-coder/ai-gateway/clients/cline.md b/docs/ai-coder/ai-gateway/clients/cline.md index 49236fa6f2..b373824384 100644 --- a/docs/ai-coder/ai-gateway/clients/cline.md +++ b/docs/ai-coder/ai-gateway/clients/cline.md @@ -7,6 +7,8 @@ Cline supports both OpenAI and Anthropic models and can be configured to use AI To configure Cline to use AI Gateway, follow these steps: ![Cline Settings](../../../images/aibridge/clients/cline-setup.png) +## Centralized API Key +
### OpenAI Compatible @@ -33,4 +35,22 @@ To configure Cline to use AI Gateway, follow these steps:
+## BYOK (Personal API Key) + +
+ +### OpenAI Compatible + +1. Open Cline in VS Code. +1. Go to **Settings**. +1. **API Provider**: Select **OpenAI Compatible**. +1. **Base URL**: Enter `https://coder.example.com/api/v2/aibridge/openai/v1`. +1. **OpenAI Compatible API Key**: Enter your personal OpenAI API key. +1. **Model ID** (Optional): Enter the model you wish to use (e.g., `gpt-5.2-codex`). +1. **Custom Headers**: Add `X-Coder-AI-Governance-Token` with your **[Coder Session Token](../../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself)**. + +![Cline BYOK OpenAI Settings](../../../images/aibridge/clients/cline-byok-openai.png) + +
+ **References:** [Cline Configuration](https://github.com/cline/cline) diff --git a/docs/ai-coder/ai-gateway/clients/factory.md b/docs/ai-coder/ai-gateway/clients/factory.md index d0cdacb98a..cf9d7a818c 100644 --- a/docs/ai-coder/ai-gateway/clients/factory.md +++ b/docs/ai-coder/ai-gateway/clients/factory.md @@ -2,7 +2,7 @@ Factort's Droid agent can be configured to use AI Gateway by setting up custom models for OpenAI and Anthropic. -## Configuration +## Centralized API Key 1. Open `~/.factory/settings.json` (create it if it does not exist). 2. Add a `customModels` entry for each provider you want to use with AI Gateway. @@ -13,7 +13,7 @@ Factort's Droid agent can be configured to use AI Gateway by setting up custom m { "customModels": [ { - "model": "claude-4-5-opus", + "model": "claude-sonnet-4-5-20250929", "displayName": "Claude (Coder AI Bridge)", "baseUrl": "https://coder.example.com/api/v2/aibridge/anthropic", "apiKey": "", @@ -32,4 +32,41 @@ Factort's Droid agent can be configured to use AI Gateway by setting up custom m } ``` +## BYOK (Personal API Key) + +1. Open `~/.factory/settings.json` (create it if it does not exist). +2. Add a `customModels` entry for each provider you want to use with AI Bridge. +3. Replace `coder.example.com` with your Coder deployment URL. +4. Use your personal API key for `apiKey`. +5. Set the `X-Coder-AI-Governance-Token` header to your **[Coder session token](../../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself)**. + +```json +{ + "customModels": [ + { + "model": "claude-sonnet-4-5-20250929", + "displayName": "Claude (Coder AI Bridge)", + "baseUrl": "https://coder.example.com/api/v2/aibridge/anthropic", + "apiKey": "", + "provider": "anthropic", + "maxOutputTokens": 8192, + "extraHeaders": { + "X-Coder-AI-Governance-Token": "" + } + }, + { + "model": "gpt-5.2-codex", + "displayName": "GPT (Coder AI Bridge)", + "baseUrl": "https://coder.example.com/api/v2/aibridge/openai/v1", + "apiKey": "", + "provider": "openai", + "maxOutputTokens": 16384, + "extraHeaders": { + "X-Coder-AI-Governance-Token": "" + } + } + ] +} +``` + **References:** [Factory BYOK OpenAI & Anthropic](https://docs.factory.ai/cli/byok/openai-anthropic) diff --git a/docs/ai-coder/ai-gateway/clients/jetbrains.md b/docs/ai-coder/ai-gateway/clients/jetbrains.md index 81abafce3a..91399086f6 100644 --- a/docs/ai-coder/ai-gateway/clients/jetbrains.md +++ b/docs/ai-coder/ai-gateway/clients/jetbrains.md @@ -7,7 +7,7 @@ JetBrains IDE (IntelliJ IDEA, PyCharm, WebStorm, etc.) support AI Gateway via th * [**JetBrains AI Assistant**](https://www.jetbrains.com/help/ai-assistant/installation-guide-ai-assistant.html): Installed and enabled. * **Authentication**: Your **[Coder session token](../../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself)**. -## Configuration +## Centralized API Key 1. **Open Settings**: Go to **Settings** > **Tools** > **AI Assistant** > **Models & API Keys**. 1. **Configure Provider**: Go to **Third-party AI providers**. @@ -32,4 +32,9 @@ You can now use the AI Assistant chat with the configured provider. > * JetBrains AI Assistant currently only supports OpenAI-compatible endpoints. There is an open [issue](https://youtrack.jetbrains.com/issue/LLM-22740) tracking support for Anthropic. > * JetBrains AI Assistant may not support all models that support OPenAI's `/chat/completions` endpoint in Chat mode. +## BYOK (Personal API Key) + +> [!NOTE] +> At the time of writing, JetBrains AI Assistant does not support sending custom headers, so BYOK mode is not available. + **References:** [Use custom models with JetBrains AI Assistant](https://www.jetbrains.com/help/ai-assistant/use-custom-models.html#provide-your-own-api-key) diff --git a/docs/ai-coder/ai-gateway/clients/kilo-code.md b/docs/ai-coder/ai-gateway/clients/kilo-code.md index 60fce5e44e..a8f5520d62 100644 --- a/docs/ai-coder/ai-gateway/clients/kilo-code.md +++ b/docs/ai-coder/ai-gateway/clients/kilo-code.md @@ -2,7 +2,7 @@ Kilo Code allows you to configure providers via the UI and can be set up to use AI Gateway. -## Configuration +## Centralized API Key
@@ -30,4 +30,9 @@ Kilo Code allows you to configure providers via the UI and can be set up to use
+## BYOK (Personal API Key) + +> [!NOTE] +> Kilo Code supports sending custom headers, but the integration does not currently work reliably with AI Gateway. + **References:** [Kilo Code Configuration](https://kilocode.ai/docs/ai-providers/openai-compatible) diff --git a/docs/ai-coder/ai-gateway/clients/opencode.md b/docs/ai-coder/ai-gateway/clients/opencode.md index 116dcd7431..654194efdb 100644 --- a/docs/ai-coder/ai-gateway/clients/opencode.md +++ b/docs/ai-coder/ai-gateway/clients/opencode.md @@ -2,7 +2,7 @@ OpenCode supports both OpenAI and Anthropic models and can be configured to use AI Gateway by setting custom base URLs for each provider. -## Configuration +## Centralized API Key You can configure OpenCode to connect to AI Gateway by setting the following configuration options in your OpenCode configuration file (e.g., `~/.config/opencode/opencode.json`): @@ -24,8 +24,6 @@ You can configure OpenCode to connect to AI Gateway by setting the following con } ``` -## Authentication - To authenticate with AI Gateway, get your **[Coder session token](../../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself)** and replace `` in `~/.local/share/opencode/auth.json` ```json @@ -41,4 +39,47 @@ To authenticate with AI Gateway, get your **[Coder session token](../../../admin } ``` +## BYOK (Personal API Key) + +Set the following in `~/.config/opencode/opencode.json`, including the `X-Coder-AI-Governance-Token` header with your Coder session token: + +```json +{ + "$schema": "https://opencode.ai/config.json", + "provider": { + "anthropic": { + "options": { + "baseURL": "https://coder.example.com/api/v2/aibridge/anthropic/v1", + "headers": { + "X-Coder-AI-Governance-Token": "" + } + } + }, + "openai": { + "options": { + "baseURL": "https://coder.example.com/api/v2/aibridge/openai/v1", + "headers": { + "X-Coder-AI-Governance-Token": "" + } + } + } + } +} +``` + +Set your personal API keys in `~/.local/share/opencode/auth.json`: + +```json +{ + "anthropic": { + "type": "api", + "key": "" + }, + "openai": { + "type": "api", + "key": "" + } +} +``` + **References:** [OpenCode Documentation](https://opencode.ai/docs/providers/#config) diff --git a/docs/ai-coder/ai-gateway/clients/roo-code.md b/docs/ai-coder/ai-gateway/clients/roo-code.md index 2445eed026..9bde44cc0a 100644 --- a/docs/ai-coder/ai-gateway/clients/roo-code.md +++ b/docs/ai-coder/ai-gateway/clients/roo-code.md @@ -6,6 +6,8 @@ Roo Code allows you to configure providers via the UI and can be set up to use A Roo Code allows you to configure providers via the UI. +## Centralized API Key +
### OpenAI Compatible @@ -36,4 +38,22 @@ Roo Code allows you to configure providers via the UI. * If you encounter issues with the **OpenAI** provider type, use **OpenAI Compatible** to ensure correct endpoint routing. * Ensure your Coder deployment URL is reachable from your VS Code environment. +## BYOK (Personal API Key) + +
+ +### OpenAI Compatible + +1. Open Roo Code in VS Code. +1. Go to **Settings**. +1. **Provider**: Select **OpenAI Compatible**. +1. **Base URL**: Enter `https://coder.example.com/api/v2/aibridge/openai/v1`. +1. **API Key**: Enter your personal OpenAI API key. +1. **Model ID**: Enter the model you wish to use (e.g., `gpt-4o`). +1. **Custom Headers**: Add `X-Coder-AI-Governance-Token` with your **[Coder Session Token](../../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself)**. + +![Roo Code BYOK OpenAI Settings](../../../images/aibridge/clients/roo-code-byok-openai.png) + +
+ **References:** [Roo Code Configuration Profiles](https://docs.roocode.com/features/api-configuration-profiles#creating-and-managing-profiles) diff --git a/docs/ai-coder/ai-gateway/clients/vscode.md b/docs/ai-coder/ai-gateway/clients/vscode.md index 6c100f0c1c..a04c670343 100644 --- a/docs/ai-coder/ai-gateway/clients/vscode.md +++ b/docs/ai-coder/ai-gateway/clients/vscode.md @@ -2,7 +2,7 @@ VS Code's native chat can be configured to use AI Gateway with the GitHub Copilot Chat extension's custom language model support. -## Configuration +## Centralized API Key > [!IMPORTANT] > You need the **Pre-release** version of the [GitHub Copilot Chat extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat) and [VS Code Insiders](https://code.visualstudio.com/insiders/). @@ -47,4 +47,9 @@ _Replace `coder.example.com` with your Coder deployment URL._ > [!NOTE] > The setting names may change as the feature moves from pre-release to stable. Refer to the official documentation for the latest setting keys. +## BYOK (Personal API Key) + +> [!NOTE] +> At the time of writing, GitHub Copilot Chat does not support sending custom headers, so BYOK mode is not available. + **References:** [GitHub Copilot - Bring your own language model](https://code.visualstudio.com/docs/copilot/customization/language-models#_add-an-openaicompatible-model) diff --git a/docs/ai-coder/ai-gateway/clients/zed.md b/docs/ai-coder/ai-gateway/clients/zed.md index 944b9f244a..e3744ef6df 100644 --- a/docs/ai-coder/ai-gateway/clients/zed.md +++ b/docs/ai-coder/ai-gateway/clients/zed.md @@ -2,7 +2,7 @@ Zed IDE supports AI Gateway via its `language_models` configuration in `settings.json`. -## Configuration +## Centralized API Key To configure Zed to use AI Gateway, you need to edit your `settings.json` file. You can access this by pressing `Cmd/Ctrl + ,` or opening the command palette and searching for "Open Settings". @@ -60,4 +60,9 @@ You can set this in two ways:
+## BYOK (Personal API Key) + +> [!NOTE] +> At the time of writing, Zed Agent does not support sending custom headers, so BYOK mode is not available. + **References:** [Configuring Zed - Language Models](https://zed.dev/docs/reference/all-settings#language-models) diff --git a/docs/images/aibridge/clients/cline-byok-openai.png b/docs/images/aibridge/clients/cline-byok-openai.png new file mode 100644 index 0000000000..9f65ae2c1f Binary files /dev/null and b/docs/images/aibridge/clients/cline-byok-openai.png differ diff --git a/docs/images/aibridge/clients/roo-code-byok-openai.png b/docs/images/aibridge/clients/roo-code-byok-openai.png new file mode 100644 index 0000000000..b4d2d3f0c2 Binary files /dev/null and b/docs/images/aibridge/clients/roo-code-byok-openai.png differ