Home / Learn / Using LiteLLM with a Claude Key
Using LiteLLM with a Claude Key — LiteLLM Guide

Using LiteLLM with a Claude Key

LiteLLM gives all your apps one OpenAI-compatible endpoint, and a purchased Claude key is all it needs upstream — no Anthropic account. Buy a key, drop it into config.yaml, and every app behind LiteLLM can call Claude.

Buy a key, configure model_list

Get a key on ClaudeAPIKey.dev. In config.yaml, add a model_list entry where litellm_params.model carries a prefix — openai/<model> for the OpenAI-compatible surface (api_base with /v1) or anthropic/<model> for native Messages.

Set api_base to the gateway and api_key via os.environ/<VAR>. Start with litellm --config config.yaml.

The suffix gotcha

anthropic/<model> auto-appends /v1/messages to the root api_base; disable with LITELLM_ANTHROPIC_DISABLE_URL_SUFFIX=true for custom paths. openai/<model> appends /chat/completions to a /v1 base. Mismatch the prefix and you get 400s.

The client-facing model_name stays whatever your apps already use.

Why route a bought key through LiteLLM

One purchased key behind LiteLLM serves every app, script, and teammate through a single endpoint — no per-app Anthropic accounts. Pay as you go and top up with card or crypto.

It's the 'litellm claude code proxy' pattern: Claude Code and other tools target LiteLLM, which routes to your Claude key.

One endpoint, many apps

Swap upstream models or keys in config.yaml without touching clients, and keep unified logging and fallbacks across everything.

New accounts get a free credit to validate the proxy before scaling.

# config.yaml
model_list:
  - model_name: claude-sonnet-4-5
    litellm_params:
      model: openai/claude-sonnet-4-5
      api_base: https://claudeapikey.dev/v1
      api_key: os.environ/AIPRIME_KEY
# litellm --config config.yaml

Frequently asked questions

How do I use a Claude key with LiteLLM?
Buy a key on ClaudeAPIKey.dev, add a model_list entry with model: openai/claude-sonnet-4-5, api_base {SITE}/v1, and api_key via os.environ.
openai/ or anthropic/ prefix?
openai/ for the OpenAI-compatible surface (base with /v1); anthropic/ for native Messages (root + /v1/messages).
Stop LiteLLM appending /v1/messages?
Set LITELLM_ANTHROPIC_DISABLE_URL_SUFFIX=true and give the full path.
Do I need an Anthropic account?
No — a purchased gateway key works. New accounts get a free credit to test.
Start using Claude in minutes

Get an API key — no Anthropic account or waitlist required.

Get your API key

AI Prime Tech is an independent API gateway. It is not affiliated with, endorsed by, or a reseller of Anthropic. Claude and related model names are trademarks of their respective owners.

More Claude API guides

How to Get a Claude API KeyClaude API Pricing, ExplainedThe Cheapest Way to Use the Claude APIUnlimited Cursor with the Claude APIUnlimited Claude Code AccessClaude API Gateway vs. Anthropic DirectUsing Claude Through an OpenAI-Compatible APIClaude Models ComparedWhat 'Unlimited' Claude API Access MeansPaying for the Claude API with CryptoClaude API Access Without a WaitlistHow to Reduce Claude Token UsageUnlimited Cline with the Claude APIUnlimited Roo Code with the Claude APIUnlimited Claude in JetBrains IDEsUnlimited Aider with the Claude APIUnlimited Claude in VS CodeUnlimited OpenCode with the Claude APIRunning an Unlimited Hermes Agent on ClaudeRunning Unlimited OpenClaw on ClaudeWhat an Anthropic-Compatible API MeansClaude Code API Key — How to Get and Set UpClaude Code API Costs — Pricing and How to Cut ThemClaude API Errors — Rate Limits, 400, 500, 529 FixesHow to Buy Claude API CreditsUnlimited Claude Usage — Plans and PricingUnlimited Claude Opus 4.8 AccessClaude API Free Trial — Get $5 Free CreditClaude API vs Claude Pro/Max Subscription — Which to ChooseUnlimited Claude Code Usage — No Token LimitsHow to Get Unlimited Claude UsageHow to Get an Unlimited Claude API KeyUsing Claude in CodexConnecting Claude to n8nUsing Claude in Kilo CodeClaude in GitHub Copilot — No Anthropic Account NeededClaude in Zed — Instant Key, No WaitlistClaude in Cherry Studio — Buy a Key, Start ChattingClaude in LangChain — Just Add a KeyFactory Droid on Claude — No Anthropic Account