Skip to content
BENIBIX Learn

--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.

AI⌨️ Claude Code

--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.

Example
Lucy reads that a new API feature is in beta. She signs in with her API key and starts claude --betas with its name to try it.
Why it matters
You can try a new feature early. You do not have to wait for it to be the default.
Full entry
AI⌨️ Claude Code

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.

Example
Lucy wants to try a new API beta on her Max plan. The --betas flag needs an API key, so she sets ANTHROPIC_BETAS instead.
Why it matters
You can try a new API feature the day it ships, without waiting for an update.
Full entry

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.