Skip to main content

Quick answer

Claude Code can authenticate in more than one way. Individual users often sign in with a Claude.ai account. API users or teams may use Claude Console, cloud providers, or a supported third-party provider path. A Claude.ai account and an API Key are not the same thing. Claude.ai login is for the official product experience. An API Key is used for model API requests and is usually paired with a Base URL and provider configuration. If you use a third-party API gateway, the important fields are API Key and Base URL. You must also confirm whether the tool expects an Anthropic-compatible or OpenAI-compatible protocol.

When this matters

  • You see a login prompt during Claude Code setup
  • You are unsure whether Claude Pro or Max gives you an API Key
  • You want to route Claude Code through a custom API gateway
  • You need to choose between official login and a third-party provider
  • A team needs one consistent authentication pattern

Key concepts

  1. If you only want the official Claude Code experience and use a Claude.ai plan, start with official login.
  2. If you need API billing or team-managed API access, review Claude Console or your team provider.
  3. If you need a custom API gateway, confirm that Claude Code supports the provider path, then configure API Key and Base URL.
  4. If you need official app features plus a third-party inference provider, decide whether you must preserve the official login state.
In this documentation, the Anthropic-compatible Claude Code Base URL is https://www.bettertoken.ai.

Common mistakes

  • Treating a Claude.ai subscription as an API Key.
  • Pasting a ChatGPT Plus or other subscription credential into Claude Code.
  • Copying only the API Key and forgetting to change the Base URL.
  • Putting an OpenAI-compatible Base URL into Claude Code’s Anthropic-compatible configuration.
  • Sharing auth.json, refresh tokens, or session credentials as if they were API Keys.

About BetterToken

If you choose the API Key + Base URL path, BetterToken can provide the compatible endpoint and a dashboard for API Keys, balance, and usage history. BetterToken does not replace Claude.ai login or turn a Claude.ai subscription into an API Key. It only handles the model API layer.

References