mnemom agent sends Claude Code’s model traffic through the Mnemom gateway, but
Claude Code still has to sign in to Anthropic. There are two ways to do that:
If you pay for Claude through the Anthropic Console, use an API key. See
Anthropic Console accounts.
Your Mnemom µ balance is checked and charged the same way whichever option you
pick. See Account and µ balance.
How the option is picked
The first time you runmnemom agent in a terminal, it looks at how Claude Code
is signed in on this machine (~/.claude.json, or .claude.json in
$CLAUDE_CONFIG_DIR). If there is a real choice, it asks once. For example:
auth in
~/.mnemom/launcher.toml. If you press Enter without a number, this launch uses
an API key and you are asked again next time.
mnemom agent does not sign Claude Code in with a Microsoft Foundry credential today. To route Claude or OpenAI models that you host on Foundry through the gateway from your own code, see Microsoft Foundry.--auth, then MNEMOM_AGENT_AUTH, then auth in
~/.mnemom/launcher.toml, then api-key. To see what a launch would use without
launching, run mnemom agent --dry-run. mnemom agent doctor also reports it.
Claude subscription (Team or Enterprise)
Use your company’s Claude plan. You don’t need an Anthropic API key.- Sign Claude Code in to your Team or Enterprise claude.ai account: run
claude, then/login. - Run
mnemom agentand pick Claude subscription, or runmnemom agent config set auth subscription.
- Claude Code sends its own claude.ai login to the gateway.
mnemom agentdoesn’t read or store it. - The gateway checks your plan with Anthropic. Only Team and Enterprise plans are accepted. Pro and Max plans are refused and need an API key instead.
- Usage counts against your Claude plan, as it does when you use Claude Code without Mnemom.
- The session runs in your terminal.
- Before Claude Code starts,
mnemom agentasks the gateway which agent your Mnemom API key and agent name run as, and claims it into your org if it is not claimed yet. If the gateway does not support this check yet, the launch stops and suggests--auth api-key. See Your governed agent. - The gateway identifies you by a Mnemom API key. The first time one is needed,
mnemom agentcreates a gateway-only key and saves it to~/.mnemom/launcher.json(readable only by you). To use your own key instead, setMNEMOM_AGENT_MNEMOM_KEYto an org API key with thegatewayscope.
Long-lived tokens (claude setup-token)
claude setup-token makes a long-lived Claude login, used as
CLAUDE_CODE_OAUTH_TOKEN. Anthropic does not tell the gateway which plan such a
token is on, so the gateway checks its Claude organization instead:
- Someone in the same Claude organization runs Claude Code through Mnemom once
with a regular
claude /login(withCLAUDE_CODE_OAUTH_TOKENunset for that run). If that login is on a Team or Enterprise plan, the gateway records the organization as verified for 30 days. Each regular login renews it. - After that, long-lived tokens that bill to that organization are accepted. Allow a minute after the regular login.
Anthropic API key
This is the default.mnemom agent looks for your key in this order:
- the environment:
MNEMOM_AGENT_ANTHROPIC_KEY, elseANTHROPIC_API_KEY; - its own store,
~/.mnemom/launcher.json(readable only by you); - a masked prompt, which offers to save the key for next time.
mnemom agent config set key_source env|store|prompt narrows the search:
env uses the environment only, store uses the environment then the store, and
prompt always asks.
The key goes only to the Claude Code process mnemom agent launches. It is never
logged, printed or passed as a command-line argument. If no key is found,
mnemom agent stops instead of launching Claude Code without the gateway.
No Claude login and no API key
mnemom agent checks for a credential before it asks any first-run question and
before Claude Code starts. If Claude Code is not signed in on this machine (no
login and no CLAUDE_CODE_OAUTH_TOKEN) and there is nothing else to use, it
stops with exit status 3:
- With
auth = subscription, the message says Claude Code is not signed in. The fix also namesmnemom agent config set auth api-key, to use a key instead. - With
auth = api-key(the default) and no key in the environment or the store, a launch in a terminal asks for a key first. If you press Enter without one, it stops the same way. A launch with no terminal stops at once.
Anthropic Console accounts
If your team pays for Claude through the Anthropic Console (API billing), create an API key at console.anthropic.com and use it as described in Anthropic API key.mnemom agent does not
use the key that Claude Code’s /login → “Anthropic Console account” creates.
Earlier CLI versions had an auth = console option. It is no longer supported:
- A saved
auth = console(in~/.mnemom/launcher.tomlorMNEMOM_AGENT_AUTH) does not stop a launch. The launch uses an Anthropic API key and prints a one-line notice. Runmnemom agent config set auth api-keyto stop the notice.mnemom agent doctorreports it too. mnemom agentrefuses--auth consoleandmnemom agent config set auth console.
Related
- mnemom agent: install, invitations and launching
- Savings estimates: the first-run savings screen and the in-session counter