Integrations

Claude Code

Use Qubrid open-source models with Claude Code through an API translation proxy

Claude Code is Anthropic's agentic coding CLI. It edits files, runs shell commands, and uses tools to complete multi-step development tasks.

Qubrid serverless endpoints are OpenAI-compatible (/v1/chat/completions). Claude Code speaks the Anthropic Messages API (/v1/messages). You cannot point Claude Code directly at Qubrid-you need a small translation proxy in the middle.

This guide walks through that setup end to end so you can run Qubrid OSS models (for example GPT OSS 120B or Qwen3 Coder) from Claude Code.

Prerequisites:

How it works

Claude Code  →  Translation proxy  →  Qubrid API
               /v1/messages            /v1/chat/completions
  1. Claude Code sends Anthropic-format requests to the proxy.
  2. The proxy converts them to OpenAI-format chat completions.
  3. Qubrid runs your chosen OSS model and returns the response.
  4. The proxy converts the response back to Anthropic format for Claude Code.

Claude Code relies heavily on tool calling (function use). Pick a model that supports tools on Qubrid-agentic coding models such as GPT OSS 120B and Qwen3 Coder are good starting points.

Install Claude Code

Claude Code supports a native installer, Homebrew, and npm. See the Claude Code installation docs for all options.

Native install (recommended):

curl -fsSL https://claude.ai/install.sh | bash

Homebrew (macOS):

brew install --cask claude-code

After installation, open a terminal in your project and run:

claude

You do not need an Anthropic subscription for this guide-the proxy routes requests to Qubrid instead of api.anthropic.com.

Verify Qubrid works

Before configuring the proxy, confirm your Qubrid API key and model ID work.

Set your API key

export QUBRID_API_KEY="your-qubrid-api-key"

Send a test request

Replace the model ID with the one from your model page on the platform.

curl -s https://platform.qubrid.com/v1/chat/completions \
  -H "Authorization: Bearer $QUBRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-oss-120b",
    "messages": [{"role": "user", "content": "Say hi in one sentence."}],
    "max_tokens": 50
  }'

You should receive a JSON response with a choices array and assistant content.

Model IDs are case-sensitive and include the provider prefix (for example openai/ or Qwen/). Copy the ID from the model page or AI Playground-do not type it manually.

Set up the translation proxy

Choose one of the options below. Option A is the fastest way to get started. Option B is better for teams that want centralized routing, logging, or multiple model aliases.

claude-code-proxy is a lightweight proxy that converts Claude Code's Anthropic requests to OpenAI-compatible calls.

Clone and install

git clone https://github.com/fuergaosi233/claude-code-proxy.git
cd claude-code-proxy
pip install -r requirements.txt

Create a .env file

Copy the example and edit it:

cp .env.example .env

Add your Qubrid configuration:

# Qubrid credentials
OPENAI_API_KEY="your-qubrid-api-key"
OPENAI_BASE_URL="https://platform.qubrid.com/v1"
 
# Map Claude Code model tiers to Qubrid OSS models
BIG_MODEL="openai/gpt-oss-120b"
MIDDLE_MODEL="openai/gpt-oss-120b"
SMALL_MODEL="Qwen/Qwen3-Coder-Next"
 
# Proxy listens on port 8082 by default
HOST="127.0.0.1"
PORT="8082"
Claude Code tierProxy variableExample Qubrid model
Opus (heavy tasks)BIG_MODELopenai/gpt-oss-120b
Sonnet (default)MIDDLE_MODELopenai/gpt-oss-120b
Haiku (lighter tasks)SMALL_MODELQwen/Qwen3-Coder-Next

You can point all three variables at the same model if you prefer a single OSS model for every request.

Start the proxy

python start_proxy.py

Leave this terminal running. The proxy listens at http://localhost:8082 by default.

Option B: LiteLLM (teams and gateways)

LiteLLM is a gateway Anthropic documents for enterprise Claude Code deployments. It can route Claude model names to Qubrid OSS models.

Only install LiteLLM from trusted, current PyPI releases. If you use a compromised version, rotate any credentials that were on that machine.

Install LiteLLM

pip install litellm

Create config.yaml

model_list:
  - model_name: claude-sonnet-4-6
    litellm_params:
      model: openai/openai/gpt-oss-120b
      api_base: https://platform.qubrid.com/v1
      api_key: os.environ/QUBRID_API_KEY
 
  - model_name: claude-haiku-4-5
    litellm_params:
      model: openai/Qwen/Qwen3-Coder-Next
      api_base: https://platform.qubrid.com/v1
      api_key: os.environ/QUBRID_API_KEY

model_name is what Claude Code sends. litellm_params.model is the Qubrid model ID prefixed with openai/.

Start the gateway

export QUBRID_API_KEY="your-qubrid-api-key"
litellm --config config.yaml --port 4000

LiteLLM exposes an Anthropic-compatible endpoint at http://localhost:4000.

Configure Claude Code

Point Claude Code at your local proxy instead of Anthropic's API.

Create or edit settings

Create ~/.claude/settings.json for global use, or .claude/settings.json in a project for repo-specific config.

Using claude-code-proxy (Option A):

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:8082",
    "ANTHROPIC_API_KEY": "any-value",
    "DISABLE_TELEMETRY": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "ENABLE_TOOL_SEARCH": "false"
  }
}

If you set ANTHROPIC_API_KEY in the proxy's .env, use the same value in Claude Code settings.

Using LiteLLM (Option B):

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:4000",
    "ANTHROPIC_AUTH_TOKEN": "sk-litellm-static-key",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5",
    "DISABLE_TELEMETRY": "1"
  }
}

Set ANTHROPIC_AUTH_TOKEN to whatever API key your LiteLLM deployment expects.

Start Claude Code

Open a new terminal (with the proxy still running):

cd your-project
claude

Inside Claude Code, run /status to confirm ANTHROPIC_BASE_URL points at your proxy.

Send a test prompt

Try a simple task:

Explain what this repository does in three bullet points.

If setup is correct, Claude Code sends requests through the proxy to Qubrid and you see a response.

These models on Qubrid are well suited to agentic coding workflows:

Model IDBest for
openai/gpt-oss-120bGeneral coding, reasoning, and long agentic tasks
Qwen/Qwen3-Coder-NextCost-effective coding agents and tool use
Qwen/Qwen3-Coder-PlusLarger coder model for complex refactors
moonshotai/Kimi-K2.7-CodeMoonshot coding model with long context

Copy the exact model ID from the AI Playground or the model detail page.

Verify the full stack

Run these checks if something does not work.

1. Qubrid responds directly (see Verify Qubrid works above).

2. Proxy responds to Anthropic-format requests:

curl -s http://localhost:8082/v1/messages \
  -H "x-api-key: test" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 30,
    "messages": [{"role": "user", "content": "Say hi"}]
  }'

3. Claude Code sees the proxy:

/status

4. Usage appears on Qubrid:

Open Inference Logs after a Claude Code session to confirm requests reached Qubrid.

Things you can do with Claude Code + Qubrid

Once setup is complete, try these workflows:

  • Explore a codebase - Ask Claude Code to summarize architecture, find entry points, or trace how a feature works.
  • Fix bugs - Paste an error or describe a symptom; Claude Code can search the repo and propose a fix.
  • Write tests - claude "write tests for the auth module, run them, and fix failures".
  • Refactor safely - Describe the change you want across multiple files and review the diffs before accepting.
  • Automate chores - Lint fixes, dependency updates, commit messages, and small PR prep.

For more commands and flags, see the Claude Code documentation.

Monitor usage on Qubrid

Keep an eye on your usage and costs on the Qubrid platform.

  • Review Inference Logs to see request history and debug issues.
  • Check your credit balance before long agentic sessions-Claude Code can send many requests per task.
  • Rotate API keys if you suspect a key was exposed.

Configuration reference

SettingValue
Qubrid API base URLhttps://platform.qubrid.com/v1
Qubrid API keyYour Qubrid API key (used by the proxy, not Anthropic)
Proxy URL (claude-code-proxy)http://localhost:8082
Proxy URL (LiteLLM)http://localhost:4000
Claude Code env varANTHROPIC_BASE_URL → proxy URL above
Example OSS modelopenai/gpt-oss-120b

Claude Code's built-in model discovery (CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY) only lists models whose IDs start with claude or anthropic. Qubrid OSS model IDs will not appear in /model automatically-use the proxy's model mapping (BIG_MODEL, LiteLLM model_list, etc.) instead.

Frequently Asked Questions (FAQ)

Claude Code documentation

Official docs for installation, settings, MCP, hooks, and the CLI reference