All integrations

Run Claude Code on GLM, Kimi, DeepSeek, Qwen or MiniMax

Claude Code talks to any endpoint that speaks the Anthropic Messages API. Point ANTHROPIC_BASE_URL at A2Agent and the CLI keeps working while the requests go to a Chinese frontier model at 10-50% below its official list price.

Setup

  1. 1

    Create an API key

    Sign up, open the dashboard and create a key. New accounts get trial credit, so you can finish this guide without topping up.

  2. 2

    Point Claude Code at the gateway

    Claude Code reads both variables on start-up. Set them in your shell profile so every session picks them up.

    export ANTHROPIC_BASE_URL="https://a2agent.me"
    export ANTHROPIC_AUTH_TOKEN="sk-your-a2agent-key"
    
    claude
  3. 3

    Verify the endpoint answers

    The gateway serves the Anthropic Messages API at /v1/messages. A direct call confirms the key and the model before you start a session.

    curl https://a2agent.me/v1/messages \
      -H "content-type: application/json" \
      -H "x-api-key: sk-your-a2agent-key" \
      -H "anthropic-version: 2023-06-01" \
      -d '{
        "model": "glm-5.2",
        "max_tokens": 64,
        "messages": [{"role": "user", "content": "Reply with OK"}]
      }'

What differs from the official endpoint

Token counting returns 404, and that is expected

POST /v1/messages/count_tokens answers 404 with {"type":"error","error":{"type":"not_found_error","message":"Token counting is not supported for this platform"}} whenever the key resolves to an OpenAI-compatible group. Every model sold here is on such a platform (GLM, Kimi, DeepSeek, Qwen, MiniMax), so this endpoint is never available in practice. Claude Code degrades to its own estimate and keeps working; treat the 404 in your logs as normal rather than a broken key.

One key, routed by the model you ask for

The gateway picks the upstream group from the model name on each request, then serves /v1/messages through the Anthropic path or the OpenAI-compatible path accordingly. You do not configure a platform anywhere in Claude Code — switching from glm-5.2 to kimi-k2.6 is a model-name change and nothing else.

A key with no group assigned is rejected up front

Every /v1 route sits behind a group check that answers in Anthropic error format, so an unassigned key fails with a structured error instead of a confusing upstream message. If Claude Code reports an auth-shaped failure right after setup, check the key's group in the dashboard first.

The operator can pin a Claude Code version range

The gateway reads the CLI version out of the User-Agent and can enforce a minimum and maximum. Outside the range it returns 400 with an explicit "npm update -g @anthropic-ai/claude-code" message. count_tokens is exempt from this check. Nothing is enforced unless the operator sets bounds.

Models worth starting with

Any model in the catalogue works through this client. These are the ones with a full page covering pricing, context window and setup.

Questions

Do I need to change anything inside Claude Code itself?

No. Two environment variables are the whole configuration. Claude Code keeps its own prompts, tools and session handling.

Which models can I use?

Any model in the public catalogue: the GLM, Kimi, DeepSeek, Qwen and MiniMax families. Pass the model id exactly as it appears on the models page — ids are case-sensitive.

Why does my log show a 404 on count_tokens?

Token counting is not offered on OpenAI-compatible upstreams, which is every platform sold here. The 404 is the documented answer, not a failure. Claude Code falls back to estimating tokens locally.

Is there a monthly fee or a minimum spend?

No. Billing is per token against your balance, credits do not expire, and new accounts start with trial credit so no card is needed to try it.

Can I keep using the official Anthropic models too?

Yes, by unsetting ANTHROPIC_BASE_URL. The variable is what redirects the CLI, so removing it puts Claude Code back on its default endpoint.

Trial credit on sign-up, billed per token, no minimum spend.