---
title: "Claude Code uncensored model setup with a local router"
canonical: https://unrestrictable.ai/guides/claude-code
generated: 2026-11-16T02:57:37.359Z
source: https://unrestrictable.ai/guides/claude-code
base_url: https://api.unrestrictable.ai/v1
---

# Uncensored model in Claude Code through claude-code-router

Put claude-code-router between Claude Code and this OpenAI-format API: a config.json, two env vars, one test request, and the per-turn price from the catalog.

Steps checked October 26, 2026 · prices as of November 16, 2026

By the end of this page Claude Code is editing files with an uncensored build behind it. The pieces: claude-code-router from npm, one provider entry pointing at this base URL, two environment variables, and a single request that confirms the chain. Router details were read on 2026-10-19.

## What you need

- Node.js 22 or later with npm; that is the CLI’s own requirement as of 2026-10-19.
- Claude Code already installed, with `claude` on the PATH.
- An API key from the [console](https://app.unrestrictable.ai/console). The balance is prepaid and starts at $10.
- Model ids, chosen on the [models page](https://unrestrictable.ai/models) or read from `GET https://api.unrestrictable.ai/v1/models`.

## Why Claude Code needs a router here

Claude Code talks in Anthropic’s request format. Every build in this catalog answers OpenAI’s; the `wire_formats` field in `GET https://api.unrestrictable.ai/v1/catalog` says so per model. Point Claude Code straight at this API and the reply is a 400 whose message says this model is served in the openai format. In the middle sits claude-code-router: it receives Claude Code’s Anthropic-format call, forwards it to the provider you configured in the OpenAI format, and converts the response on the way back. A terminal agent that reads OpenAI-compatible providers natively, OpenCode or Kilo Code, skips the router entirely.

## Install the router

The [claude-code-router](https://github.com/musistudio/claude-code-router) project (musistudio, MIT) comes as a desktop app, an npm package and a Docker image. The npm CLI is used here, at version 3.1.3 when read on 2026-10-19.

```bash
node --version        # 22 or newer
npm install -g @musistudio/claude-code-router
ccr --help
```

## Write the provider block

In version 3.1.3 the configuration lives in a database under `~/.claude-code-router` and is edited through a browser UI. On its first start, though, it still looks for an older-style `config.json` in that folder and imports what it finds. Create the file before running `ccr serve` for the first time:

```
{
  "APIKEY": "a-client-key-you-choose",
  "HOST": "127.0.0.1",
  "PORT": 3456,
  "Providers": [
    {
      "name": "unrestrictable",
      "api_base_url": "https://api.unrestrictable.ai/v1/chat/completions",
      "api_key": "sk-unr-live-…",
      "models": ["glm-5.3-uncensored", "glm-5.3-flash-uncensored", "deepseek-v4-pro-uncensored"]
    }
  ]
}
```

- APIKEY: any string you choose the secret Claude Code presents to the router; it is not the API key
- api_base_url: https://api.unrestrictable.ai/v1/chat/completions the whole Chat Completions URL; the base alone is not enough
- api_key: sk-unr-live-… the sk-unr- key from the Unrestrictable console
- models: ids from the models page every id Claude Code is allowed to request

## Start the router and test the chain

```bash
ccr serve --no-open
curl -s http://127.0.0.1:3456/health
# {"runtimeId":"...","status":"ok","timestamp":"..."}
```

Before Claude Code enters the picture, send one Anthropic-format request through the router by hand. If it comes back, every link in the chain works:

```bash
curl -s http://127.0.0.1:3456/v1/messages \
  -H "x-api-key: a-client-key-you-choose" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model": "glm-5.3-uncensored", "max_tokens": 64, "messages": [{"role": "user", "content": "Reply with the single word ok."}]}'
```

The reply arrives in Anthropic’s response shape and names the model you requested. On the console’s usage page the request appears with its token counts and its charge.

## Connect Claude Code

Set two environment variables, then launch `claude` with one of the ids in your provider block:

```bash
export ANTHROPIC_BASE_URL="http://127.0.0.1:3456"
export ANTHROPIC_API_KEY="a-client-key-you-choose"
claude --model glm-5.3-uncensored
```

The router can also write a Claude Code profile plus a wrapper script carrying those variables, started with `ccr <profile-name>`. Web fetch and web search inside Claude Code are unaffected; the only thing redirected is the model call. To try a build before any of this setup, the [browser chat](https://unrestrictable.ai/chat) answers three turns a day free with no account.

## Price per turn

Late in a Claude Code session each turn drags a long cached prefix behind a little fresh input and a short edit. The example turn: 80,000 cached tokens, 2,000 input and 1,500 output, priced from the catalog on 2026-11-16. Where a build publishes a cached rate, its cached tokens are billed at it.

| Model | One turn |
| --- | --- |
| [GLM-5.3 Uncensored](https://unrestrictable.ai/models/glm-5.3-uncensored) | $0.0082 |
| [GLM-5.3 Flash Uncensored](https://unrestrictable.ai/models/glm-5.3-flash-uncensored) | $0.0016 |
| [DeepSeek V4 Pro Uncensored](https://unrestrictable.ai/models/deepseek-v4-pro-uncensored) | $0.02 |

| Model | Build | Input $/M | Output $/M |
| --- | --- | --- | --- |
| [GLM-5.3 Uncensored](https://unrestrictable.ai/models/glm-5.3-uncensored) glm-5.3-uncensored | Uncensored | $0.282 | $0.846 |
| [GLM-5.3 Flash Uncensored](https://unrestrictable.ai/models/glm-5.3-flash-uncensored) glm-5.3-flash-uncensored | Uncensored | $0.1053 | $0.3685 |
| [DeepSeek V4 Pro Uncensored](https://unrestrictable.ai/models/deepseek-v4-pro-uncensored) deepseek-v4-pro-uncensored | Uncensored | $0.97 | $1.94 |

Prices per million tokens, read from the live catalog on 2026-11-16.

## When it fails

- A 400 about the model being served in the openai format: Claude Code bypassed the router. Make sure `ANTHROPIC_BASE_URL` names the router’s port.
- The router answers `401`: `APIKEY` in config.json does not match `ANTHROPIC_API_KEY`.
- The API answers `401 invalid_api_key`: the provider block’s `api_key` is wrong. Paste it fresh from the console.
- `404 model_not_found`: that id is not on the models page, or not in the provider’s `models` array.
- `402 insufficient_balance`: the balance is empty. Top up in the console; nothing was charged for the call it turned away.

## Questions

### What is claude-code-router for?

Its README (read 2026-10-19) calls it a local gateway for coding agents. Claude Code posts its Anthropic-format requests to a port on your machine, and the router relays them to whichever provider and model you set up, in that provider's format. With this key, it is how an uncensored build gets inside Claude Code: these builds answer the OpenAI format, and Claude Code speaks only Anthropic's.

### How does Claude Code find the router?

Through two environment variables: ANTHROPIC_BASE_URL=http://127.0.0.1:3456, and ANTHROPIC_API_KEY set to the client key you wrote into the router config. Start claude with --model and one of the ids from your provider block.

### Can I skip the router?

Not with Claude Code, which has no OpenAI-format setting. OpenCode and Kilo Code do: both accept an OpenAI-compatible provider as-is and run these same ids with nothing in between.

### Is there a Docker option?

Yes. The repository includes a Compose file that exposes the management UI and the gateway on a single port (its Docker guide, read 2026-10-19). Provider and client key are configured the same way; Claude Code then points at the exposed port.

Every model above is on the [uncensored model list](https://unrestrictable.ai/models) with its live price per million tokens. [Per-token pricing](https://unrestrictable.ai/pricing) sets the whole catalog side by side, and the [family directory](https://unrestrictable.ai/uncensored) groups the builds by base model.

[Get a key](https://app.unrestrictable.ai/console) Prepaid from $10, no subscription.

## New models and price changes, once a month.

New uncensored builds with their prices, price moves, and what the daily model check found.
