Overview
OneCLI injects your Anthropic credential into requests toapi.anthropic.com automatically. Agents make standard requests to the Anthropic API; the gateway adds the credential before forwarding.
This lets agents use Claude models (Claude Opus, Sonnet, Haiku) without ever seeing or handling your credential directly. For routing to Claude via Google Cloud instead, see Vertex AI. For a comparison of supported LLM providers, see LLM Providers.
What you will set up
- A Claude credential in OneCLI: a subscription token from
claude setup-tokenor a Claude Console API key - Automatic injection into the right header on requests to
api.anthropic.com - Per-agent access to the credential, with optional organization rules
Choose how to connect
sk-ant-admin...) can’t call Claude models, so OneCLI won’t use them.
Where to paste it
In the OneCLI dashboard, open your agent’s Models page, click Add LLM key, and choose Anthropic. Paste your token or key into Secret value and click Add Secret. Need help? in the window opens this page.
The Anthropic key window in OneCLI.
Option 1: Claude subscription token
Use this if you pay for a Claude plan. Usage counts against your plan instead of API billing. The free Claude plan doesn’t include Claude Code, so it can’t create a token.Open a terminal
- macOS: press
Cmd + Space, type Terminal, and press Enter. - Windows: press the Windows key, type PowerShell, and press Enter.
- Linux: open your terminal app (often
Ctrl + Alt + T).
Install Claude Code
~/.local/bin is not in your PATH, do the next step.
The installer finished. The Setup notes mean the claude command isn't on your PATH yet.
Make sure the claude command works
2.1.296 (Claude Code), skip to the next step. If you see command not found or not recognized, add the install folder to your PATH once, for your shell:macOS (zsh, the default):claude --version again.
After the PATH fix, claude --version prints the version.
Used an Anthropic API key or proxy on this computer before?
Used an Anthropic API key or proxy on this computer before?
export lines from ~/.zshrc or ~/.bashrc. On Windows, remove them under Edit the system environment variables > Environment Variables.Generate the token

claude setup-token asks you to sign in with your Claude account.
sk-ant-oat. Copy all of it. The token is valid for one year.Paste it into OneCLI
Option 2: API key from the Claude Console
Use this if you pay for API usage in the Claude Console. You don’t need a terminal.Create an API key
OneCLI, and copy the key. It starts with sk-ant-api or sk-ant-usr and is shown only once.Your Console organization needs billing set up (credits or a payment method), or requests are refused.Paste it into OneCLI
Troubleshooting
claude setup-token says a subscription is required
claude setup-token says a subscription is required
OneCLI says the value looks wrong or has spaces
OneCLI says the value looks wrong or has spaces
The key shows a warning on the Models page
The key shows a warning on the Models page
How it works
- Your credential is encrypted and stored by OneCLI (AES-256-GCM at rest)
- When an agent sends a request to
api.anthropic.com, the gateway intercepts it - The gateway injects the credential into the right header
- The request is forwarded to Anthropic
Controlling access
Access is per agent: attach the key to each agent that needs it. An agent without the grant can’t use it at all. Organization rules add guardrails on top: rate-limit requests, restrict agents to specific models by blocking certain paths, or flag high-cost operations for manual approval. Everything is checked before credential injection, so a blocked request never reaches Anthropic.FAQ
How do I get a token with claude setup-token?
How do I get a token with claude setup-token?
claude setup-token, and approve in the browser with the Claude account that has your plan. The terminal prints a token that starts with sk-ant-oat and is valid for one year. See Option 1 above, or the full claude setup-token guide.Should I use a subscription token or an API key?
Should I use a subscription token or an API key?
How do I rotate or replace my Anthropic credential?
How do I rotate or replace my Anthropic credential?
claude setup-token, or create a new key in the Claude Console. Then update the key on the Models page with the pencil icon. All agents pick up the new credential automatically.How do I keep my Claude key out of the agent's context?
How do I keep my Claude key out of the agent's context?
ANTHROPIC_API_KEY in the agent’s environment. The gateway injects the credential at the proxy, so the agent never holds it and can’t leak it. See How it works.