Get a Claude Admin API key

For the AI API Cost widget on your dashboard - connects to Anthropic's real usage/cost data. Read the note at the bottom: this is org-level API billing, not your personal claude.ai session limits (those have no public API, period).

Which key do you need?

Where you create the key depends on which Claude product your organization uses:

  • Claude Console (platform.claude.com - pay-per-token API org): create the key directly at platform.claude.com/settings/admin-keys (Organization settings → Admin keys). Prefix sk-ant-admin01-.... Only organization members with the admin role can create one.
  • Claude Enterprise (claude.ai organization): create the key at claude.ai → Organization settings → API. Prefix sk-ant-api01-.... Only the parent organization's primary owner (or an organization owner, scoped to Compliance API only) can create one.

A key created in one organization cannot manage the other. If your company uses both, you need one key per organization.

Create a Claude Console key

  1. Sign in as an organization member with the admin role.
  2. Go to platform.claude.com/settings/admin-keys - under Organization settings.
  3. Click Create key, name it, pick an expiration, click Create. Console keys have no selectable scopes - every key gets full access to every Admin-key-based API.
  4. Copy the secret (starts with sk-ant-admin01-) into your secrets manager. It's shown only once.

Create a Claude Enterprise key

  1. Sign in as the primary owner (or an organization owner, for Compliance-only scopes).
  2. Go to claude.ai → Organization settings → API Keys.
  3. Click + Create key, name it, and select every scope the APIs you plan to call need (e.g. read:analytics for usage/cost reporting). Scopes are fixed at creation - add a scope later by creating a new key.
  4. Copy the secret (starts with sk-ant-api01-) into your secrets manager. It's shown only once.

Using the key

Pass it in the x-api-key header on requests to the Usage and Cost API (token/cost breakdowns by model, workspace, API key) or the Claude Code Analytics API (per-user sessions, lines of code, commits, tool accept/reject rates, estimated cost - daily aggregated, up to 1hr delayed). A request that exceeds the key's scopes returns 403listing what it has vs. what's needed.

What this key does not give you

This key powers Astrodesk's AI API Costwidget - real today/month spend and token counts, pulled live from Anthropic's Usage & Cost API. It does not give you the Session (5hr) / Weekly (7-day)percentages and reset countdowns from your personal claude.ai account's usage page - that belongs to your individual Pro/Max/Team subscription plan and has no public API at all, Admin key or otherwise. The Admin API also requires an organization - it's unavailable for individual accounts entirely.

For a live per-user team dashboard (sessions, lines of code, commits, cost by developer - not the session/weekly % bars), the Claude Code Analytics API linked above is the real path, using the same key.