---
title: "Claude Code with an uncensored model: ANTHROPIC_BASE_URL setup"
canonical: https://uncensoredllm.ai/guides/claude-code
generated: 2026-11-25T11:12:11.015Z
source: https://uncensoredllm.ai/guides/claude-code
base_url: https://api.uncensoredllm.ai/v1
---

# Claude Code with an uncensored model

Run an uncensored build inside Claude Code with no proxy: ANTHROPIC_BASE_URL on the Anthropic-compatible base URL, the key as ANTHROPIC_AUTH_TOKEN, two model ids priced from the live catalog. claude-code-router as the optional path.

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

### Claude Code works with UncensoredLLM

```
Base URL  https://api.uncensoredllm.ai
API key   sk-ullm-live-…
Model     glm-5.3-uncensored
```

glm-5.3-uncensored: $0.3243 in, $0.9729 out per million tokens.

- OpenAI-compatible base URL: https://api.uncensoredllm.ai/v1
- Anthropic-compatible base URL: https://api.uncensoredllm.ai
- API key: sk-ullm-… [from the console](https://app.uncensoredllm.ai/console)

| Use | Recommended model id | Input $/M | Output $/M | Context |
| --- | --- | --- | --- | --- |
| Coding | [`glm-5.3-uncensored`](https://uncensoredllm.ai/models/glm-5.3-uncensored) | $0.3243 | $0.9729 | n/a |
| General | [`glm-5.3-flash-uncensored`](https://uncensoredllm.ai/models/glm-5.3-flash-uncensored) | $0.1211 | $0.4238 | n/a |
| Long context | [`mimo-v2.6-pro-uncensored`](https://uncensoredllm.ai/models/mimo-v2.6-pro-uncensored) | $1.4768 | $2.9537 | 1M |

Per million tokens, live catalog of 2026-11-25. Every id and price: [pricing](https://uncensoredllm.ai/pricing).

**Set up Claude Code in 5 steps**

1. Create a key in the [console](https://app.uncensoredllm.ai/console).
2. Set `ANTHROPIC_BASE_URL` to `https://api.uncensoredllm.ai`.
3. Set `ANTHROPIC_AUTH_TOKEN` to the key.
4. Set `ANTHROPIC_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL` to ids from the table.
5. Run `claude` in your project.

```bash
export ANTHROPIC_BASE_URL="https://api.uncensoredllm.ai"
export ANTHROPIC_AUTH_TOKEN="sk-ullm-live-…"
export ANTHROPIC_MODEL="glm-5.3-uncensored"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-5.3-flash-uncensored"
claude
```

Claude Code settings checked 2026-11-21 against its docs: [code.claude.com/docs/en/llm-gateway-connect](https://code.claude.com/docs/en/llm-gateway-connect), [code.claude.com/docs/en/env-vars](https://code.claude.com/docs/en/env-vars), [code.claude.com/docs/en/model-config](https://code.claude.com/docs/en/model-config). All clients: [integrations](https://uncensoredllm.ai/integrations).

Claude Code connects straight to the Anthropic-compatible base URL: four environment variables and one check request. claude-code-router is covered further down for mixing providers; its facts were read on 2026-10-19.

## Direct connection

Every chat model here answers Anthropic’s Messages API at `https://api.uncensoredllm.ai/v1/messages`, so Claude Code needs no proxy: point `ANTHROPIC_BASE_URL` at `https://api.uncensoredllm.ai` (no `/v1`; Claude Code adds the path) and pass the key as `ANTHROPIC_AUTH_TOKEN`.

- ANTHROPIC_BASE_URL: https://api.uncensoredllm.ai where Claude Code sends its Messages requests
- ANTHROPIC_AUTH_TOKEN: sk-ullm-live-… your UncensoredLLM key, sent as a Bearer header
- ANTHROPIC_MODEL: glm-5.3-uncensored the main model; /model switches it in a session
- ANTHROPIC_DEFAULT_HAIKU_MODEL: glm-5.3-flash-uncensored the model Claude Code uses for background tasks

Check the key and the id before starting Claude Code:

```bash
curl -s https://api.uncensoredllm.ai/v1/messages \
  -H "Authorization: Bearer sk-ullm-live-…" \
  -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."}]}'
```

## Optional: claude-code-router

The router is only needed to mix providers per task or to rewrite requests. Claude Code Router takes the Anthropic-format request from Claude Code and re-sends it in the OpenAI format to the provider you name, then translates the answer back. The next five sections set it up; skip them for the direct connection.

## Prerequisites

- Node.js 22 or newer and npm (the CLI’s requirement, read 2026-10-19).
- Claude Code installed; `claude` on your PATH.
- A key from the [console](https://app.uncensoredllm.ai/console), prepaid from $3.
- The ids you want, from the [models page](https://uncensoredllm.ai/models) or `GET https://api.uncensoredllm.ai/v1/models`.

## Install claude-code-router

[claude-code-router](https://github.com/musistudio/claude-code-router) (musistudio, MIT) ships as a desktop app, an npm CLI and a Docker image. This guide uses the npm CLI, version 3.1.3 on 2026-10-19.

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

## One provider block

Version 3.1.3 keeps its configuration in a database under `~/.claude-code-router` and edits it in the browser UI, but it reads an older-style `config.json` from that folder once on first start and imports it. Write this file before the first `ccr serve`:

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

- APIKEY: any string you choose what Claude Code sends the router; not your API key
- api_base_url: https://api.uncensoredllm.ai/v1/chat/completions the full Chat Completions path, not just the base
- api_key: sk-ullm-live-… your UncensoredLLM key
- models: ids from the models page the ones Claude Code may ask for

## Start it and check it

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

One Anthropic-format request through the router proves the whole chain before Claude Code is involved:

```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 answer comes back in Anthropic’s shape with the model id you asked for. The request shows on the console’s usage page with its tokens and charge.

## Point Claude Code at the router

Two environment variables, then run `claude` with an id from the 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 also generates a Claude Code profile and a wrapper script that sets the same variables; `ccr <profile-name>` launches it. Claude Code’s own web fetch and search tools keep working: only the model request changes where it goes.

## What a turn costs

A Claude Code turn late in a session carries a long cached prefix, a little new input and a short edit: 80,000 cached, 2,000 input and 1,500 output tokens here, at the catalog prices on 2026-11-25. Cached tokens bill at the build’s cached rate where it has one.

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

Detected refusals and invalid non-streamed JSON qualify for automatic refunds within the daily cap. [Verify your receipt](https://uncensoredllm.ai/statements/verify).

| Model | Build | Input $/M | Output $/M |
| --- | --- | --- | --- |
| [GLM-5.3 Uncensored](https://uncensoredllm.ai/models/glm-5.3-uncensored) glm-5.3-uncensored | Uncensored | $0.3243 | $0.9729 |
| [GLM-5.3 Flash Uncensored](https://uncensoredllm.ai/models/glm-5.3-flash-uncensored) glm-5.3-flash-uncensored | Uncensored | $0.1211 | $0.4238 |
| [DeepSeek V4 Pro Uncensored](https://uncensoredllm.ai/models/deepseek-v4-pro-uncensored) deepseek-v4-pro-uncensored | Uncensored | $0.94 | $1.88 |

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

## Errors and fixes

- Direct: a 404 on `/v1/v1/messages`: `ANTHROPIC_BASE_URL` ends in `/v1`. Set it to `https://api.uncensoredllm.ai`.
- Router only: `401` from the router: the `APIKEY` in config.json and `ANTHROPIC_API_KEY` differ.
- `401 invalid_api_key` from the API: the key is wrong (`ANTHROPIC_AUTH_TOKEN` direct, `api_key` in the provider block through the router). Copy it again from the console.
- `404 model_not_found`: the id is not on the models page, or, through the router, not in the provider’s `models` list.
- `402 insufficient_balance`: top up in the console; a refused request is not charged.

## Questions

### What does a Claude Code router do?

Claude Code Router is a local gateway for coding agents (its README, read 2026-10-19): Claude Code sends its Anthropic-format requests to a local port, and the router forwards them to the provider and model you configured, in that provider's own format. On this key it is optional: every model answers the Anthropic Messages format directly, so ANTHROPIC_BASE_URL=https://api.uncensoredllm.ai is enough.

### How do I connect the router to Claude Code?

Two environment variables point Claude Code at the local gateway: ANTHROPIC_BASE_URL=http://127.0.0.1:3456 and ANTHROPIC_API_KEY set to the client key you chose in the router. Then run claude with --model and an id from your provider block.

### Does Claude Code need a router for these models?

No. Set ANTHROPIC_BASE_URL to https://api.uncensoredllm.ai and ANTHROPIC_AUTH_TOKEN to your key; every chat model answers /v1/messages. OpenCode and Kilo Code run the same ids over the OpenAI format.

### Does the router run in Docker?

Yes: the repository ships a Compose file that publishes the management UI and the gateway through one port (its Docker guide, read 2026-10-19). The provider and client key are set the same way; point Claude Code at the published port.

Named here, at today’s prices:

- [GLM-5.3 Uncensored](https://uncensoredllm.ai/models/glm-5.3-uncensored), $0.9729 per M output, [GLM family](https://uncensoredllm.ai/uncensored/glm)
- [DeepSeek V4 Pro Uncensored](https://uncensoredllm.ai/models/deepseek-v4-pro-uncensored), $1.88 per M output, [DeepSeek family](https://uncensoredllm.ai/uncensored/deepseek)
- [GLM-5.3 Flash Uncensored](https://uncensoredllm.ai/models/glm-5.3-flash-uncensored), $0.4238 per M output, [GLM family](https://uncensoredllm.ai/uncensored/glm)

[Get a key](https://app.uncensoredllm.ai/console) Prepaid from $3, 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.
