Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: add client configuration section and examples to AI Bridge#20340

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

Closed
matifali wants to merge6 commits intomainfromaibridge-provider-docs

Conversation

@matifali
Copy link
Member

@matifalimatifali commentedOct 16, 2025
edited
Loading

Partially written by Claude Code


Configure your AI client to point to your Coder deployment's Bridge endpoints:

-**OpenAI-compatible clients**: Set`OPENAI_BASE_URL` to`https://coder.example.com/api/v2/api/experimental/aibridge/openai/v1/`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sometimes it's just.../aibridge/openai and not.../aibrdige/openai/v1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Indeed; it depends on the client 😞


###Authentication

Instead of using provider-specific API keys (OpenAI/Anthropic keys), clients authenticate using your**Coder session token** or**API key**:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
Instead of using provider-specific API keys (OpenAI/Anthropic keys), clients authenticate usingyour**Coder session token** or**API key**:
Instead of using provider-specific API keys (OpenAI/Anthropic keys), clients authenticate usingtheir**Coder session token** or**API key**:


For the best user experience, you can pre-configure AI Bridge settings in your Coder templates so that users don't need to manually set environment variables. This is especially useful for:

-**IDE workspaces** (VS Code, Cursor, JetBrains) where AI extensions are used
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Template settings don't boil down to IDEs by default (except terminal agents likeclaude).


Configure your AI client to point to your Coder deployment's Bridge endpoints:

-**OpenAI-compatible clients**: Set`OPENAI_BASE_URL` to`https://coder.example.com/api/v2/api/experimental/aibridge/openai/v1/`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Indeed; it depends on the client 😞

)
```

###Pre-configuring in Coder Templates
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The Coder-specific use-cases should appear first.

-**Agent workspaces** where tools like Goose or Claude Code run
-**Development environments** that include AI tooling out of the box

Coder provides the[`data.coder_workspace_owner.me.session_token`](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace_owner) data source which gives you access to the workspace owner's session token. This token automatically authenticates requests through Bridge.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
Coder provides the[`data.coder_workspace_owner.me.session_token`](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace_owner) data source which gives you access to the workspace owner's session token. This tokenautomatically authenticatesrequests through Bridge.
Coder provides the[`data.coder_workspace_owner.me.session_token`](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/workspace_owner) data source which gives you access to the workspace owner's session token. This tokenis authenticated whenrequestsare routedthrough AI Bridge.


####Configuring AI Agents in Tasks

For Coder Tasks templates, you can pre-configure agents to use Bridge:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
For Coder Tasks templates, you can pre-configure agents to use Bridge:
For Coder Tasks templates, you can pre-configure agents to useAIBridge:

workdir = "/home/coder/project"
ai_prompt = data.coder_parameter.ai_prompt.value
# Use Bridge instead of direct Anthropic API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
#Use Bridge instead of direct Anthropic API
#UseAIBridge instead of direct Anthropic API

claude_api_key = data.coder_workspace_owner.me.session_token
}
resource "coder_env" "bridge_base_url" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
resource "coder_env" "bridge_base_url" {
resource "coder_env" "ai_bridge_base_url" {

@matifalimatifali marked this pull request as draftOctober 16, 2025 14:58
@matifali
Copy link
MemberAuthor

Moving to draft as I am doing a larger refactor and adding more examples for all clients we have tested.

matifaliand others added6 commitsOctober 22, 2025 10:48
- Add comprehensive Client Configuration section explaining how to set  OPENAI_BASE_URL and ANTHROPIC_BASE_URL to point to AI Bridge- Document authentication using Coder session tokens instead of provider keys- Add configuration examples for Claude Code CLI and custom scripts- Add Pre-configuring in Coder Templates subsection showing how to use  data.coder_workspace_owner.me.session_token for automatic setup- Include Terraform example for configuring AI agents in Tasks templates- Fix unbalanced code fence that was causing markdown linting errors
Corrected all AI Bridge client configuration URLs to include the /v1suffix based on source code verification:- OpenAI: /api/experimental/aibridge/openai/v1 (was missing /v1)- Anthropic: /api/experimental/aibridge/anthropic/v1 (was missing /v1)Verified from enterprise/x/aibridged/aibridged_test.go which shows:- /openai/v1/chat/completions- /anthropic/v1/messagesUpdated in all configuration examples:- Setting Base URLs section- Claude Code CLI example- Custom Python scripts example- Terraform template example
Corrected Anthropic base URL configuration based on official dogfoodtemplate (commit61fba2d):- 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 andtools like Claude Code that follow the same pattern.
Split AI Bridge documentation from single 530-line file into focused,audience-specific pages for better organization and maintainability.## Changes### Structure- Delete single-page docs/ai-coder/ai-bridge.md- Create docs/ai-coder/ai-bridge/ directory with 7 pages:  - index.md: Main overview, setup, general config, SDKs, templates  - roo-code.md: Roo Code configuration  - claude-code.md: Claude Code CLI and VSCode  - cursor.md: Cursor IDE  - github-copilot.md: GitHub Copilot (VSCode + CLI status)  - goose.md: Goose Desktop and CLI  - other-clients.md: Kilo Code and unsupported clients### Content Organization- Platform teams: Server setup in index.md- Template admins: Template patterns in index.md + client pages- End users: Client-specific configuration in dedicated pages- Developers: SDK examples in index.md### Quality Improvements- Fix all markdown linting errors (8 total)- Remove trailing spaces from all files- Fix broken internal links- Update client table with links to new pages- Use proper heading hierarchy (h4 instead of h5)- Use auto-numbering for ordered lists (1/1/1 style)### Benefits- Easier maintenance (update one client without affecting others)- Better user experience (focused guides vs scrolling large file)- Clear audience separation (platform/admin/end-user)- Improved navigation (table links to dedicated pages)
@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelOct 30, 2025
@matifali
Copy link
MemberAuthor

closing in favour of#20640

@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsNov 1, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@dannykoppingdannykoppingdannykopping left review comments

@deansheatherdeansheatherdeansheather left review comments

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@stirbystirbyAwaiting requested review from stirby

@david-fraleydavid-fraleyAwaiting requested review from david-fraley

Assignees

@matifalimatifali

Labels

staleThis issue is like stale bread.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@matifali@dannykopping@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp