Skip to main content
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 run mnemom 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:
Type the number and press Enter. Your answer is saved as 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.
You are never asked in a script, a pipe or CI. A non-interactive launch with nothing set uses an API key. To change the option later, or set it for one launch:
Precedence: --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.
  1. Sign Claude Code in to your Team or Enterprise claude.ai account: run claude, then /login.
  2. Run mnemom agent and pick Claude subscription, or run mnemom agent config set auth subscription.
What happens on a subscription launch:
  • Claude Code sends its own claude.ai login to the gateway. mnemom agent doesn’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 agent asks 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 agent creates a gateway-only key and saves it to ~/.mnemom/launcher.json (readable only by you). To use your own key instead, set MNEMOM_AGENT_MNEMOM_KEY to an org API key with the gateway scope.

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:
  1. Someone in the same Claude organization runs Claude Code through Mnemom once with a regular claude /login (with CLAUDE_CODE_OAUTH_TOKEN unset 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.
  2. After that, long-lived tokens that bill to that organization are accepted. Allow a minute after the regular login.
If the organization later stops being on a Team or Enterprise plan, the next regular login removes the verification. Pro and Max organizations are never verified, so their long-lived tokens are refused.

Anthropic API key

This is the default. mnemom agent looks for your key in this order:
  1. the environment: MNEMOM_AGENT_ANTHROPIC_KEY, else ANTHROPIC_API_KEY;
  2. its own store, ~/.mnemom/launcher.json (readable only by you);
  3. 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 names mnemom 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.
A login Mnemom can’t use, such as a Pro or Max plan or an Anthropic Console account, is handled as described in How the option is picked.

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.toml or MNEMOM_AGENT_AUTH) does not stop a launch. The launch uses an Anthropic API key and prints a one-line notice. Run mnemom agent config set auth api-key to stop the notice. mnemom agent doctor reports it too.
  • mnemom agent refuses --auth console and mnemom agent config set auth console.