Tool setup

Use the Claude API with LiteLLM

LiteLLM speaks to Anthropic natively and lets you override the endpoint per model, so one config line sends all your Claude traffic through the discounted gateway.

·

Direct SDK call

import litellm

response = litellm.completion(
    model="anthropic/claude-opus-4-8",
    api_base="https://api.apitoken.sale",
    api_key="sk-pool-•••",
    messages=[{"role": "user", "content": "Hello"}],
)

See also: Use the Claude API with LangChain

LiteLLM proxy config

# config.yaml
model_list:
  - model_name: claude-opus-4-8
    litellm_params:
      model: anthropic/claude-opus-4-8
      api_base: https://api.apitoken.sale
      api_key: sk-pool-•••

Run the proxy with this config and every client of your LiteLLM gateway transparently uses the discounted Claude endpoint — useful when many services share one routing layer.

Why route Claude through LiteLLM here

  • One place to switch all services to the cheaper endpoint.
  • Same anthropic/ model prefix and parameters you already use.
  • Spend tracked per key in the apiToken.sale dashboard with token detail.

Frequently asked questions

Does LiteLLM support a custom Anthropic api_base?

Yes — pass api_base in litellm.completion() or in litellm_params in the proxy config, and LiteLLM sends Anthropic-format requests to https://api.apitoken.sale.

Do I keep the anthropic/ model prefix?

Yes. Use anthropic/claude-opus-4-8 (or any supported model) so LiteLLM applies the Anthropic protocol; only the endpoint and key change.

Does this work for tools built on LiteLLM?

Yes — anything that routes through LiteLLM (including many coding agents) inherits the discounted endpoint from the same configuration.

Try it before you pay: new Google/GitHub accounts include $10 of official-price Claude usage.