Find a model

Browse the full catalog →

AgentRun, the open-source agent platform from Parcha Labs, can send every model request through TrustedRouter. Save TrustedRouter as the server's model gateway with the address https://api.trustedrouter.com/v1, then pick a default model. The pi, Codex and OpenCode harnesses use that gateway, and so can the Claude harness, with one of the two setups below. Settings names follow AgentRun 0.4.127, as of . These steps are for an AgentRun server you run yourself, locally or self-hosted.

Why run AgentRun on TrustedRouter

AgentRun lets you change an agent's harness and model without rebuilding it. TrustedRouter gives that choice one key: 600+ models from 100+ providers, on both APIs the harnesses speak (OpenAI Responses and Anthropic Messages). You choose which providers may see a prompt: Open, ZDR or TEE privacy tiers or an EU-focused pool. Keys carry daily, weekly and monthly spend limits, which helps when agents run unattended or on a schedule.

Set it up in the console

  1. Create a key in Console → API Keys.
  2. In the AgentRun console, open Settings → Model keys and choose Use a model gateway.
  3. Enter the gateway address https://api.trustedrouter.com/v1 and your key, then choose Test. AgentRun lists the models TrustedRouter serves.
  4. Leave Model ids on As named, so model IDs such as openai/gpt-6.1-terra reach TrustedRouter whole.
  5. Pick a Default model, such as openai/gpt-6.1-terra, and choose Save. It applies at once, with no restart.

The pi, Codex and OpenCode harnesses, and any agent-model/ model, now go to TrustedRouter instead of a provider key saved in AgentRun. For the Claude harness, see below. To go back, choose Stop using it on the gateway row.

Set it up with environment variables

On a server you deploy with Docker or Render, set the gateway where AgentRun starts. These variables win over a gateway saved in the console.

AGENT_MODEL_BASE_URL=https://api.trustedrouter.com/v1
AGENT_MODEL_API_KEY=<your TrustedRouter key>
AGENT_MODEL=openai/gpt-6.1-terra

Keep the key in your host's secret settings, not in a file you commit. AgentRun sends a Claude model to https://api.trustedrouter.com/v1/messages and every other model to https://api.trustedrouter.com/v1/responses, with the key as a bearer token. TrustedRouter serves both.

Run the Claude harness

AgentRun's Claude harness (claude-agent, which runs Claude Code) uses the gateway only for the gateway's own models. To send a Claude agent through the gateway, name its model with AgentRun's gateway prefix, such as agent-model/anthropic/claude-sonnet-5.5.

If the agent names an anthropic/ model or none, the Claude harness reads its own two settings instead. Without them, AgentRun refuses the run with "claude-agent needs ANTHROPIC_API_KEY" or "No model yet for claude-agent". On a server you deploy with Docker or Render, set both where AgentRun starts. On a server from AgentRun's installer, name the model with the agent-model/ prefix instead.

ANTHROPIC_BASE_URL=https://api.trustedrouter.com
ANTHROPIC_API_KEY=<your TrustedRouter key>

The address has no /v1: Claude Code adds /v1/messages. It sends Anthropic's own model IDs, such as claude-sonnet-5-5, and TrustedRouter resolves them to the listed Claude models. See Claude Code with TrustedRouter for prices and model choices.

Which model to choose

HarnessModel IDNotes
pideepseek/deepseek-v4.1-flashRuns any model in the catalog, including the routing pools below.
Codex, OpenCodeopenai/gpt-6.1-terraUse an OpenAI model with Codex. If the gateway's default is a Claude model, set AGENT_MODEL_CODEX to give Codex its own default. OpenCode is installed separately; AgentRun lists it once it is.
Claudeanthropic/claude-sonnet-5.5Name it agent-model/anthropic/claude-sonnet-5.5, or set the two settings above.

To limit who sees a prompt, a pi agent can name a pool such as trustedrouter/zdr. Pools choose the model as well as the provider, so the answer may come from a different model family. AgentRun has no price for a pool, so leave the agent's max_cost_usd unset and put a spend limit on the key instead. AGENT_MODEL_PRICE (comma-separated USD per million tokens, input,output,cacheRead with an optional fourth cacheWrite) would also work, but it re-prices every gateway model that has no price of its own, not just the pool.

Check the key and model

AgentRun's pi, Codex and OpenCode harnesses use the Responses API. To check the key and model before saving the gateway:

curl https://api.trustedrouter.com/v1/responses \
  -H "Authorization: Bearer $TRUSTEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-6.1-terra","input":"Reply with PONG only."}'

A reply with PONG in its output means AgentRun will reach the model.

Costs and spend caps

AgentRun estimates a run's cost from its own model catalog, so its figure can differ from TrustedRouter's bill, which includes TrustedRouter's fee. Use the key's spend limits as the hard cap, and see gateway fees and a monthly workload.

Troubleshooting

  • Test lists no models or fails: check the address is https://api.trustedrouter.com/v1, with https.
  • 401 naming the key: the key is wrong or disabled. Check it in Console → API Keys.
  • "has no price here, so a run's spend cap cannot be kept on it": the model is not in AgentRun's catalog. Run without max_cost_usd and use the key's spend limit, or set AGENT_MODEL_PRICE, which prices every gateway model that has no price of its own.
  • "claude-agent needs ANTHROPIC_API_KEY" or "No model yet for claude-agent": the Claude harness isn't on a gateway model. Name an agent-model/ model, or set the two settings in Run the Claude harness where AgentRun starts.

Questions

How do I use TrustedRouter in AgentRun?

Open Settings, Model keys, and choose Use a model gateway. Enter the address https://api.trustedrouter.com/v1 and a TrustedRouter key, choose Test, pick a default model such as openai/gpt-6.1-terra, and save.

Does AgentRun's Claude harness work through TrustedRouter?

Yes. Name the model agent-model/anthropic/claude-sonnet-5.5 so it goes through the gateway, or set ANTHROPIC_BASE_URL to https://api.trustedrouter.com and ANTHROPIC_API_KEY to a TrustedRouter key where AgentRun starts.

Workspace access

Sign in

Choose a sign in method to access your TrustedRouter workspace.

New to TrustedRouter?

By continuing you agree to the terms of service and privacy policy.