Skip to content
Updates & support on Telegram

~/.claude-code-router/config.json

Via bridge

Claude Code against an OpenAI-compatible backend

Claude Code is built for the Anthropic wire format, not the OpenAI one. A small local bridge (claude-code-router or LiteLLM) translates its requests to this gateway — this page shows the exact config.

Base URL

https://uncensoredai.dev/v1

  1. 01

    Understand the bridge requirement

    Claude Code calls POST /v1/messages with Anthropic-shaped bodies, which this gateway does not serve — it exposes the OpenAI chat-completions format. A local translation proxy is required; pointing ANTHROPIC_BASE_URL straight at the gateway will fail.

  2. 02

    Install the router

    claude-code-router runs a local Anthropic-compatible server and forwards to any OpenAI provider.

    Install
    npm install -g @musistudio/claude-code-router
  3. 03

    Register UncensoredAI as a provider

    Add the provider to the router config. api_base_url must include the full /v1/chat/completions path because the router appends nothing.

    ~/.claude-code-router/config.json
    {
      "Providers": [
        {
          "name": "uncensoredai",
          "api_base_url": "https://uncensoredai.dev/v1/chat/completions",
          "api_key": "sk-ua-XXXX-XXXX-XXXX-XXXX",
          "models": ["deepseek-v4.1-flash", "gpt-6-sol", "glm-5.3-flash-uncensored"]
        }
      ],
      "Router": {
        "default": "uncensoredai,deepseek-v4.1-flash",
        "background": "uncensoredai,deepseek-v4.1-flash",
        "think": "uncensoredai,gpt-6-sol"
      }
    }
  4. 04

    Launch Claude Code through the router

    The router starts its local server and launches Claude Code against it. Every request bills from your UncensoredAI balance.

    Launch
    ccr code

Commands and configuration below are shown exactly as the tool expects them, so they stay in English.

FAQ

Does Claude Code work without an Anthropic API key?+

Yes, through a protocol bridge such as claude-code-router or LiteLLM configured with this gateway as the upstream OpenAI-compatible provider.

Why can't I point ANTHROPIC_BASE_URL straight at the gateway?+

Claude Code sends Anthropic-format requests to /v1/messages. This gateway serves the OpenAI format at /v1/chat/completions, so a translating proxy sits in between.

Which models work best for agentic coding?+

Use a reasoning tier for planning — gpt-6-sol or claude-sonnet-5-5 — and route background turns to deepseek-v4.1-flash. The router config above already does this.

More integrations

Claude Code Custom Backend — Route It Through a Bridge · UncensoredAI