Via API Key
Via API Key
Claude API Key can be used to control cost and usage for Claude Code. Useful for production-use-cases and automated systems.
- The token is generated at https://platform.claude.com — "Create API key" (choose Workspace, name the key) → "Save your API key" (shown once, copy it) → can be selected during
/loginas method "2. Anthropic Console account". - Set it as an env var:
ANTHROPIC_API_KEY=sk-ant-api03-...
To use the API you need to purchase credits:
- "Credit balance" page (Organization → Billing) shows remaining balance, charged-to payment method, "Buy credits", auto-reload status; can also pay after-the-fact with monthly invoicing by contacting the Anthropic accounts team.
- "Add credits" dialog: enter an amount ($5–$100 for Tier 1, limit increases with usage), optional auto-reload credits (reload amount + target balance), shows subtotal/taxes/total. Credits are consumed with API, Claude Code, and Workbench usage, and expire 1 year after purchase.
Related: Authenticating Claude Code, Status and Keys, Cost