The provider thatforgets every diff.
Private coding models forOpenCode.
Setup walkthrough
Video coming soon
Built for agents,
private by default
One provider, the whole catalog
OpenCode already speaks the OpenAI API, so one provider entry and one key reach every tool-calling model here, from open-weight coders to the frontier names you know.
Do you keep my code?
Not on the router. Your files, diffs, and prompts pass through AnonRouter in memory and are never written to disk, and on a Private route like this one the provider keeps nothing once the reply is sent.
No code logs on our side
Every request is forwarded in memory and billing is settled from token counts, so your source never sits in a log here to leak, sell, or train on.
STEP 01
Create an API key
Sign up or sign in, open API keys, and create a key with OpenAI-compatible access ticked. OpenCode sends the same key with every request, and that box is what lets it through. Give it a credit limit too: an agent can make a lot of requests on its own. The key starts with ar_ and is shown once.

STEP 02
Choose your models
Tick as many as you like. Each one goes into OpenCode's model list, and /models switches between them. Every model here can call tools, which is how OpenCode edits files and runs commands.
Recommended for coding
1 selected
Where a card names a provider, its label and price are that default route; otherwise the label is the least private route a message could take. The router tries the most private route first, and a minimum privacy level in your privacy settings stops it falling back below that. Private routes keep nothing after the request; on Anonymous routes the provider sees the prompt but not who sent it.
STEP 03
Copy your config
One file declares AnonRouter as a provider with the models you picked. It holds no key, so it is safe to commit; the key goes into OpenCode itself in the next step.
{ "$schema": "https://opencode.ai/config.json", "provider": { "anonrouter": { "npm": "@ai-sdk/openai-compatible", "name": "AnonRouter", "options": { "baseURL": "https://api.anonrouter.ai/v1" }, "models": {} } }}STEP 04
Connect in OpenCode
The rest happens in your terminal. /connect stores the key in OpenCode's own credential file, outside your project, so it never ends up in a commit.
- Install OpenCode:
curl -fsSL https://opencode.ai/install | bashOr npm i -g opencode-ai, or brew install anomalyco/tap/opencode. Skip this if you have it. - Save the config as opencode.json in your projectOr in ~/.config/opencode/ to use AnonRouter in every project.
- Run opencode, then /connect
- Choose Other, enter anonrouter, and paste your keyThe id has to match the provider in the config.
- Run /models to switch between the models you choseThe first one in the config is already the default.
Or hand the whole thing to your agent
One prompt carries the entire setup. Give it to your agent, review what it configures, and you are done.
OR WITH AN ENVIRONMENT VARIABLE
Running headless, or in CI?
Point the config at an environment variable instead of using /connect, not alongside it: if the variable is unset, OpenCode sends an empty key that overrides the one /connect saved.
OpenCode sends the same key with every message, so these requests use the compatibility broker: the key is checked, a single-use ticket is minted in memory, and the request is forwarded with metadata-only logging. AnonRouter still logs none of your messages, but this flow is not unlinkable the way the ticket flow is. Read the docs
Why AnonRouter
OpenCode sends your code with every request. We keep none of it.
A coding agent ships files, diffs, and shell output with every request. AnonRouter forwards it all in memory and settles billing from usage metadata alone.
No code logs
Prompts, diffs, files, and responses pass through in memory and are never written to disk. There is no request history on our side to leak, sell, or train on.
Labeled privacy
Every route is labeled with the guarantee it actually provides, so you can keep a private repository on Private routes.
A cap per key
Prepaid credits and a credit limit on each key, so an agent stuck in a loop stops at the cap instead of draining your balance.
Troubleshooting
If a message fails
Most provider errors come with a status code. Match it below, or read the full OpenCode guide in the docs.
Key not accepted
The key is missing, mistyped, or revoked. Run /connect again, choose Other, enter anonrouter, and paste the whole key, starting with ar_.
Compatibility is off
This key does not have OpenAI-compatible access. Turn it on for the key in API keys, or create a new key with it ticked.
AnonRouter missing from /models
The provider id in /connect and the key under provider in opencode.json both have to be anonrouter. Restart OpenCode after editing the config.
Wrong URL or model
baseURL has to be https://api.anonrouter.ai/v1; OpenCode adds /chat/completions itself. Model keys have to be exact ids from this page.
Works in one shell, not another
If the config uses {env:ANONROUTER_API_KEY} and the variable is unset, OpenCode sends an empty key that overrides /connect. Set it, or remove apiKey.
Out of credits
Your balance is empty, or the key hit its credit limit. Top up from the dashboard, raise the key's limit, or switch to a cheaper model.
OpenCode questions
Your code is not our business.
AnonRouter is an independent service and is not affiliated with OpenCode.

