STOP WASTING PAID TOKENS. START POOLING ACCOUNTS TODAY. [ GET YOUR VAULT ]

Connect Claude (Claude Code or an Anthropic API key)

Who this is for: anyone who runs Claude Code on their own runner and wants SpiderGate to hold the credential for it.

What this does: explains Anthropic's rules for Claude logins, then walks you through connecting either a Claude Pro/Max login or an Anthropic API key. Both are lent to your own Claude Code; neither answers gateway requests.

Before you begin

  • Either a paid Claude plan (Anthropic says "Claude Code is included in all paid plans"), or an Anthropic Console account with prepaid credit.

  • A runner where you run the official, unmodified Claude Code.

  • About 3 minutes.

Limits and terms to know first

SpiderGate never answers a chat request with this login. It keeps the credential in your vault and lends it, a short pass at a time, to the official CLI running on your own runner. The key is never shared with the SpiderIQ pool. See Your Subscriptions for how a runner reads its free lease slots.

Warning: Anthropic's legal page for Claude Code says it does not permit third parties "to route requests through Free, Pro, or Max plan credentials on behalf of their users", and that "developers may not collect, store, or intermediate Claude.ai credentials or session tokens — sign-in to a Claude account must complete through Anthropic's own flow." The same page says this does not prevent "an end user from signing in to the unmodified Claude Code binary with their own Claude subscription, including where a platform hosts Claude Code". Connecting a login here means SpiderGate stores it for you. Read Anthropic's terms and decide before you choose that path; an API key avoids the question.

Warning: Anthropic's Consumer Terms say you may not share your login, API key or credentials "with anyone else". Keep this credential to your own brand.

Pro and Max both have a five-hour limit and a weekly limit, shared between Claude and Claude Code. Anthropic does not publish a number of messages. API keys bill prepaid credit; Anthropic says credit expires one year after purchase and is non-refundable.

Steps

Step 1 — Choose a path

Open Gate → Vault (/dashboard/gate/vault) and click Add Provider. Under Connect a subscription:

  • choose Claude Code ("Sign in with Claude") to connect a Pro or Max login, and go to Step 2; or

  • choose Anthropic to paste an API key, and go to Step 3.

Step 2 — Connect a Claude login

In the Connect Claude Code dialog, pick your plan's package under Billing · Subscription and, optionally, the number of CLI leases. Click Open Claude sign-in, sign in with your Claude Pro or Max account and authorize. Claude shows an authorization code in the form code#state. Copy all of it, paste it into the Step 2 box, and click Finish connect.

Step 3 — Or add an Anthropic API key

Open platform.claude.com/settings/keys (the old console.anthropic.com address redirects there). Click Create key, name it, choose an expiration, and set Linked account. Anthropic shows the key, which starts with sk-ant-, only once. Buy credit under Settings → Billing → Buy credits if you have none.

In SpiderGate's dialog, paste it into API Key, add a Label, and click Add key.

Verify it worked

For a login, the key appears in your vault as a Subscription key.

For an API key, SpiderGate first checks it: it lists one model at https://api.anthropic.com/v1/models. If Anthropic refuses the key, the dialog shows The anthropic key did not pass its check: <reason>. Nothing was saved.

Either way, GET /api/gate/v1/subscriptions (see Your Subscriptions) returns the credential with usage: lease and lease.free_slots.

Troubleshoot

Couldn't read a code + state from that. Paste the full URL or code shown by the provider. Copy the whole authorization code, including the part after #.

Claude Code on your runner bills the API instead of your plan. Anthropic says an ANTHROPIC_API_KEY in the environment wins over a subscription login, and in non-interactive mode "the key is always used when present". Run unset ANTHROPIC_API_KEY and check /status.

Claude Code warns "Your login expires in 3 days". Reconnect the login from the vault.

Too many keys checked for this workspace; try again in …s. SpiderGate runs at most 20 key checks per brand in any 10 minutes. Wait the number of seconds it gives, then click Add key again.

Request timed out (15s) or Could not reach … to check the key. Try again later. The provider did not answer in time. Nothing was saved. Try again in a minute.

The provider is rate-limiting us (429). Try again in a minute. The provider throttled the check itself. Wait a minute and retry.

Related