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
Copy file name to clipboardExpand all lines: docs/ai-coder/ai-bridge.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,44 @@ Bridge is compatible with _[Google Vertex AI](https://cloud.google.com/vertex-ai
81
81
>[!NOTE]
82
82
>See[Supported APIs](#supported-apis) section below for a comprehensive list.
83
83
84
+
##Client Configuration
85
+
86
+
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.
87
+
88
+
###Setting Base URLs
89
+
90
+
The exact configuration method varies by client — some use environment variables, others use configuration files or UI settings:
91
+
92
+
-**OpenAI-compatible clients**: Set the base URL (commonly via the`OPENAI_BASE_URL` environment variable) to`https://coder.example.com/api/experimental/aibridge/openai/v1`
93
+
-**Anthropic-compatible clients**: Set the base URL (commonly via the`ANTHROPIC_BASE_URL` environment variable) to`https://coder.example.com/api/experimental/aibridge/anthropic`
94
+
95
+
Replace`coder.example.com` with your actual Coder deployment URL.
96
+
97
+
###Authentication
98
+
99
+
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**:
100
+
101
+
-**OpenAI clients**: Users set`OPENAI_API_KEY` to their Coder session token or API key
102
+
-**Anthropic clients**: Users set`ANTHROPIC_API_KEY` to their Coder session token or API key
103
+
104
+
Users can generate a Coder API key using:
105
+
106
+
```sh
107
+
coder tokens create
108
+
```
109
+
110
+
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.
111
+
112
+
####Compatibility Notes
113
+
114
+
Most AI coding assistants that support custom base URLs can work with AI Bridge. However, client-specific configuration requirements vary:
115
+
116
+
- Some clients require specific URL formats (e.g. try removing the`/v1` suffix)
117
+
- Some clients may proxy requests through their own servers, limiting compatibility (e.g. Cursor)
118
+
- Some clients may not support custom base URLs at all (e.g. Copilot CLI, Sourcegraph Amp)
119
+
120
+
Consult your specific AI client's documentation for details on configuring custom API endpoints.