Skip to content

Commit 1a11811

Browse files
committed
docs(ai-bridge): fix Anthropic base URL - remove /v1 suffix
Corrected Anthropic base URL configuration based on official dogfood template (commit 61fba2d): - Anthropic SDK appends /v1/messages to base URL - Therefore base URL should NOT include /v1 - Verified from dogfood/coder/main.tf which uses: ANTHROPIC_BASE_URL: "https://dev.coder.com/api/experimental/aibridge/anthropic" Final correct URLs: - OpenAI: .../openai/v1 (SDK appends /chat/completions) - Anthropic: .../anthropic (SDK appends /v1/messages) This ensures compatibility with official Anthropic Python SDK and tools like Claude Code that follow the same pattern.
1 parent 6dc050a commit 1a11811

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/ai-coder/ai-bridge.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Once Bridge is enabled and configured on the server side, you need to configure
9090
Configure your AI client to point to your Coder deployment's Bridge endpoints:
9191

9292
- **OpenAI-compatible clients**: Set `OPENAI_BASE_URL` to `https://coder.example.com/api/experimental/aibridge/openai/v1`
93-
- **Anthropic-compatible clients**: Set `ANTHROPIC_BASE_URL` to `https://coder.example.com/api/experimental/aibridge/anthropic/v1`
93+
- **Anthropic-compatible clients**: Set `ANTHROPIC_BASE_URL` to `https://coder.example.com/api/experimental/aibridge/anthropic`
9494

9595
Replace `coder.example.com` with your actual Coder deployment URL.
9696

@@ -114,7 +114,7 @@ coder tokens create
114114
Configure Claude Code to use Bridge:
115115

116116
```sh
117-
export ANTHROPIC_BASE_URL="https://coder.example.com/api/experimental/aibridge/anthropic/v1"
117+
export ANTHROPIC_BASE_URL="https://coder.example.com/api/experimental/aibridge/anthropic"
118118
export ANTHROPIC_API_KEY="your-coder-session-token"
119119
```
120120

@@ -164,7 +164,7 @@ module "claude-code" {
164164
resource "coder_env" "bridge_base_url" {
165165
agent_id = coder_agent.main.id
166166
name = "ANTHROPIC_BASE_URL"
167-
value = "${data.coder_workspace.me.access_url}/api/experimental/aibridge/anthropic/v1"
167+
value = "${data.coder_workspace.me.access_url}/api/experimental/aibridge/anthropic"
168168
}
169169
```
170170

0 commit comments

Comments
 (0)