Skip to content

Padwan Proxy

Padwan Proxy serves the Anthropic Messages API (/v1/messages and /v1/messages/count_tokens) on top of any OpenAI-compatible backend, so Anthropic clients such as Claude Code can use it. It is built on padwan-ai's Anthropic↔OpenAI translation layer and served by granian (RSGI) via gravier.

Claude Code running GLM 5.2 on Scaleway through padwan-proxy

Prerequisites: Python 3.13+ with uv, and an API key for an OpenAI-compatible backend that supports function calling.

Quickstart

  1. Export the backend key:

    export PADWAN_API_KEY=<YOUR_BACKEND_KEY>
    
  2. Start the proxy:

    uvx padwan-proxy --backend-url https://api.example.com/v1/ \
      -m my-model --small-model my-small-model
    

    Or with Docker:

    docker run --rm -p 4000:4000 -e PADWAN_API_KEY \
      ghcr.io/polarsen-io/padwan-proxy:latest \
      --backend-url https://api.example.com/v1/ -m my-model --small-model my-small-model
    
  3. Point the client at it:

    ANTHROPIC_BASE_URL=http://127.0.0.1:4000 ANTHROPIC_AUTH_TOKEN=dummy claude
    

Claude Code now answers with my-model. To keep model names in one place, let the proxy write the client config instead — see Claude Code.

Limitations

  • The proxy does not translate Anthropic thinking budgets; reasoning must be enabled on the backend. Models that hide their reasoning emit no thinking blocks.
  • count_tokens is an estimate (request size / 4), not a backend tokenizer count.
  • The backend context window cannot be discovered; pass it with --context-window.