--betas vs ANTHROPIC_BETAS
People think the --betas flag and the ANTHROPIC_BETAS variable are one switch in two places. Both add anthropic-beta headers, but they reach different runs. The flag lasts for one run, and it only works when you sign in with an API key. The variable lasts for each session that sees it, and it works with any sign-in, a plan too. On a plan, only the variable works.
--betas Flag
It turns on API features that are still in testing.
--betas adds beta headers to the requests Claude Code sends to the API, to try a feature that is still being tested. Each header turns on one feature by name, such as interleaved-thinking. It only works when you sign in with an API key, not with a Claude plan.
ANTHROPIC_BETAS
It turns on API betas for each request.
ANTHROPIC_BETAS adds more beta header values to each API request. Put commas between them. It lets you try an API beta before Claude Code supports it. Claude Code already sends the betas it needs. Unlike the --betas flag, it works with any sign-in, a plan too.
In one line
- --betas Flag
- It turns on API features that are still in testing.
- ANTHROPIC_BETAS
- It turns on API betas for each request.