Use MartLLM with CC Switch
CC Switch is a desktop app that keeps several providers for Claude Code, Codex and other coding tools and switches between them. MartLLM goes in as a Custom Configuration provider. CC Switch then writes the same settings our Claude Code and Codex CLI pages describe.
Before you start
- CC Switch installed, with Claude Code or Codex already on the computer.
- A MartLLM account with credit, and an API key from
Dashboard → Keys. Keys start with
ull_.
Claude Code
In CC Switch, select Claude Code in the sidebar and click Add Provider.
Choose Custom Configuration.
Name it
MartLLMand set the configuration to:{ "env": { "ANTHROPIC_BASE_URL": "https://api.martllm.com", "ANTHROPIC_AUTH_TOKEN": "ull_your_key" } }The address has no
/v1at the end: Claude Code adds its own path.Click Add.
On the MartLLM card, click Switch. The card shows In use.
Open a new terminal and run
claude.
With only these two values, Claude Code asks for its own Claude model names and MartLLM serves the same Claude models.
Run Claude Code on other models
To use DeepSeek, GLM, GPT or any other model, map each of Claude Code's model slots
to a MartLLM model id in the same env block:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.martllm.com",
"ANTHROPIC_AUTH_TOKEN": "ull_your_key",
"ANTHROPIC_MODEL": "deepseek/deepseek-v4-pro",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek/deepseek-v4-pro",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek/deepseek-v4-pro",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek/deepseek-v4-flash",
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek/deepseek-v4-pro"
}
}
Map every slot. A slot left unset keeps asking for a Claude model, and you pay Claude prices for it. What each variable does, and how to set the context size for models that are not Claude: Claude Code → Use other models.
Codex
In CC Switch, select Codex in the sidebar and click Add Provider.
Choose Custom Configuration and name it
MartLLM.In the
auth.jsonpart, enter your key:{ "OPENAI_API_KEY": "ull_your_key" }In the
config.tomlpart, enter:model_provider = "custom" model = "deepseek/deepseek-v4.1-flash" web_search = "disabled" [model_providers.custom] name = "custom" base_url = "https://api.martllm.com/v1" wire_api = "responses" requires_openai_auth = trueHere the address ends in
/v1: Codex adds/responses.Click Add, then Switch on the MartLLM card.
Open a new terminal and run
codexin your project.
MartLLM serves the Responses API on every chat model, so Codex connects directly and
CC Switch's local routing is not needed. Other Codex settings worth knowing
(model_context_window, model_reasoning_effort): Codex CLI.
Pick a model from the list
With the key and address filled in, the Fetch Models button next to the model
field loads MartLLM's model list (/v1/models) so you can pick an id instead of
typing it.
Import with a link
CC Switch 4.0.10 and later can add a provider from a ccswitch:// link. The link
has to carry your key, so build it yourself and do not share it. For Claude Code:
ccswitch://v1/import?resource=provider&app=claude&name=MartLLM&endpoint=https%3A%2F%2Fapi.uberllm.dev&apiKey=ull_your_key
Replace ull_your_key, paste the link into your browser's address bar, allow it to
open CC Switch, check what the confirmation shows and confirm the import.
What changes in Claude Code and Codex
CC Switch only writes the settings. What works and what does not while a tool runs on MartLLM is on the tool's own page: Claude Code, Codex CLI.
Common errors
| What you see | Cause and fix |
|---|---|
401 |
The key is missing, mistyped or deleted. Paste it again from Dashboard → Keys. |
Claude Code: 404 |
The address has /v1 at the end. For Claude Code it must be https://api.martllm.com. |
Codex: 404 |
The address has no /v1. For Codex it must be https://api.martllm.com/v1. |
404 model_not_found |
The model id is mistyped. It needs its maker in front, such as deepseek/deepseek-v4.1-flash. |
402 insufficient_credits |
Your balance is empty. Add credit under Dashboard → Credits. |
| Claude Code still asks you to log in, or uses another provider | An ANTHROPIC_* variable in your shell profile wins over the settings file. Remove it from ~/.zshrc or ~/.bashrc. |
More codes: Errors. Spend per request: Dashboard → Activity.
Support
For account, billing, API or model problems, write to [email protected].