CJHwong

Anthropic Proxy Litellm — Development skill for Claude Code

Development community

In-process LiteLLM proxy for Python — use as a context manager to route Anthropic API requests to any LiteLLM-supported backend.

How to install Anthropic Proxy Litellm

This entry records only its repository, not the path inside it, so there is no exact command to give. Open CJHwong/anthropic-proxy-litellm and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Anthropic Proxy Litellm does

In-process LiteLLM proxy for Python — use as a context manager to route Anthropic API requests to any LiteLLM-supported backend.

Alternatives in Development

  • Dario — A local OpenAI- and Anthropic-compatible proxy that brings your Claude Pro/Max subscription to Cursor, Cline 485 ★
  • Openclaw Billing Proxy — Route OpenClaw API requests through Claude Code subscription billing instead of Extra Usage 460 ★
  • Litellm Skills — Agent Skills for managing live LiteLLM proxy deployments — users, teams, keys, orgs, models, MCP servers, agen 99 ★

README

anthropic-proxy-litellm

In-process LiteLLM proxy for Anthropic-compatible API access to any LLM.

Wraps [LiteLLM](https://github.com/BerriAI/litellm)'s proxy server in a Python context manager (`LiteLLMProxy`), so you can spin up an Anthropic-compatible endpoint in a single `with` block — no separate process, no shell scripts, no port management.

Works with any LiteLLM-supported backend: **AWS Bedrock**, **GitHub Copilot**, **Ollama**, **OpenAI**, **Azure**, and [many more](https://docs.litellm.ai/docs/providers).

Install

uv pip install -e .

Quickstart

With Claude Agent SDK

from anthropic_proxy_litellm import LiteLLMProxy

with LiteLLMProxy(config="config.yaml", model="my-model") as proxy:
    async for msg in proxy.query("Say hello"):
        print(msg)

With Claude Code CLI

Write a script that starts the proxy and prints env vars:

# start_proxy.py
from anthropic_proxy_litellm import LiteLLMProxy

models = [
    {"model_name": "gpt-4.1", "litellm_params": {"model": "github_copilot/gpt-4.1"}},
]

with LiteLLMProxy(model_list=models, model="gpt-4.1") as proxy:
    for key, value in proxy.env.items():
        print(f"{key}={value}", flush=True)
    print("", flush=True)  # blank line = ready

    import signal, threading
    stop = threading.Event()
    signal.signal(signal.SIGTERM, lambda *_: stop.set())
    try:
        stop.wait()
    except KeyboardInterrupt:
        pass

Then drive it from a shell script:

#!/usr/bin/env bash
set -euo pipefail
PIPE=$(mktemp -u); mkfifo "$PIPE"
cleanup() { kill "$PROXY_PID" 2>/dev/null; rm -f "$PIPE"; }
trap cleanup EXIT

uv run start_proxy.py > "$PIPE" &
PROXY_PID=$!

while IFS= read -r line; do
    [ -z "$line" ] && break
    export "$line"
done < "$PIPE"

claude -p "Say hello"

See [`examples/copilot/`](examples/copilot/) for a complete working version.

API

`LiteLLMProxy`

| Parameter | Env var fallback | Description