Works with your stack.
Compatibility & Integrations
ClaudeShield is designed to work where you do. Use your favorite client, SDK, or gateway — the proxy handles auth and retries.

| Client / Gateway | Messages API | Streaming | Tool Calls | Auth | Retry Behavior |
|---|---|---|---|---|---|
Claude Code Official CLI | |||||
Anthropic API api.anthropic.com | |||||
OpenCode Terminal AI agent (SST) | |||||
AgentRouter agentrouter.org | |||||
Custom Clients Any HTTP client |
Anthropic-format clients (Messages API) get full support. OpenAI-format clients need a translation layer.
Designed for AgentRouter
Injects required headers. Handles Chinese error messages.
Minimal request rewriting
We translate just enough. Nothing more.
Streaming aware
SSE peek-stream detects errors hidden in 200 responses.
Local proxy mode
Keep traffic private. Stay in control.
OpenCode (terminal AI agent)
OpenCode works with ClaudeShield in both API formats. The proxy forwards requests as-is, and AgentRouter accepts both /v1/messages (Anthropic) and /v1/chat/completions (OpenAI-compatible). Tested and working.
Method 1 - OpenAI-compatible (recommended)
opencode.json
json
{
"provider": {
"claudeshield": {
"name": "ClaudeShield (AgentRouter)",
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "http://127.0.0.1:8787/v1",
"apiKey": "your-agentrouter-key"
},
"models": {
"claude-opus-5": { "name": "Claude Opus 5" }
}
}
}
}Uses @ai-sdk/openai-compatible - the default OpenCode provider style.
Method 2 - Anthropic Messages API
opencode.json
json
{
"provider": {
"claudeshield": {
"name": "ClaudeShield (AgentRouter)",
"npm": "@ai-sdk/anthropic",
"options": {
"baseURL": "http://127.0.0.1:8787",
"apiKey": "your-agentrouter-key"
},
"models": {
"claude-opus-5": { "name": "Claude Opus 5" }
}
}
}
}Uses @ai-sdk/anthropic for native Messages API format.
Quick alternative - Environment variables
bash
# Terminal (macOS / Linux)
export ANTHROPIC_BASE_URL=http://127.0.0.1:8787/v1
export ANTHROPIC_API_KEY=your-agentrouter-key
# PowerShell (Windows)
$env:ANTHROPIC_BASE_URL="http://127.0.0.1:8787/v1"
$env:ANTHROPIC_API_KEY="your-agentrouter-key"
# Launch
opencodeStart the proxy first
bash
python retry-proxy.py --start --upstream https://agentrouter.orgExample (Claude Code)
bash
ANTHROPIC_BASE_URL=http://127.0.0.1:8787
claude --dangerously-skip-permissionsExample (Anthropic SDK)
javascript
const client = new Anthropic({
baseURL: "http://127.0.0.1:8787",
apiKey: process.env.YOUR_API_KEY
});Example (cURL)
bash
curl http://127.0.0.1:8787/v1/messages \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-opus-5","max_tokens":64,
"messages":[{"role":"user","content":"Hello"}]}'