Agent.Space Blog

Claude Code API Key Billing: Check Which Account Pays

Check why Claude Code uses API billing despite a subscription, inspect configuration without exposing keys, and verify the intended account.

If Claude Code charges an API account while you expect subscription usage, check its authentication environment before buying more credits. An active subscription does not prove that the running client is using it.

Anthropic's API-key environment guidance says that ANTHROPIC_API_KEY affects this choice; the subscription setup guidance warns that a configured API key can take precedence. Checked September 29, 2026. This is a diagnostic procedure, not an investigation of your account or a refund policy.

Identify the intended payer first

Write down which of these you meant to use:

  • your Claude subscription;
  • an Anthropic API account;
  • a separately configured third-party endpoint and its account.

These are different payment relationships. A Claude login in your browser cannot establish the configuration of a terminal, editor, or automated job. For the broader choice, see Claude Code subscription versus API access.

Check for configuration without printing secrets

In a POSIX shell, this prints only whether relevant variables are present:

sh
for name in ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN ANTHROPIC_BASE_URL; do  if printenv "$name" >/dev/null; then    printf '%s: set\n' "$name"  else    printf '%s: unset\n' "$name"  fidone

Presence is a clue, not proof of the final billing path. Do not paste env, full settings files, or token values into a public issue. Privately inspect the launcher's configuration, shell startup files, editor environment, and credential helpers. Do not assume every project file is automatically loaded; determine what this process actually inherited.

Change only the route you intend to change

For subscription use, remove the unintended API configuration from the appropriate launch environment, restart the client, and follow the official subscription sign-in flow. Do not delete credentials needed by unrelated applications.

For API use, keep the intended key and endpoint explicit and separate from your subscription-oriented launcher. A named configuration or separate terminal launch procedure is easier to audit than repeatedly editing global settings.

Managed environments may have administrator-supplied authentication. Ask the owner before overriding it. A third-party endpoint has its own funding rules; it does not spend a Claude subscription simply because the client is Claude Code.

Confirm the result in usage records

After confirming the route and accepting any possible test charge, make one minimal request. Record its time and model; check the relevant account's usage history. Allow for reporting delays, and do not call an empty dashboard proof that usage was free.

If the charge still looks wrong, preserve redacted request identifiers, client version, and configuration-source names. Contact the provider that recorded the usage. Repeatedly signing in or buying credits will not explain an unexplained charge.

For Agent.Space, the Developer API guide describes verifying the selected key, model, protocol, and funding record. That is a separate account relationship, not an Anthropic subscription benefit.

Choose the workflow after resolving billing

Once the payer is clear, decide where the work should run. Claude Code on Agent.Space explains the hosted route; API configuration leaves the client and files local.

Open Agent.Space if that workflow fits, but resolve your existing billing question on its own evidence before moving a real task.