tool_use / tool_result flows, reduces unnecessary premium request consumption, and enables Claude-native beta features like interleaved-thinking and advanced-tool-use that are unavailable through the plain Chat Completions path.
When to use this integration
Use this integration instead of OpenCode’s built-in Copilot provider when you want:- Anthropic Messages semantics — requests stay in the native Messages API format rather than being translated to Chat Completions
- Premium request optimizations — warmup and tool-continuation traffic is routed to a small model to avoid spending premium quota
- Claude-native beta features —
interleaved-thinking,advanced-tool-use, andcontext-managementbetas that require the Messages API path - Phase-aware
gpt-5.4commentary — the model emits a short user-facing update before tool calls so long-running actions are easier to follow
Start the proxy
Start Copilot API using the OpenCode OAuth app. This approach uses the same OAuth credentials as OpenCode’s built-in Copilot provider, which means there is no additional Terms of Service risk:Configure OpenCode
Add the following provider configuration to~/.config/opencode/opencode.json. This tells OpenCode to use the @ai-sdk/anthropic npm package as the AI SDK provider, pointing it at the local proxy:
Key configuration fields
If you configure
auth.apiKeys in config.json, replace "dummy" with one of your configured keys. Otherwise any non-empty placeholder is fine.AGENTS.md recommended content
Add the following reminders to yourAGENTS.md file. They instruct the model to use the question tool for user interactions rather than outputting free-form questions: