BeefAPI Get started

Claude Code.
Two variables.

Claude Code reaches an Anthropic-compatible gateway through environment variables. BeefAPI is that gateway; the two values below are the whole change.

ANTHROPIC BASE URL · AUTH TOKEN · NO /V1

CLAUDE CODE SETUP

BEEFAPI
CLIENT GUIDE

How do I point Claude Code at BeefAPI?

Before you start

  • Install Claude Code.
  • Create a global key in API keys and add USD credit in Billing, because a request needs enough prepaid credit to be accepted.
  • Keep the key on the machine that runs the client.

Set both variables

Host root, no /v1 suffix

export ANTHROPIC_BASE_URL="https://global.beefapi.com"
export ANTHROPIC_AUTH_TOKEN="sk-..."
  • Use ANTHROPIC_AUTH_TOKEN for the BeefAPI key, not ANTHROPIC_API_KEY, and remove the other name so a stale value in your shell profile cannot win.
  • Do not append /v1 to the Base URL. The client adds its own /v1/messages path, so a doubled suffix does not resolve.
  • The same names can be set under env in ~/.claude/settings.json; on Windows that is %USERPROFILE%\.claude\settings.json.
  • Restart the client after changing these values so the running session picks them up.

Confirm the gateway path

Send one message. The check has two halves: a successful response from Claude Code, and the matching entry in the Usage log with its model, request ID and USD cost. A recorded entry on its own only shows that a request was accounted for; a response on its own does not show which account paid for it.

  • No record at all is not proof that nothing was sent. Re-check the time window and the key, then look the call up by its request ID, and read the error the client reported before changing configuration.
  • Rejected for insufficient credit: add credit in Billing; the reservation has to fit.
Credentials and scopeBOUNDARIES

A global BeefAPI key spends prepaid USD credit on global.beefapi.com. Keys and credit from the Chinese site beefapi.com are separate and do not work here. This page covers the gateway connection only; the wider Claude Code feature set is documented by Anthropic.

Still deciding

Why does ANTHROPIC_API_KEY not work?

BeefAPI's documented Claude Code setup uses ANTHROPIC_AUTH_TOKEN as the Bearer credential. Set that name and remove the other one so the client is not reading a stale value from your shell profile.

Which model ID should I pass?

Use a model ID available to that key. Current model IDs and their rates are on the price list, and the API contract is in the API overview. An ID that is not available to the key returns 404 model_not_found.

Sources

Page facts checked 2026-09-26. Prices, model IDs and client configurations change; the linked sources are authoritative.

GLOBAL KEY · USD CREDITCreate an API key