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
Revised AI Bridge documentation to improve clarity, organization, and detail. Updated instructions for base URL configuration, authentication, and using AI Bridge with Coder Tasks. Streamlined sections on tool injection and added known issues. Updated provider configuration instructions for OpenAI, Anthropic, and Amazon Bedrock. Enhanced diagram and troubleshooting guidance.
Copy file name to clipboardExpand all lines: docs/ai-coder/ai-bridge/client-config.md
+17-10Lines changed: 17 additions & 10 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,14 +11,19 @@ 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
+
##Using AI Bridge with Coder Tasks
22
+
23
+
[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:
24
+
25
+
- Enable AI Bridge at the control plane and configure the upstream provider keys.
26
+
- Inject the AI Bridge base URLs and API keys into the Task environment (for example by setting`OPENAI_BASE_URL` and`OPENAI_API_KEY`).
22
27
23
28
Template admins can pre-configure authentication 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.
claude_api_key = data.coder_workspace_owner.me.session_token # To Enable AI Bridge integration
50
54
ai_prompt = data.coder_parameter.ai_prompt.value
51
55
... # other claude-code configuration
52
56
}
53
-
54
57
```
55
58
56
-
The same approach can be applied to pre-configure additional AI coding assistants by updating the base URL and API key settings.
59
+
This setup keeps agent execution within Coder while applying the same auditing and MCP policies as IDE clients.
60
+
61
+
###Using AI Bridge without Tasks
62
+
63
+
AI Bridge also works with IDE-native assistants inside workspaces. Configure the IDE extension or desktop client to point at the AI 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.
57
64
58
-
####Generic API key generation
65
+
###Generic API key generation
59
66
60
67
Users can generate a Coder API key using either the CLI 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 a Coder API key.
61
68
62
-
###Tested clients
69
+
##Tested clients
63
70
64
71
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.
65
72
@@ -86,7 +93,7 @@ Legend: ✅ works, ⚠️ limited support, ❌ not supported, ❓ not yet verifi
86
93
>[!NOTE]
87
94
>Click the respective client title to view the vendor-specific instructions for configuring the client.
88
95
89
-
####Compatibility overview
96
+
###Compatibility overview
90
97
91
98
Most AI coding assistants that support custom base URLs can work with AI Bridge. Client-specific requirements vary:
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).
Bridge runs inside the Coder control plane, requiring no separate compute to deploy or scale. Once enabled,`coderd`hosts thebridge in-memory and brokers traffic to your configured AI providers on behalf of authenticated users.
3
+
AIBridge runs inside the Coder control plane, requiring no separate compute to deploy or scale. Once enabled,`coderd`runs the`aibridged` in-memory and brokers traffic to your configured AI providers on behalf of authenticated users.
4
4
5
5
**Required**:
6
6
7
7
1. A**premium** licensed Coder deployment
8
8
1. Feature must be[enabled](#activation) using the server flag
9
9
1. One or more[provider](#configure-providers) API key(s) must be configured
10
10
11
-
###Activation
11
+
##Activation
12
12
13
13
You will need to enable AI Bridge explicitly:
14
14
@@ -18,41 +18,41 @@ CODER_AIBRIDGE_ENABLED=true coder server
18
18
coder server --aibridge-enabled=true
19
19
```
20
20
21
-
###Configure providers
21
+
##Configure providers
22
22
23
-
Bridge proxies requests to upstream LLM APIs. Configure at least one provider before exposing Bridge to end users.
23
+
AIBridge proxies requests to upstream LLM APIs. Configure at least one provider before exposing AI Bridge to end users.
24
24
25
-
####OpenAI
25
+
###OpenAI
26
26
27
-
Set the following when routing OpenAI-compatible traffic through Bridge:
27
+
Set the following when routing OpenAI-compatible traffic throughAIBridge:
The default base URL (`https://api.openai.com/v1/`) works for the native OpenAI service. Point the base URL at your preferred OpenAI-compatible endpoint (for example, a hosted proxy or LiteLLM deployment) when needed.
33
33
34
-
####Anthropic
34
+
###Anthropic
35
35
36
-
Set the following when routing Anthropic-compatible traffic through Bridge:
36
+
Set the following when routing Anthropic-compatible traffic throughAIBridge:
Bridge can relay traffic to other OpenAI- or Anthropic-compatible services or model proxies like LiteLLM by pointing the base URL variables above at the provider you operate. Share feedback or follow along in the[`aibridge`](https://github.com/coder/aibridge) issue tracker as we expand support for additional providers.
55
+
AIBridge can relay traffic to other OpenAI- or Anthropic-compatible services or model proxies like LiteLLM by pointing the base URL variables above at the provider you operate. Share feedback or follow along in the[`aibridge`](https://github.com/coder/aibridge) issue tracker as we expand support for additional providers.
56
56
57
57
>[!NOTE]
58
-
>See the[Supported APIs](../reference#supported-apis) section below for precise endpoint coverage and interception behavior.
58
+
>See the[Supported APIs](./reference.md#supported-apis) section below for precise endpoint coverage and interception behavior.