Agent Router Base URL: Claude Code & Codex
Set the TrustedRouter base URL for Claude Code, Codex, Cursor, and OpenAI or Anthropic SDK agents. Copy env vars, smoke tests, and model aliases.Set the base URL for Claude Code, Codex, Cursor, and SDK agents.
Up to 1 million free tokens. No card required.
Python SDK choice
Recommended default: the official openai SDK with base_url="https://api.trustedrouter.com/v1". No new dependency if you already use it.
Optional typed SDK: pip install trustedrouter, then import trustedrouter. Python SDK source.
Agent router base URLs
OpenAI and Anthropic compatibleFor Codex, Cursor, eval runners, and other agents using the OpenAI SDK, set the base URL to https://api.trustedrouter.com/v1. Keep the SDK and application architecture you already use.
For Claude Code and Anthropic SDK clients, use the Anthropic-compatible base URL https://api.trustedrouter.com without /v1; clients append /v1/messages.
| Client | Base URL | Use when |
|---|---|---|
| OpenCode | https://api.trustedrouter.com/v1 | Connect TrustedRouter with /connect, then select a model with /models. See the setup guide for specific models. |
| OpenAI compatible | https://api.trustedrouter.com/v1 | Chat Completions, Responses, models, and most agents |
| Claude Code | https://api.trustedrouter.com | Set ANTHROPIC_BASE_URL to this URL and ANTHROPIC_AUTH_TOKEN to your TrustedRouter key. |
| Anthropic compatible | https://api.trustedrouter.com | Anthropic SDK Messages calls |
| EU regional | https://api-europe-west4.quillrouter.com/v1 | Europe-focused gateway and routing |
| Permanent alias | https://api.quillrouter.com/v1 | Existing integrations using the original hostname |
export TRUSTEDROUTER_API_KEY="sk-tr-v1-..."
export OPENAI_API_KEY="$TRUSTEDROUTER_API_KEY"
export OPENAI_BASE_URL="https://api.trustedrouter.com/v1"
Claude Code:
export ANTHROPIC_BASE_URL="https://api.trustedrouter.com"
export ANTHROPIC_AUTH_TOKEN="$TRUSTEDROUTER_API_KEY"
Claude Code's default model IDs are accepted for listed models that Anthropic serves directly. For any other model, set listed IDs with the anthropic/ prefix; the Claude Code guide has the lines to copy.
Anthropic SDKs:
# Anthropic SDKs use the non-/v1 base URL.
export ANTHROPIC_API_KEY="$TRUSTEDROUTER_API_KEY"
export ANTHROPIC_BASE_URL="https://api.trustedrouter.com"
This configuration follows Claude Code's published gateway documentation.
All listed TrustedRouter API hostnames terminate prompt TLS inside an attested gateway. Browse the current public catalog at /v1/models, then run the PONG check below before changing application code.
OpenAI-compatible smoke test
before editing codecurl https://api.trustedrouter.com/v1/chat/completions \
-H "Authorization: Bearer $TRUSTEDROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "trustedrouter/zdr",
"messages": [{"role": "user", "content": "Reply with PONG only."}],
"max_tokens": 4
}'
The response should contain PONG. Use this check before moving evals or production traffic.
After PONG, compare current routes on the live leaderboard and verify longer-term behavior in the monthly benchmark reports.
Model aliases
recommendedThe Anthropic Messages endpoint accepts only models the catalog marks as supporting Messages: Anthropic-published models (no TrustedRouter routing aliases are currently marked); use the OpenAI-compatible endpoints for every other model.
- trustedrouter/zdr: zero-data-retention routes first. Good default for legal and sensitive work.
- trustedrouter/e2e or trustedrouter/confidential: verified confidential compute, provider-side E2EE, and explicit ZDR on every eligible route.
- trustedrouter/eu: EU-focused routing. Use with https://api-europe-west4.quillrouter.com/v1 for the EU regional gateway.
- trustedrouter/auto: broad provider fallback when availability matters more than the strictest privacy filter.
- trustedrouter/cheap: low-cost paid route pool for cost-sensitive tests.
- trustedrouter/frontier: fixed frontier pool with ordered fallback, no synthesis, and no implicit privacy floor.
- trustedrouter/advanced: fixed advanced pool with ordered fallback, no synthesis, and no implicit privacy floor.
- trustedrouter/professional: fixed professional pool with ordered fallback, no synthesis, and no implicit privacy floor.
- trustedrouter/efficient: fixed efficient pool with ordered fallback, no synthesis, and no implicit privacy floor.
- trustedrouter/socrates: rolling named advisor model. Use trustedrouter/socrates-1.1 for the current pinned version; trustedrouter/socrates-1.0 remains available only for old pinned integrations.
- trustedrouter/subagent: primitive for OpenRouter-compatible subtask delegation. Use a concrete parent model with a trustedrouter:subagent or openrouter:subagent tool.
- trustedrouter/iris-2.0, trustedrouter/prometheus-2.0, trustedrouter/zeus-1.0: versioned budget, open, and frontier Synth presets inside the attested gateway.
- trustedrouter/openpatcher-s2: Kimi K3 and GLM 5.2 synthesis with judge and final fallbacks.
- trustedrouter/openpatcher-g2: Kimi K3 worker with parallel Gemma 4 and Prometheus 2.0 advisors.
- trustedrouter/plato-pro-2.0: GLM 5.2 worker advised by Prometheus 2.0.
- trustedrouter/iris-code-1.0, trustedrouter/prometheus-code-1.0, trustedrouter/zeus-code-1.0: versioned code-tuned Synth presets for implementation-heavy agent turns.
OpenAI-compatible app migration prompt
copyMigrate this project to TrustedRouter.
Use base_url "https://api.trustedrouter.com/v1".
Read the API key from TRUSTEDROUTER_API_KEY.
Use trustedrouter/zdr by default unless the user asks for broad fallback.
For Europe-focused workloads, use base_url "https://api-europe-west4.quillrouter.com/v1" and model trustedrouter/eu.
Use trustedrouter/prometheus-2.0 for hard prompts, evals, or synthesis where multiple model calls are worth the cost and a 1M context window matters.
Use trustedrouter/prometheus-code-1.0 for implementation-heavy agent turns.
Use trustedrouter/socrates for the current rolling advisor model, or trustedrouter/socrates-1.1 when you need the current pinned version.
Run a PONG smoke test before editing app code.
Socrates prompt
advisor orchestrationtrustedrouter/socrates is the rolling named advisor model, currently pointing at trustedrouter/socrates-1.1. The worker gets one private zero-argument tool, _trustedrouter_get_advice, and should call it only when stuck, uncertain, or facing a high-stakes decision. Use the generic trustedrouter/advisor primitive only when you provide explicit worker and advisor models yourself.
{
"model": "trustedrouter/socrates-1.1",
"messages": [{"role": "user", "content": "Review this migration plan for production risk."}],
"tools": [{
"type": "trustedrouter:advisor",
"parameters": {
"depth": 2,
"advisor_models": ["anthropic/claude-opus-4.8"],
"max_get_advice_calls": 1,
"advisor_max_tokens": 4096,
"advisor_timeout_ms": 90000
}
}]
}
The advisor sees the same prompt context as the worker. Use provider.min_privacy = "zdr" for a hard zero-retention floor or provider.min_privacy = "confidential" to require verified provider compute, E2EE and explicit ZDR together. The trustedrouter/zdr and trustedrouter/e2e aliases select those pools. If the advisor is itself a Synth model such as trustedrouter/zeus-1.0, TrustedRouter decrements orchestration depth automatically.
Subagent prompt
server tooltrustedrouter/subagent lets a parent model delegate self-contained subtasks to a worker model during the same generation. The worker sees only the task description that the parent model writes.
{
"model": "anthropic/claude-sonnet-5",
"messages": [{"role": "user", "content": "Research the options, then propose one implementation."}],
"tools": [{
"type": "openrouter:subagent",
"parameters": {
"model": "deepseek/deepseek-v4-flash",
"instructions": "Be concise. Return only useful findings.",
"max_tool_calls": 4,
"max_completion_tokens": 800
}
}]
}
The private function exposed to the parent model is _trustedrouter_subagent with task_name and task_description. Function tools inside the subagent worker are rejected; recursive subagents are blocked.
Agent skill
model advisorUse the trustedrouter-model-advisor playbook when Codex, Claude Code, Hermes, Cursor, or another coding agent needs to choose a model, estimate cost and speed, weigh privacy tiers, connect MCP, or decide whether prompt caching makes one stable model cheaper than broad routing.
# Codex native skill
Use $trustedrouter-model-advisor to choose the best TrustedRouter model for this task.
# Claude Code, Hermes, Cursor, or any agent that can read a URL
Read https://raw.githubusercontent.com/Lore-Hex/LLM-advisor/main/SKILL.md and follow it.
Consider speed, cost, AI IQ, privacy, context length, prompt caching, and recent provider health before making calls.
Skill source: GitHub folder. Raw instructions for any agent: SKILL.md.
Synth prompt
hard promptsFor a hard prompt, use model trustedrouter/synth.
Attach one tool:
{
"type": "trustedrouter:synth",
"parameters": {
"preset": "quality",
"selection_strategy": "synthesize_non_refusals",
"fallback_judges": ["~anthropic/claude-latest", "~google/gemini-pro-latest", "~zai/glm-latest"],
"fallback_final_models": ["~anthropic/claude-latest", "~google/gemini-pro-latest", "~kimi/latest"],
"max_completion_tokens": 800
}
}
Read the full behavior at https://trustedrouter.com/docs/synth.
Useful references
Agents should read the compact context first, then use the full context when choosing models or providers.
See DeepSeek in OpenCode and cut LLM API costs for setup and savings examples.
Put these guides into practice
Choose a route, check its privacy requirements, and test it with your own workload.
- DeepSeek API privacy
- OpenRouter alternatives
- Choose an LLM router
- Set up an agent
- Model origin and US providers
- Uncensored DeepSeek for cyberdefense
- How to evaluate a private DeepSeek API
- How to choose an LLM API for agents
Sign up today and start with up to 1 million free tokens. No card required. Eligible new email or social signups receive starter credit for their first workspace; token volume depends on model pricing and input/output usage. Wallet-only signups and additional workspaces do not receive this grant.
Questions
What base URL should an OpenAI-compatible agent use?
Use https://api.trustedrouter.com/v1. Keep the OpenAI SDK and set OPENAI_API_KEY to your TrustedRouter key. The older https://api.quillrouter.com/v1 hostname remains a permanent working alias.
What base URL should an Anthropic-compatible agent use?
Use https://api.trustedrouter.com without /v1, and set ANTHROPIC_API_KEY to your TrustedRouter key. Anthropic SDKs append their own Messages API path.
What is the EU agent router base URL?
Use https://api-europe-west4.quillrouter.com/v1 for OpenAI-compatible requests and choose trustedrouter/eu for EU-focused routing. Add provider.only when your policy requires a strict provider allowlist.