You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Use "AI Bridge" consistently across the documentation, replacing instances of "Bridge." Adjust headings and content throughout to ensure clarity and alignment with the AI Bridge branding.
Copy file name to clipboardExpand all lines: docs/ai-coder/ai-bridge/client-config.md
+31-20Lines changed: 31 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Once AI Bridge is enabled on the server, your users need to configure their AI coding tools to use it. This section explains how users should configure their clients to connect to AI Bridge.
4
4
5
-
###Base URLs
5
+
##Base URLs
6
6
7
7
The exact configuration method varies by client — some use environment variables, others use configuration files or UI settings:
8
8
@@ -11,28 +11,32 @@ The exact configuration method varies by client — some use environment variabl
11
11
12
12
Replace`coder.example.com` with your actual Coder deployment URL.
13
13
14
-
###Authentication
14
+
##Authentication
15
15
16
16
Instead of distributing provider-specific API keys (OpenAI/Anthropic keys) to users, they authenticate to AI Bridge using their**Coder session token** or**API key**:
17
17
18
18
-**OpenAI clients**: Users set`OPENAI_API_KEY` to their Coder session token or API key
19
19
-**Anthropic clients**: Users set`ANTHROPIC_API_KEY` to their Coder session token or API key
20
20
21
-
####Coder Templates Pre-configuration
21
+
##Configuring In-Workspace Tools
22
22
23
-
Template admins can pre-configureauthentication in templates using[`data.coder_workspace_owner.me.session_token`](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace_owner#session_token-1) to automatically configure the workspace owner's credentials.
23
+
Template admins can pre-configureworkspaces to route all AI tool requests through AI Bridge, providing a seamless and secure experience for users. This can be done for both Coder Tasks and other AI tools running in the workspace.
24
24
25
-
Here is an example of how to pre-configure a Coder template to install Claude Code and configure it for AI Bridge using the session token in a template:
25
+
###Using Coder Tasks
26
+
27
+
[Coder Tasks](../tasks.md) provides a framework for using agents like Claude Code to complete background development operations. To route those agents through AI Bridge, you can pre-configure a Coder Tasks template to install Claude Code and configure it for AI Bridge using the session token:
claude_api_key = data.coder_workspace_owner.me.session_token # To Enable AI Bridge integration
52
+
claude_api_key = data.coder_workspace_owner.me.session_token # Use the Coder session token to authenticate with AI Bridge
50
53
ai_prompt = data.coder_parameter.ai_prompt.value
51
54
... # other claude-code configuration
52
55
}
53
-
54
56
```
55
57
56
-
The same approach can be applied to pre-configure additional AI coding assistants by updating the base URL and API key settings.
58
+
This setup keeps agent execution within Coder while applying the same auditing and MCP policies as IDE clients.
59
+
60
+
###Other IDEs and Tools
61
+
62
+
AI assistants running inside a Coder workspace, such as IDE extensions, can be configured to use AI Bridge.
57
63
58
-
####GenericAPI key generation
64
+
While users can manually configure these tools with a long-livedAPI key, template admins can provide a more seamless experience by pre-configuring them. Similar to the Coder Tasks example, admins can use Terraform data sources like`data.coder_workspace_owner.me.session_token` to automatically inject the user's session token and the AI Bridge base URL into the workspace environment.
59
65
60
-
Users can generate a Coder API key using eithertheCLI or the web UI. Follow the instructions at[Sessions and API tokens](../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself) to generate aCoderAPI key.
66
+
This isthefastest way to bring existing agents like Roo Code, Cursor, or Claude Code into compliance without adoptingCoderTasks.
61
67
62
-
###Tested clients
68
+
##External and Desktop Clients
69
+
70
+
You can also configure AI tools running outside of a Coder workspace, such as local IDE extensions or desktop applications, to connect to AI Bridge.
71
+
72
+
The configuration is the same: point the tool to the AI Bridge[base URL](#base-urls) and use a Coder API key for authentication.
73
+
74
+
Users can generate a long-lived API key from the Coder UI or CLI. Follow the instructions at[Sessions and API tokens](../../admin/users/sessions-tokens.md#generate-a-long-lived-api-token-on-behalf-of-yourself) to create one.
75
+
76
+
##Tested clients
63
77
64
78
The table below shows tested AI clients and their compatibility with AI Bridge. Click each client name for vendor-specific configuration instructions. Report issues or share compatibility updates in the[aibridge](https://github.com/coder/aibridge) issue tracker.
|[Claude Code](https://docs.claude.com/en/docs/claude-code/settings#environment-variables)| N/A| ✅| Works out of the box and can be preconfigured in templates.|
69
83
| Claude Code (VS Code)| N/A| ✅| May require signing in once; afterwards respects workspace environment variables.|
70
-
|[Cursor](https://cursor.com/docs/settings/api-keys)| ⚠️| ❌| Only nonreasoning models like`gpt-4.1` are available when using a custom endpoint. Requests still transit Cursor's cloud. There is no central admin setting to configure this.|
84
+
|[Cursor](https://cursor.com/docs/settings/api-keys)| ⚠️| ❌| Only non-reasoning models like`gpt-4.1` are available when using a custom endpoint. Requests still transit Cursor's cloud. There is no central admin setting to configure this.|
71
85
|[Roo Code](https://docs.roocode.com/features/api-configuration-profiles#creating-and-managing-profiles)| ✅| ✅| Use the**OpenAI Compatible** provider with the legacy format to avoid`/v1/responses`.|
72
86
|[Codex CLI](https://github.com/openai/codex/blob/main/docs/config.md#model_providers)| ✅| N/A|`gpt-5-codex` support is[in progress](https://github.com/coder/aibridge/issues/16).|
73
87
|[GitHub Copilot (VS Code)](https://docs.github.com/en/copilot/configuring-github-copilot/configuring-network-settings-for-github-copilot)| ✅| ❌| Requires the pre-release extension. Anthropic endpoints are not supported.|
@@ -83,12 +97,9 @@ The table below shows tested AI clients and their compatibility with AI Bridge.
83
97
84
98
Legend: ✅ works, ⚠️ limited support, ❌ not supported, ❓ not yet verified, — not applicable.
85
99
86
-
>[!NOTE]
87
-
>Click the respective client title to view the vendor-specific instructions for configuring the client.
88
-
89
-
####Compatibility overview
100
+
###Compatibility overview
90
101
91
-
Most AI coding assistantsthat support custom base URLs can work with AI Bridge. Client-specific requirements vary:
102
+
Most AI coding assistantscan use AI Bridge, provided they support custom base URLs. Client-specific requirements vary:
92
103
93
104
- Some clients require specific URL formats (for example, removing the`/v1` suffix).
94
105
- Some clients proxy requests through their own servers, which limits compatibility.
Bridge is a smart proxy for AI. It acts as a man-in-the-middle between your users' coding agents / IDEs
5
+
AIBridge is a smart proxy for AI. It acts as a man-in-the-middle between your users' coding agents / IDEs
6
6
and providers like OpenAI and Anthropic. By intercepting all the AI traffic between these clients and
7
-
the upstream APIs, Bridge can record user prompts, token usage, and tool invocations.
7
+
the upstream APIs,AIBridge can record user prompts, token usage, and tool invocations.
8
8
9
-
Bridge solves 3 key problems:
9
+
AIBridge solves 3 key problems:
10
10
11
11
1.**Centralized authn/z management**: no more issuing & managing API tokens for OpenAI/Anthropic usage.
12
12
Users use their Coder session or API tokens to authenticate with`coderd` (Coder control plane), and
@@ -28,4 +28,9 @@ If you are an administrator or devops leader looking to:
28
28
- Investigate opportunities for AI automation
29
29
- Uncover the high-leverage use cases from experienced engineers
30
30
31
-
We advise trying Bridge as self-hosted proxy to monitor LLM usage agnostically across AI powered IDEs like Cursor and headless agents like Claude Code.
31
+
We advise trying AI Bridge as self-hosted proxy to monitor LLM usage agnostically across AI powered IDEs like Cursor and headless agents like Claude Code.
32
+
33
+
##Known Issues / Limitations
34
+
35
+
- GPT-5 Codex currently does not work with AI Bridge due to missing`v1/responses` endpoint:https://github.com/coder/aibridge/issues/16
36
+
- Claude Code web searches do not report correctly:https://github.com/coder/aibridge/issues/11
Copy file name to clipboardExpand all lines: docs/ai-coder/ai-bridge/mcp.md
+9-23Lines changed: 9 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,30 @@
2
2
3
3
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro) is a mechanism for connecting AI applications to external systems.
4
4
5
-
Bridge can connect to MCP servers and inject tools automatically, enabling you to centrally manage the list of tools you wish to grant your users.
5
+
AIBridge can connect to MCP servers and inject tools automatically, enabling you to centrally manage the list of tools you wish to grant your users.
6
6
7
7
>[!NOTE]
8
-
>Only MCP servers which support OAuth2 Authorization are supported currently. In future releases we will support[optional authorization](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#protocol-requirements).
8
+
>Only MCP servers which support OAuth2 Authorization are supported currently.
9
9
>
10
10
>[_Streamable HTTP_](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#streamable-http) is the only supported transport currently. In future releases we will support the (now deprecated)[_Server-Sent Events_](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#backwards-compatibility) transport.
11
11
12
-
Bridge makes use of[External Auth](../../admin/external-auth/index.md) applications, as they define OAuth2 connections to upstream services. If your External Auth application hosts a remote MCP server, you can configure Bridge to connect to it, retrieve its tools and inject them into requests automatically - all while using each individual user's access token.
12
+
AIBridge makes use of[External Auth](../../admin/external-auth/index.md) applications, as they define OAuth2 connections to upstream services. If your External Auth application hosts a remote MCP server, you can configure AI Bridge to connect to it, retrieve its tools and inject them into requests automatically - all while using each individual user's access token.
13
13
14
14
For example, GitHub has a[remote MCP server](https://github.com/github/github-mcp-server?tab=readme-ov-file#remote-github-mcp-server) and we can use it as follows.
15
15
16
16
```bash
17
17
CODER_EXTERNAL_AUTH_0_TYPE=github
18
18
CODER_EXTERNAL_AUTH_0_CLIENT_ID=...
19
19
CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=...
20
-
# Tell Bridge where it can find this service's remote MCP server.
20
+
# TellAIBridge where it can find this service's remote MCP server.
@@ -45,27 +45,13 @@ In the above example, if you prompted your AI model with "list your available gi
45
45
>1.`bmcp_github_update_gist`
46
46
>2.`bmcp_github_list_gists`
47
47
48
-
Bridge marks automatically injected tools with a prefix`bmcp_` ("bridged MCP"). It also namespaces all tool names by the ID of their associated External Auth application (in this case`github`).
49
-
50
-
##Using AI Bridge with Coder Tasks
51
-
52
-
[Coder Tasks](../../workspaces/tasks.md) provides a framework for using agents like Claude Code to complete background development operations. To route those agents through Bridge:
53
-
54
-
- Enable Bridge at the control plane and configure the upstream provider keys.
55
-
- Inject the AI Bridge base URLs and API keys into the Task environment (for example by setting`OPENAI_BASE_URL` and`OPENAI_API_KEY`).
56
-
- Template authors can bake these variables into Task definitions so that new runs automatically use Bridge.
57
-
58
-
This setup keeps agent execution within Coder while applying the same auditing and MCP policies as IDE clients.
59
-
60
-
##Using AI Bridge without Tasks
61
-
62
-
Bridge also works with IDE-native assistants inside workspaces. Configure the IDE extension or desktop client to point at the Bridge endpoints and rely on the workspace's environment variables for authentication. This is the fastest path to bring existing agents like Roo Code, Cursor, or Claude Code into compliance without adopting Tasks.
48
+
AI Bridge marks automatically injected tools with a prefix`bmcp_` ("bridged MCP"). It also namespaces all tool names by the ID of their associated External Auth application (in this case`github`).
63
49
64
50
##Tool Injection
65
51
66
-
If a model decides to invoke a tool and it has a`bmcp_` suffix and Bridge has a connection with the related MCP server, it will invoke the tool. The tool result will be passed back to the upstream AI provider, and this will loop until the model has all of its required data. These inner loops are not relayed back to the client; all it seems is the result of this loop. See[Implementation Details](../reference#implementation-details).
52
+
If a model decides to invoke a tool and it has a`bmcp_` suffix andAIBridge has a connection with the related MCP server, it will invoke the tool. The tool result will be passed back to the upstream AI provider, and this will loop until the model has all of its required data. These inner loops are not relayed back to the client; all it seems is the result of this loop. See[Implementation Details](./reference.md#implementation-details).
67
53
68
-
In contrast, tools which are defined by the client (i.e. the[`Bash` tool](https://docs.claude.com/en/docs/claude-code/settings#tools-available-to-claude) defined by_Claude Code_) cannot be invoked by Bridge, and the tool call from the model will be relayed to the client, after which it will invoke the tool.
54
+
In contrast, tools which are defined by the client (i.e. the[`Bash` tool](https://docs.claude.com/en/docs/claude-code/settings#tools-available-to-claude) defined by_Claude Code_) cannot be invoked byAIBridge, and the tool call from the model will be relayed to the client, after which it will invoke the tool.
69
55
70
56
If you have the`oauth2` and`mcp-server-http` experiments enabled, Coder's own[internal MCP tools](../mcp-server.md) will be injected automatically.
Copy file name to clipboardExpand all lines: docs/ai-coder/ai-bridge/monitoring.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
#Monitoring
2
2
3
-
Bridge records the last`user` prompt, token usage, and every tool invocation for each intercepted request. Each capture is tied to a single "interception" that maps back to the authenticated Coder identity, making it easy to attribute spend and behaviour.
3
+
AIBridge records the last`user` prompt, token usage, and every tool invocation for each intercepted request. Each capture is tied to a single "interception" that maps back to the authenticated Coder identity, making it easy to attribute spend and behaviour.
Copy file name to clipboardExpand all lines: docs/ai-coder/ai-bridge/reference.md
+4-9Lines changed: 4 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
`coderd` runs an in-memory instance of`aibridged`, whose logic is mostly contained inhttps://github.com/coder/aibridge. In future releases we will support running external instances for higher throughput and complete memory isolation from`coderd`.
6
6
7
7
<details>
8
-
<summary>See a diagram of how Bridge interception works</summary>
8
+
<summary>See a diagram of howAIBridge interception works</summary>
-**Intercepted**: requests are intercepted, audited, and augmented - full Bridge functionality
71
+
-**Intercepted**: requests are intercepted, audited, and augmented - fullAIBridge functionality
77
72
-**Passthrough**: requests are proxied directly to the upstream, no auditing or augmentation takes place
78
73
79
74
Where relevant, both streaming and non-streaming requests are supported.
@@ -101,4 +96,4 @@ Where relevant, both streaming and non-streaming requests are supported.
101
96
102
97
##Troubleshooting
103
98
104
-
To report a bug, file a feature request, or view a list of known issues, please visit our[GitHub repository for Bridge](https://github.com/coder/aibridge). If you encounter issues with Bridge during early access, please reach out to us via[Discord](https://discord.gg/coder).
99
+
To report a bug, file a feature request, or view a list of known issues, please visit our[GitHub repository forAIBridge](https://github.com/coder/aibridge). If you encounter issues with AI Bridge during early access, please reach out to us via[Discord](https://discord.gg/coder).