Claude Code setup without an Anthropic account: APIKing in three steps

Updated 2026-11-27简体中文繁體中文日本語한국어DeutschFrançaisEspañolPortuguês (Brasil)ItalianoРусский

Claude Code asks for an Anthropic login or an official API key. With an APIKing key instead, you need no Anthropic account, can top up with Alipay and pay per token, and /model still switches between Opus, Sonnet, Haiku and Fable. The whole setup is one settings file.

1. Edit the settings file

Install Claude Code from its official site, then open ~/.claude/settings.json (on Windows, the .claude folder in your user folder). Merge in the settings below and replace sk-YOUR_KEY with your APIKing key. The file is JSON, so no # comments.

{
  "model": "claude-haiku-5-5",
  "env": {
    "ANTHROPIC_BASE_URL": "https://apiking.ai",
    "ANTHROPIC_AUTH_TOKEN": "sk-YOUR_KEY",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5",
    "ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-fable-5-2",
    "ANTHROPIC_CUSTOM_MODEL_OPTION": "claude-fable-5-1"
  }
}
ANTHROPIC_BASE_URL is the site root without /v1; Claude Code adds /v1/messages. The DEFAULT_*_MODEL lines keep Claude Code’s background work (titles, summaries) on Haiku and Sonnet instead of the most expensive model.

2. Start it and check

  • Run claude in your project folder. On first launch, pick a terminal theme and press Enter.
  • Enter /status and check that the Anthropic base URL points to APIKing.
  • Enter /model to pick Opus, Sonnet, Haiku or Fable, or switch by ID with /model claude-opus-5-5.
  • Send a message, then find the call on the usage page of the console.

If the login menu appears, the settings did not load: check that the JSON is valid and that ANTHROPIC_AUTH_TOKEN holds your APIKing key.

Prices of the models Claude Code uses

ModelPriceOfficial price (per 1M tokens)
Claude Opus 5.5$0.50 in · $2.50 out / 1M$4.00 in · $20.00 out / 1M
Claude Sonnet 5.5$0.25 in · $1.30 out / 1M$2.00 in · $10.00 out / 1M
Claude Sonnet 5$0.44 in · $2.20 out / 1M$2.00 in · $10.00 out / 1M
Claude Haiku 5.5$0.04 in · $0.17 out / 1M$0.10 in · $0.50 out / 1M
Claude Fable 5.2$1.50 in · $7.50 out / 1M$8.00 in · $40.00 out / 1M

Billed per token from your balance, with no subscription. Settings for Cursor, Cherry Studio, Codex and other apps are in Use it in an app.

Questions

Can Claude Code run without an Anthropic account?

Yes. Set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in ~/.claude/settings.json and use your APIKing key.

Does ANTHROPIC_BASE_URL end in /v1?

No. Use the site root; Claude Code adds /v1/messages.

What if the login menu appears?

The settings did not load. Check that settings.json is valid JSON with no # comments and that ANTHROPIC_AUTH_TOKEN holds your APIKing key.

How is Claude Code billed?

Per token from your balance, with no subscription; failed calls are free.