Use Claude Code Without a Claude Account: 3-Step Endpoint Setup
Yes. Claude Code is a command-line tool. Besides signing in with a Claude account, it can send requests to another compatible endpoint through environment variables and use an API key issued by that endpoint. So using Claude Code without a Claude account works technically: account login is one authentication method, not the only one. This article explains how the mechanism works, walks through the setup using AGI Plan's onboarding flow as an example, and covers what to check before you rely on it.
Why can Claude Code run without an account login?
Claude Code sends requests to an endpoint URL along with a credential. The default URL is the official API, and the credential comes from an account login or an official API key. The official documentation lists environment variables that override both. The common ones are ANTHROPIC_BASE_URL (the endpoint) and ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY (the credential). Exact variable names and precedence are defined by the official docs; see also our guide to Claude Code settings.json layers, precedence, and env configuration.
As long as the other side offers a service compatible with the Anthropic API format, swapping the URL and key is enough, and Claude Code will send its requests there. For a fuller walkthrough, see Custom API endpoints for Claude Code, Codex, and OpenCode.
How do you set it up with AGI Plan in 3 steps?
AGI Plan is a multi-provider LLM aggregation gateway. It is billed monthly, priced in RMB (CNY), needs no overseas credit card, and supports both the OpenAI and Anthropic API formats. AGI Plan is a commercial partner of cdnping. It publishes a step-by-step Claude Code tutorial, and this approach does not require a Claude account. Setup takes three steps:
- Sign up with an email verification code.
- Pick a plan and create a key.
- Change one setting in Claude Code so the endpoint points to AGI Plan and the credential is the key you just created.
For the actual endpoint URL, variable syntax, and where things are in the UI, follow the tutorial at agiplan.dev/startup. Don't copy an address from anywhere else. Below is a sketch of the environment-variable approach; both the URL and the key are placeholders:
export ANTHROPIC_BASE_URL="<endpoint URL from the tutorial>"
export ANTHROPIC_AUTH_TOKEN="<the key you created>"
claude
You can also put these in the env field of settings.json so the configuration follows your project or user directory.
How do you confirm requests really go to the new endpoint?
Don't stop at "it answers." Check in this order:
| Check | How | Expected |
|---|---|---|
| Is the variable active? | Run echo $ANTHROPIC_BASE_URL in the same terminal | Prints the URL you set |
| Any leftover login? | Check Claude Code's current authentication status | It uses the key you set |
| Can it send a request? | Ask a simple question inside claude | A normal reply |
| Is usage recorded? | Look at the usage log in the gateway console | Your request shows up |
If an account login and an API key both exist, you may see an auth conflict or a 401; see Claude Code auth conflict warning and 401 errors. If you've set a proxy and it has no effect, read Claude Code proxy settings not working.
What are the limits and risks?
A few things to be clear about.
- The AGI Plan team states plainly that it is not an officially authorized channel. Read the terms of Anthropic and of any service you use, and follow local laws and regulations.
- Some models are marked "overseas only." Availability is defined at agiplan.dev/models.
- Any third-party gateway handles your requests. The operator says request bodies are not written to disk by default and content is not used for training or resold, but you should read the privacy policy yourself and avoid putting keys or customer data in prompts. For self-checks, see Are Claude API relays reliable?
- This approach solves "using Claude Code without an account." If you already have a working account, official subscription login and API-key billing each have trade-offs; see Claude Code: subscription login or API key.
This is also not a guide to bypassing any regional restriction. If you can't register an account because your region isn't officially supported, first read What "Claude unsupported region" means to understand the official policy before choosing a compliant path.
How do you choose a plan, and what does it cost?
AGI Plan's plans are Lite ¥49/month, Plus ¥119/month, Pro ¥649/month, and Max ¥1,368/month. The four tiers differ only in quota, and annual billing is 20% off. Prices are defined at agiplan.dev/pricing. Quota is measured in CU: 1 CU equals 1,000 output tokens of the baseline model. Pay-as-you-go is also available at 1 yuan = 500 CU, with a ¥20 minimum top-up.
If you're unsure how much you use in a month, start with pay-as-you-go, then use the method in How to estimate Claude Code token usage to work out a monthly figure, and compare it against Pay-as-you-go vs. monthly AI plans.
What if it won't connect or is slow?
First work out whether the problem is network, authentication, or the server side.
- Timeouts or connection resets: follow the four-layer checklist in Claude Code connection timeouts and errors.
- Slow responses: see Why Claude Code is slow. You can also test first-connection and round-trip times for each API entry point on the cdnping homepage; for background, see AI API latency from China.
- Suspect an upstream outage: check Anthropic status and Is Claude down?.
Next step
Open agiplan.dev/startup, follow the Claude Code tutorial through signing up, creating a key, and changing the setting, then use the checklist above to confirm requests reach the new endpoint. If you just want to try it, the lowest plan or a ¥20 pay-as-you-go top-up is enough.