Migration checklist · As of 2026-11-20

Moving Claude Code from a stopped subscription to an API key

As of November 20, 2026, the move takes four steps: export your data from Settings > Privacy on the web app or Claude Desktop (conversation data and account user data, not the original files you uploaded), back up ~/.claude and your project CLAUDE.md outside the repository, put ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL into the env block of ~/.claude/settings.json and confirm the credential with /status, then set promptCacheTtl to 1h if you need it. The default main-conversation cache on the API key path is five minutes, and that is where the post-migration bill moves most.

Updated 2026-11-20

Point this tool at the QCode endpoint — one key for Claude, GPT and Chinese models.

#What a data export contains#Local config stays put#ANTHROPIC_AUTH_TOKEN#5-minute vs 1-hour cache

Four things to hold on to

Settings > Privacy

The export entry point: web or desktop, not mobile

Anthropic's help center says individual users on Free, Pro, Max, and Ultra plans export from Settings > Privacy on the web app or Claude Desktop, and that an export cannot be started from Claude for iOS or Android; on Team and Enterprise an organization Owner turns member exports on first.

~/.claude

Local configuration follows the machine, not the account

~/.claude/settings.json applies to every project on your machine, ~/.claude/CLAUDE.md holds your own instructions, and a project's .claude/settings.json belongs to the repository. Swapping credentials does not delete any of them.

AUTH_TOKEN

Gateway credentials travel as a Bearer header

In the documented authentication order, ANTHROPIC_AUTH_TOKEN ranks above ANTHROPIC_API_KEY and is sent as the Authorization: Bearer header for routing through an LLM gateway or proxy. When you do not know which variable a gateway wants, the docs say to start with this one.

5 minutes

The API key path defaults to a five-minute main-conversation cache

For the same conversation, a subscription requests a one-hour cache within plan usage, while an API key or a cloud provider gets five minutes by default. From v2.1.242 you can set promptCacheTtl back to 1h.

What is actually being migrated

When a Claude subscription stops and you want to know how Claude Code moves to an API key, separate three things.

  1. 1Data sits in the Anthropic account: an export gives you conversation data and the user data for your account plus any voice recordings you shared with Anthropic, not the original files you uploaded.
  2. 2Configuration sits on your machine or in your repository: ~/.claude/settings.json, ~/.claude/CLAUDE.md, the project's .claude/settings.json and CLAUDE.md, and .claude/settings.local.json are local files that an account change does not touch.
  3. 3Credentials sit in environment variables or a settings file, and the help center states that Claude Code prioritizes environment variable API keys over authenticated subscriptions, billing them at API pay-as-you-go rates even while a subscription is signed in. So the migration is a credential swap plus a billing change from quota to per-token settlement, not a data move.

What changed: the metered path became the main option

Three things became clearer before November 20, 2026.

  1. 1The billing rule is written down: an Anthropic help center article updated on May 5, 2026 states that Claude Code prioritizes an environment variable API key and bills it at API pay-as-you-go rates, even when a subscription is also signed in.
  2. 2The cache is configurable: the official docs state that promptCacheTtl and CLAUDE_CODE_PROMPT_CACHE_TTL require v2.1.242 or later and accept only 5m or 1h.
  3. 3Community requests changed direction: in Chinese-language threads between 2026-11-15 and 2026-11-20, users reported that an exported archive contained only users.json with no conversation history, and one developer wrote that a paid one-click migration of Claude Code settings would draw a queue. Those are user reports, not official statements.

Three dates: billing rule, community second wave, check date

2026-05-05

Anthropic updated its help center article Manage API key environment variables in Claude Code: Claude Code prioritizes an environment variable API key and bills it at API pay-as-you-go rates even when a subscription or a different Console account is also signed in, and running /status periodically is the recommended way to confirm which method is active.

2026-11-18

A Chinese-language community thread took up export contents: a user wrote that the exported archive held only users.json and no conversation history. That is a user report. The official export article says an export includes conversation data and account user data and excludes the original files you uploaded, so where the two disagree, trust the official text and the archive you actually received.

2026-11-20

As of November 20, 2026, Anthropic has still not published a one-click migration for Claude Code settings, and no automatic path moves local configuration out of an export. What remains is the same three tasks: export through the documented entry point, copy your local configuration files outside the repository, and place the metered key in the env block of ~/.claude/settings.json.

Confirmed in official sources vs user reports and open questions

Confirmed (Anthropic help center and Claude Code documentation)

Checkable as of November 20, 2026

  1. 1Export scope. The official wording is that data exports include conversation data and the user data for your account, along with any voice recordings you've shared with Anthropic. Original files you uploaded are excluded, and the saved Personal Finance dashboard is not included yet.
  2. 2Entry point and lifetime. Settings > Privacy on the web app or Claude Desktop; an export cannot be started from iOS or Android; once the export is processed, a download link arrives by email to the address on the account, expires 24 hours after it is created, may work only once, and downloading requires being signed in.
  3. 3No moving between accounts. Exported data cannot be imported into another personal Claude account, and migrating data between personal accounts is not supported.
  4. 4Rights after a ban. A Free, Pro, Max, or Ultra account banned for violating the Usage Policy can still log in at claude.ai to export its data or delete itself, with access possibly restricted depending on the violation, and the appeal form requires a signed-in banned account.
  5. 5Local file scopes. ~/.claude/settings.json covers every project on the machine, a project's .claude/settings.json is committed and shared, .claude/settings.local.json covers one project for you, ~/.claude/CLAUDE.md holds user instructions, and project instructions live in ./CLAUDE.md or ./.claude/CLAUDE.md.
  6. 6Credential location and priority. Claude Code prioritizes environment variable API keys over authenticated subscriptions, gateway credentials belong in the env block of a settings file, and the docs warn against putting a credential in a project's .claude/settings.json.
  7. 7Cache. A subscription within plan usage gets one hour for the main conversation, an API key or cloud provider gets five minutes, and setting promptCacheTtl to 1h requires v2.1.242 or later.

User reports and what Anthropic has not published

None of the following is an official conclusion.

  1. 1The exported archive contains only users.json and no conversation history: users in Chinese-language threads between 2026-11-15 and 2026-11-20 did report this, while the official article says an export includes conversation data and account user data, so go by the official text and by the archive you actually hold.
  2. 2A one-click migration of Claude Code settings is coming: one developer wrote that a paid tool preserving most of the setup would draw a queue, but Anthropic has not published such a feature or any timeline, so do not wait for it.
  3. 3Metered billing is always cheaper: no official comparison exists, and a per-token bill depends on your usage and cache hits, so run a day and read the statistics instead of trusting a claim.
  4. 4Other exceptions to a download link: the official text covers a 24-hour expiry, a single possible use, and no re-send after the account's data is deleted; anything beyond that is unpublished.
  5. 5Shopping lists: community threads compare DeepSeek, GPT, and Qwen side by side, which is personal selection work; Anthropic publishes no recommendation or price comparison across vendors.

Stay on subscription sign-in vs move to a metered API key

A: stay inside the subscription and wait on the account

A subscription is quota-based: within plan usage the main conversation asks for a one-hour cache, usage counts against the plan allocation, and no separate per-token bill appears. The cost is that requests on this path fail while the account is suspended, and after it is restored the five-hour session limit on Pro and Max plus each plan's weekly limit still apply. Appeals, refunds, and data export all run through Anthropic's own process, which you cannot speed up.

B: switch to a metered API key billed per token

Same machine, same CLAUDE.md, same skills, only the credential changes: put ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL in the env block of ~/.claude/settings.json, expect the main-conversation cache to drop to five minutes, and set promptCacheTtl to 1h if you want the hour back (v2.1.242 or later). Billing is per token, so you pay for what you run, and the plan allowance no longer caps or protects you; check /usage before starting a long task and top up accordingly.

Six steps: export, back up, switch credentials, reconcile

  1. 1Export first: open Settings > Privacy on the web app or Claude Desktop and click Export data; when processing finishes, the download link arrives by email, expires 24 hours after it is created and may work only once, so download it right away; on Team and Enterprise an organization Owner turns member exports on first.
  2. 2Back up local configuration: copy ~/.claude/CLAUDE.md, ~/.claude/settings.json, and the project's CLAUDE.md, .claude/settings.json, and .claude/settings.local.json into a directory outside the repository; skills, MCP configuration, and hooks live in those files and directories.
  3. 3Clear the old login if you want to: if you no longer need the subscription login, run /logout inside Claude Code to sign out completely; ANTHROPIC_AUTH_TOKEN already ranks above the subscription login in the authentication order, so the env entry takes over.
  4. 4Write the two variables: in the env block of ~/.claude/settings.json set ANTHROPIC_BASE_URL=https://api.qcode.cc/api and ANTHROPIC_AUTH_TOKEN=your cr_ key; do not put them in a project's .claude/settings.json, which is committed to the repository.
  5. 5Confirm the credential: run /status and check that the Anthropic base URL line and the Auth token line point at the values you just wrote, then look at the cache numbers in /usage.
  6. 6Tune the cache and test: promptCacheTtl set to 1h gives the main conversation a one-hour cache; run a small task first, read the token usage, and only then decide how much quota to buy.

Moving to QCode: two variables, local configuration untouched

QCode is an independent API access service, and access is split by protocol.

  1. 1Claude models such as claude-sonnet-5-5, claude-opus-5-5, and claude-fable-5-2 go to the Anthropic Messages endpoint: set ANTHROPIC_BASE_URL to https://api.qcode.cc/api and ANTHROPIC_AUTH_TOKEN to your cr_ key in the env block of ~/.claude/settings.json, and keep your CLAUDE.md, skills, MCP setup, and hooks exactly as they are.
  2. 2The same cr_ key calls Claude models in Claude Code and GPT models in Codex CLI: that side sets base_url to https://api.qcode.cc/openai and wire_api to responses and reaches gpt-6.2-sol or gpt-6.1-sol, since the two are different endpoints, each speaking its own protocol.
  3. 3OpenAI-compatible clients such as OpenCode use https://api.qcode.cc/openai/v1. Billing is per token, with per-model rates on /models. Not ready for a monthly plan? Pay-as-you-go Packs start at $4 for a one-time quota you use within 7 days; if you already have a Personal Plan, add a booster pack when you need more quota. One thing to be explicit about: QCode neither affects nor lifts any action Anthropic takes on your claude.ai account, and appeals, refunds, and data exports stay inside Anthropic's own process.

Frequently asked questions

What does the export actually contain, and is chat history in it?

By the official text, chat history is in it: an export includes conversation data, the user data for your account, and any voice recordings you shared with Anthropic, but not the original files you uploaded, and not the saved Personal Finance dashboard yet. Users in community threads on 2026-11-18 and 2026-11-20 reported an archive containing only users.json; if that happens, run the export again from the same entry point, check the file list inside the archive, and use the official support channel if it still does not match.

Will my CLAUDE.md, skills, and MCP configuration be lost?

No, because none of that lives in the account. ~/.claude/CLAUDE.md holds user-level instructions, project instructions live in ./CLAUDE.md or ./.claude/CLAUDE.md and reach the team through version control, and .claude/settings.local.json holds your local overrides for one project; skills, MCP configuration, and hooks are configured in the same files and directories. A change of account status or credential only changes which key Claude Code sends requests with, so it deletes no local files. The one thing you must do yourself is copy ~/.claude/ and the project's .claude/ to a backup outside the repository.

Does switching to an API key affect my appeal?

An appeal requires logging in with the banned account before the form can be opened and submitted, and data export and self-serve deletion sit on the same screen after login; the help center does not say that using another API key affects an appeal. The outcome is decided by Anthropic's review, and refunds and exports follow the official process. QCode neither affects nor lifts any action Anthropic takes on your claude.ai account.

Will metered billing cost more than the subscription?

There is no single answer, because it depends on token usage and cache hits. For the same conversation, a subscription within plan usage asks for a one-hour cache, while the API key path defaults to five minutes, so coming back after an idle gap recomputes the whole prefix, and that is exactly where a bill tends to grow. Setting promptCacheTtl to 1h (v2.1.242 or later) restores the hour for the main conversation, but one-hour cache writes cost more than the five-minute tier, so continuous short tasks get more expensive; run a day on the defaults and read the cache numbers in /usage before deciding.

What should a team watch out for when migrating together?

Split it in two layers: what can be committed goes in the project's .claude/settings.json, and credentials stay in personal files. The docs warn against putting a credential in a project's .claude/settings.json, since that file is committed and visible to everyone who clones the repository, so team permissions, hooks, plugins, and shared environment variables belong there, while your own credential goes in the env block of ~/.claude/settings.json on your machine or in .claude/settings.local.json for one project. On the export side, an organization Owner has to turn member exports on before each member can export their own chats.

Can Codex and OpenCode use the same key?

Yes, but you change the endpoint, not the key. The same cr_ key works in Claude Code with ANTHROPIC_BASE_URL=https://api.qcode.cc/api; in Codex CLI's ~/.codex/config.toml set base_url = "https://api.qcode.cc/openai" and wire_api = "responses" without a /v1 suffix; OpenAI-compatible clients such as OpenCode use https://api.qcode.cc/openai/v1. The two endpoints are used separately: the Claude Code path (https://api.qcode.cc/api) serves Claude models, while the Codex CLI path (https://api.qcode.cc/openai) serves GPT models such as gpt-6.2-sol and gpt-6.1-sol, each speaking its own protocol; rates are on /models.

Sources

Anthropic help center: Export your Claude data (support.claude.com article 9450526, checked 2026-11-20), Safeguards warnings and appeals (article 8241253, checked 2026-11-20), Manage API key environment variables in Claude Code (2026-05-05), Use Claude Code with your Pro, Max, or Ultra plan (checked 2026-11-20); Claude Code documentation: settings, memory, authentication, llm-gateway-connect, prompt-caching (all checked 2026-11-20); community material comes only from public discussion threads dated 2026-11-15 to 2026-11-20 and is labeled as user reports wherever it appears. Every source above was checked on 2026-11-20.

Export the data, back up local configuration, then swap in a metered key

Create a QCode account for a cr_ key, set ANTHROPIC_BASE_URL=https://api.qcode.cc/api and ANTHROPIC_AUTH_TOKEN in the env block of ~/.claude/settings.json, and call multiple models billed per token; if you only want a one-time quota, start with a Pay-as-you-go Pack and check rates on /models.

Not sure where to start?

Try it for a week

Small Pack: $4 for $30 of quota, valid 7 days

Use it every day

Starter: $9.00/month with $5 of quota every day — just $0.060 per $1 of quota, vs about $0.113 for the Medium Pack