- Notifications
You must be signed in to change notification settings - Fork1.1k
docs: add base URLs and authentication section to AI Bridge#20404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
cf173609ce1e444aac2ef46c0b64ed50c8288a77da783924ee6806d3File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| > [!NOTE] | ||
| > See [Supported APIs](#supported-apis) section below for a comprehensive list. | ||
| ## Client Configuration | ||
| 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. | ||
| ### Setting Base URLs | ||
| The exact configuration method varies by client — some use environment variables, others use configuration files or UI settings: | ||
| - **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` | ||
| - **Anthropic-compatible clients**: Set the base URL (commonly via the `ANTHROPIC_BASE_URL` environment variable) to `https://coder.example.com/api/experimental/aibridge/anthropic` | ||
| Replace `coder.example.com` with your actual Coder deployment URL. | ||
| ### Authentication | ||
| 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**: | ||
| - **OpenAI clients**: Users set `OPENAI_API_KEY` to their Coder session token or API key | ||
| - **Anthropic clients**: Users set `ANTHROPIC_API_KEY` to their Coder session token or API key | ||
| Users can generate a Coder API key using: | ||
| ```sh | ||
| coder tokens create | ||
| ``` | ||
| 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. | ||
| #### Compatibility Notes | ||
| Most AI coding assistants that support custom base URLs can work with AI Bridge. However, client-specific configuration requirements vary: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think we should list compatibility notes for stuff we know about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I want to do that in a follow up. | ||
| - Some clients require specific URL formats (e.g. try removing the `/v1` suffix) | ||
| - Some clients may proxy requests through their own servers, limiting compatibility (e.g. Cursor) | ||
| - Some clients may not support custom base URLs at all (e.g. Copilot CLI, Sourcegraph Amp) | ||
| Consult your specific AI client's documentation for details on configuring custom API endpoints. | ||
| ## Collected Data | ||
| Bridge collects: | ||
Uh oh!
There was an error while loading.Please reload this page.