Client Configuration

Once AI Bridge is setup on your deployment, the AI coding tools used by your users will need to be configured to route requests via AI Bridge.

Base URLs

Most AI coding tools allow the "base URL" to be customized. In other words, when a request is made to OpenAI's API from your coding tool, the API endpoint such as /v1/chat/completions will be appended to the configured base. Therefore, instead of the default base URL of "https://api.openai.com/v1", you'll need to set it to "https://coder.example.com/api/v2/aibridge/openai/v1".

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/v2/aibridge/openai/v1
  • Anthropic-compatible clients: Set the base URL (commonly via the ANTHROPIC_BASE_URL environment variable) to https://coder.example.com/api/v2/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

Again, the exact environment variable or setting naming may differ from tool to tool; consult your tool's documentation.

Configuring In-Workspace Tools

AI coding tools running inside a Coder workspace, such as IDE extensions, can be configured to use AI Bridge.

While users can manually configure these tools with a long-lived API key, template admins can provide a more seamless experience by pre-configuring them. Admins can automatically inject the user's session token with data.coder_workspace_owner.me.session_token and the AI Bridge base URL into the workspace environment.

In this example, Claude code respects these environment variables and will route all requests via AI Bridge.

This is the fastest way to bring existing agents like Roo Code, Cursor, or Claude Code into compliance without adopting Coder Tasks.

data "coder_workspace_owner" "me" {} data "coder_workspace" "me" {} resource "coder_agent" "dev" { arch = "amd64" os = "linux" dir = local.repo_dir env = { ANTHROPIC_BASE_URL : "${data.coder_workspace.me.url}/api/v2/aibridge/anthropic", ANTHROPIC_AUTH_TOKEN : data.coder_workspace_owner.me.session_token } ... # other agent configuration }

Using Coder Tasks

Agents like Claude Code can be configured to route through AI Bridge in any template by pre-configuring the agent with the session token. Coder Tasks is particularly useful for this pattern, providing a framework for agents to complete background development operations autonomously. To route agents through AI Bridge in a Coder Tasks template, pre-configure it to install Claude Code and configure it with the session token:

data "coder_workspace_owner" "me" {} data "coder_workspace" "me" {} resource "coder_agent" "dev" { arch = "amd64" os = "linux" dir = local.repo_dir env = { ANTHROPIC_BASE_URL : "${data.coder_workspace.me.url}/api/v2/aibridge/anthropic", ANTHROPIC_AUTH_TOKEN : data.coder_workspace_owner.me.session_token } ... # other agent configuration } # See https://registry.coder.com/modules/coder/claude-code for more information module "claude-code" { count = local.has_ai_prompt ? data.coder_workspace.me.start_count : 0 source = "dev.registry.coder.com/coder/claude-code/coder" version = ">= 3.4.0" agent_id = coder_agent.dev.id workdir = "/home/coder/project" claude_api_key = data.coder_workspace_owner.me.session_token # Use the Coder session token to authenticate with AI Bridge ai_prompt = data.coder_parameter.ai_prompt.value ... # other claude-code configuration }

External and Desktop Clients

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.

The configuration is the same: point the tool to the AI Bridge base URL and use a Coder API key for authentication.

Users can generate a long-lived API key from the Coder UI or CLI. Follow the instructions at Sessions and API tokens to create one.

Compatibility

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 issue tracker.

ClientOpenAI supportAnthropic supportNotes
Claude CodeN/AWorks out of the box and can be preconfigured in templates.
Claude Code (VS Code)N/AMay require signing in once; afterwards respects workspace environment variables.
Cursor⚠️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.
Roo CodeUse the OpenAI Compatible provider with the legacy format to avoid /v1/responses.
Codex CLIN/Agpt-5-codex support is in progress.
GitHub Copilot (VS Code)Requires the pre-release extension. Anthropic endpoints are not supported.
Goose
Goose Desktop
WindSurfNo option to override the base URL.
Sourcegraph AmpNo option to override the base URL.
KiroNo option to override the base URL.
Copilot CLINo support for custom base URLs and uses a GITHUB_TOKEN for authentication.
Kilo CodeSimilar to Roo Code.
Gemini CLINot supported yet.
Amazon Q CLILimited to Amazon Q subscriptions; no custom endpoint support.

Legend: ✅ works, ⚠️ limited support, ❌ not supported, ❓ not yet verified, — not applicable.

Compatibility Overview

Most AI coding assistants can use AI Bridge, provided they support custom base URLs. Client-specific requirements vary:

  • Some clients require specific URL formats (for example, removing the /v1 suffix).
  • Some clients proxy requests through their own servers, which limits compatibility.
  • Some clients do not support custom base URLs.

See the table in the compatibility section above for the combinations we have verified and any known issues.