Skip to content

Use your coding tools with any model

Set up Claude Code, Cursor, Codex CLI, Cline, Aider and other coding tools with one Yunshu Router key. Base URLs, settings and model IDs for each tool.

Get an API key

Yunshu Router speaks the OpenAI and Anthropic APIs. Most coding tools already let you change the base URL and the key, so you can point them at Yunshu Router and pick any model in our catalogue. You pay from one prepaid balance, per token.

Each guide below gives the exact settings, a check that it works, the models we suggest, and fixes for the errors people hit most.

Before you start

  1. Create an account and add credit to your balance. Prices per token are on each model page.
  2. In the console, open API keys and create a key for this tool. The full key is shown once, so copy it then.
  3. Give agent keys a monthly budget (see Set a budget for agents).

Base URLs for each tool

The full reference is the Base URL cheat sheet. The one setting people get wrong is the base URL. Tools that speak the Anthropic API add /v1 themselves; tools that speak the OpenAI API expect you to include it.

Tool API format Base URL Where to set it
Claude Code Anthropic Messages https://api.yunshurouter.com (no /v1) ANTHROPIC_BASE_URL in ~/.claude/settings.json or your shell
Cursor OpenAI Chat Completions https://api.yunshurouter.com/v1 —
Codex CLI OpenAI Responses https://api.yunshurouter.com/v1 base_url under [model_providers.yunshu] in ~/.codex/config.toml
Cline OpenAI Chat Completions https://api.yunshurouter.com/v1 Cline settings → API Provider: OpenAI Compatible → Base URL
Roo Code OpenAI Chat Completions https://api.yunshurouter.com/v1 Roo Code settings → API Provider: OpenAI Compatible → Base URL
Kilo Code OpenAI Chat Completions https://api.yunshurouter.com/v1 Settings → Providers → Custom provider → Base URL
OpenCode OpenAI Chat Completions https://api.yunshurouter.com/v1 settings.baseURL in opencode.json
Aider OpenAI Chat Completions https://api.yunshurouter.com/v1 OPENAI_API_BASE environment variable
Continue OpenAI Chat Completions https://api.yunshurouter.com/v1 apiBase in ~/.continue/config.yaml
Zed OpenAI Chat Completions https://api.yunshurouter.com/v1 api_url under language_models.openai_compatible in Zed settings.json
Python, Node, curl OpenAI or Anthropic /v1 for OpenAI SDKs, none for Anthropic SDKs base_url / baseURL in the client

Your key goes in the tool’s API key field, or in the Authorization: Bearer header. On the Anthropic API we also accept the key in x-api-key.

Guides

Claude Code Run Anthropic’s terminal agent on DeepSeek, GLM and Kimi models. Anthropic Messages · Set up Claude Code

Cursor Use your Yunshu Router key for Cursor’s chat and agent. OpenAI Chat Completions · Set up Cursor

Codex CLI Add Yunshu Router as a model provider in OpenAI’s terminal agent. OpenAI Responses · Set up Codex CLI

Cline Pick any model for the Cline agent in VS Code. OpenAI Chat Completions · Set up Cline

Roo Code Point Roo Code’s modes at the model you choose. OpenAI Chat Completions · Set up Roo Code

Kilo Code Add Yunshu Router as a custom provider in Kilo Code. OpenAI Chat Completions · Set up Kilo Code

OpenCode Add a provider block to opencode.json and choose models with /models. OpenAI Chat Completions · Set up OpenCode

Aider Two environment variables and an openai/ model prefix. OpenAI Chat Completions · Set up Aider

Continue One model entry in config.yaml for chat, edit and apply. OpenAI Chat Completions · Set up Continue

Zed Add an OpenAI-compatible provider for the Zed agent. OpenAI Chat Completions · Set up Zed

Python, Node and curl Call Yunshu Router from your own code with the official OpenAI or Anthropic SDK. OpenAI and Anthropic · SDK quick setup

Set a budget for agents

A coding agent can send hundreds of requests in a session. Give each tool its own key and set limits on that key in the console under API keys:

  • Monthly budget. A request is refused before it could take the key past its budget for the calendar month (UTC). The tool sees an error with status 402 and code budget_exceeded.
  • Rate limit. Requests per minute for that key.
  • Model allow-list. Only the models you list can be called with that key.

Your balance is prepaid, and each request reserves its maximum price before it is sent, so several agents running at once cannot spend more than your balance. You can get an email or a webhook when a key nears its budget or your balance runs low.

Which model should I use?

For most coding agents, start with deepseek-v4-pro for everyday agent work at a low price per token. Use glm-5.3 when the task leans on agentic coding and tool use, and kimi-k3 for long tasks with many tool calls. Every model runs on the same key, so you can switch any time.

Model ID Provider Good for
deepseek-v4-pro DeepSeek Everyday agent work at a low price per token
glm-5.3 Z.ai Agentic coding and tool use
kimi-k3 Moonshot Long tasks with many tool calls

Questions

Do I need a separate key for each tool?

No, one key works in every tool. We suggest one key per tool anyway, so you can see usage per tool and set a budget for each.

Why does one tool use /v1 and another not?

Tools built on the Anthropic API (Claude Code, the Anthropic SDKs) add /v1/messages to the base URL themselves. Tools built on the OpenAI API add only /chat/completions or /responses, so the base URL must end in /v1. A wrong /v1 gives a 404.

Can I use non-Claude models in Claude Code?

Yes. Claude Code sends Anthropic Messages requests, and we serve every model in the catalogue on that API. Anthropic does not support Claude Code with other makers’ models, so some features may behave differently. See the Claude Code guide.

How do I see what a request cost?

Every request appears with its cost in the console under Usage. From code, call GET /v1/generation?id=<request id>; streamed responses carry the id in a response header.

My tool isn’t listed. Will it work?

If it lets you set an OpenAI-compatible or Anthropic-compatible base URL and key, it should. Use the base URL rule above. We support Chat Completions, Messages (with count_tokens) and Responses; tools that need embeddings, image or audio endpoints won’t work yet.