# Atlas error: CLOUDFLARE_ACCOUNT_ID is missing

> Run export CLOUDFLARE_ACCOUNT_ID=<your-account-id> using the 32-character Cloudflare account identifier, not the zone id, then restart Atlas.

Atlas throws "CLOUDFLARE_ACCOUNT_ID is missing. Set it with: export CLOUDFLARE_ACCOUNT_ID=<your-account-id>" because the cloudflare loader found no account id in the environment and none in the api auth metadata, and the fix is to run exactly the export command in the message. You can instead re-run atlas auth login for cloudflare so the accountId is stored in auth metadata. Use the 32-character Cloudflare account identifier, not the zone id.

## Symptom

Using a Cloudflare Workers AI model throws: CLOUDFLARE_ACCOUNT_ID is missing. Set it with: export CLOUDFLARE_ACCOUNT_ID=<your-account-id>.

## Cause

The cloudflare loader in Atlas reads the account id from the env or from the api auth metadata. If neither supplies one, the provider does not autoload and its getModel throws with the exact export command to run.

## Fix

1. Export CLOUDFLARE_ACCOUNT_ID exactly as the message shows: export CLOUDFLARE_ACCOUNT_ID=<your-account-id>.
2. Or re-run `atlas auth login` for cloudflare so the accountId is stored in auth metadata.
3. Confirm the account id is the 32-character Cloudflare account identifier, not the zone id.
4. Restart Atlas so the provider loader re-reads the environment, then re-select the Cloudflare Workers AI model.

## Why does Atlas say CLOUDFLARE_ACCOUNT_ID is missing

Atlas says "CLOUDFLARE_ACCOUNT_ID is missing" because the cloudflare loader reads the account id from 2 places, the environment and the api auth metadata, and neither supplied one. With no account id from either source, the cloudflare provider does not autoload and its getModel throws.

Cloudflare Workers AI requests are addressed per account, so Atlas cannot construct a model without an account id. The cloudflare loader looks in exactly two places: the environment, and the api auth metadata that atlas auth writes. Missing from both means the provider will not autoload, and the error is raised at getModel with the literal export command you need. That message is not generic advice. It is the command, and copying it and filling in your account id is the whole fix in most cases.

## How to fix CLOUDFLARE_ACCOUNT_ID is missing in Atlas

Fix "CLOUDFLARE_ACCOUNT_ID is missing" in Atlas by running export CLOUDFLARE_ACCOUNT_ID=<your-account-id> in the shell that launches Atlas, which is the exact command the error prints. Use the 32-character Cloudflare account identifier, or re-run atlas auth login for cloudflare so the accountId is stored in auth metadata.

Two supported sources, one choice. Exporting CLOUDFLARE_ACCOUNT_ID puts the id in the environment where the cloudflare loader reads it, which suits a local shell, a dotfile, or a container environment block. Running `atlas auth login` for cloudflare persists the accountId into the api auth metadata that Atlas manages, which suits people who would rather not carry Cloudflare identifiers in shell config. The cloudflare loader accepts either, so pick one and stay with it. Setting both is not harmful but makes it harder to reason about where the value actually came from.

## Account id vs zone id: the mistake that keeps the error alive

The most common reason CLOUDFLARE_ACCOUNT_ID stays broken in Atlas is pasting the zone id instead of the account id. Confirm the value is the 32-character Cloudflare account identifier, not the zone id, because Cloudflare shows both in the dashboard and they look alike at a glance.

Cloudflare surfaces a zone id for each domain and an account id for the account that owns them. Both are long hexadecimal strings, and both are sitting near each other in the dashboard, which is exactly why the wrong one gets copied. Atlas needs the 32-character account identifier. Check the length and check where you copied it from before you conclude the export failed. A wrong-but-present value produces a different failure than a missing one, so if you cleared the "CLOUDFLARE_ACCOUNT_ID is missing" message but Cloudflare Workers AI still does not answer, this is the first thing to re-verify.

## How to verify the CLOUDFLARE_ACCOUNT_ID fix worked

Verify the CLOUDFLARE_ACCOUNT_ID fix by restarting Atlas so the provider loader re-reads the environment, then re-selecting the Cloudflare Workers AI model. The loader checks its 2 sources at load time, so an export made after Atlas started, or in a different shell, will not be picked up until a restart.

Restarting is not optional here. The cloudflare provider does not autoload without an account id, and it does not re-check the environment mid-session, so a correct export in the wrong shell produces an identical error and looks like a failed fix. After the restart, select the Cloudflare Workers AI model and send a message. A completion with no "CLOUDFLARE_ACCOUNT_ID is missing" thrown from getModel means the loader now resolves the account id from the env or from auth metadata. Atlas lets you switch the active model and provider on the fly with favorites and recents, so re-selecting the model is a single step.

## FAQ

### How do I set CLOUDFLARE_ACCOUNT_ID for Atlas

Run export CLOUDFLARE_ACCOUNT_ID=<your-account-id> in the shell that launches Atlas, using the 32-character Cloudflare account identifier, then restart Atlas so the provider loader re-reads the environment.

### Where does Atlas look for the Cloudflare account id

The cloudflare loader reads the account id from the environment or from the api auth metadata. If neither supplies one, the provider does not autoload and getModel throws with the export command to run.

### Is the Cloudflare account id the same as the zone id

No. Atlas needs the 32-character Cloudflare account identifier, not the zone id. Both appear in the Cloudflare dashboard and are easy to confuse, and the zone id will not work.

### Can atlas auth login store my Cloudflare account id

Yes. Re-run `atlas auth login` for cloudflare so the accountId is stored in auth metadata. The cloudflare loader reads it from there as an alternative to the environment variable.

### I exported CLOUDFLARE_ACCOUNT_ID and Atlas still throws the error

Restart Atlas. The cloudflare provider loader reads the environment at load time, so an export made after Atlas launched, or in a different shell, is not visible to it.

### Why does the Cloudflare provider not load in Atlas

Without an account id from the env or from api auth metadata, the cloudflare provider does not autoload in Atlas. Supplying CLOUDFLARE_ACCOUNT_ID makes it load and lets Workers AI models resolve.

---

Canonical HTML: https://runatlas.sh/resources/troubleshooting/cloudflare-account-id-missing
Source of truth: aeo_pages row `/resources/troubleshooting/cloudflare-account-id-missing` (segment: Troubleshooting) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
