Anthropic API key の取得:Console 登録・Billing・Messages API curl

Console 登録、Billing、API key、Messages curl、レート/Spend 制限を公式情報で整理。

To call the Claude Messages API from code, you usually need a console.anthropic.com (Claude Console) organization, billing enabled, and an Anthropic API key—separate from a claude.ai Claude Pro chat subscription.

This page follows Anthropic’s official docs (docs.anthropic.com Get started, API overview, Rate limits) and Help Center for Console signup, Billing, creating an API key, your first Messages API curl, and rate or spend limits.

Console accountEnable billingAPI key · first curl

Console account vs claude.ai

REST
api.anthropic.com
Console
Keys · billing · Playground
Pro
claude.ai ≠ API usage

The API overview says the Claude API is a REST API at https://api.anthropic.com. Prerequisites include a Claude Console account and an API key (or Workload Identity Federation). The Console is where you create keys, add teammates, set up billing, and try the Playground; API access is subject to the Commercial Terms of Service (Help Center).

Do not use shared Console accounts or resold keys to bypass official billing.

EntryPurposeOfficial source
console.anthropic.comAPI keys, Billing, Rate limitsdocs.anthropic.com — Getting started
claude.aiChat, Projects, ArtifactsBilled separately from Console API
Messages APIPOST /v1/messagesdocs.anthropic.com — API overview

Turn on Billing in the Console

  1. 1

    Create a Console organization

    Open console.anthropic.com and register with your own email. Help Center text says the Console is where you create API keys, add users, set up billing, and use the playground. Follow any verification prompts on the live site.

  2. 2

    Open Settings → Billing

    Rate limits docs: in the Claude Console go to Settings > Billing to view your organization’s monthly spend cap and use Adjust limit / Set limit under Spend limits.

  3. 3

    Add a legitimate payment method

    Complete checkout on the Billing page. API usage is metered. Rate limits docs list tier monthly spend caps: Start $500 USD, Build $1,000, Scale $200,000; Custom tiers are arranged with Anthropic. Hitting the tier cap pauses API usage until 00:00 UTC on the first day of the next month unless you move to a higher tier.

  4. 4

    Check Rate limits and Usage

    The Console Rate limits page shows your tier and RPM/ITPM/OTPM. The Usage page tracks tokens and cache hits. Use Request rate limit increase on the Rate limits page when you need more headroom (per docs).

Create an Anthropic API key

  1. 1

    Open API keys

    Getting started: generate API keys in Console Account Settings (section Get your Claude API key). You can also manage keys from the Console API keys navigation.

  2. 2

    Pick key type and expiration

    API overview: choose each key’s type and expiration at creation. Use workspaces to separate environments; multi-workspace keys may require the anthropic-workspace-id header (Authentication docs).

  3. 3

    Copy the secret once

    The full secret is typically shown only once. Store it in a password manager or secret store—never commit to Git or share. For local dev: export ANTHROPIC_API_KEY=... (Get started).

  4. 4

    Console keys vs Admin API

    Admin API GET /v1/organizations/api_keys/{id} is for org-level programmatic key management with an Admin API key and never returns the secret. Day-to-day development uses keys created on the Console API keys page.

First Messages API curl

Official Get started example: export the key, then POST to Messages. Required headers include content-type: application/json, x-api-key (or Authorization Bearer), and anthropic-version: 2023-06-01.

export ANTHROPIC_API_KEY="your-api-key-here"

curl https://api.anthropic.com/v1/messages \
  -H "content-type: application/json" \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-opus-5",
    "max_tokens": 1000,
    "messages": [
      {
        "role": "user",
        "content": "What should I search for to find the latest developments in renewable energy?"
      }
    ]
  }'

On success you get JSON with assistant content text blocks and a usage object (Get started response sample). Model IDs follow the live Console and Models API list.

01

401 / 403

Verify the key, workspace binding, and that billing is active. Authentication docs list required headers.

02

400 invalid_request

Often missing JSON fields or a wrong model name. See Messages API reference for required params.

03

413 request_too_large

API overview caps Messages requests at 32 MB. Split work or use the Message Batches API for large jobs.

Rate limits and spend caps

Rate limits docs define Spend limits (monthly API cost caps) and Rate limits (RPM, ITPM, OTPM). Organizations sit on Usage tiers (Start / Build / Scale / Custom); new orgs may start in an Evaluation tier with lower caps until usage history builds.

Limit typeMeaningWhen hit
RPM / ITPM / OTPMRequests and tokens per minuteHTTP 429 with retry-after
Tier spend capMonthly org API spend maximumHTTP 429, enforced_spend_limit_reached, no retry-after
Custom spend limitYour lower cap on BillingHTTP 400 invalid_request_error

The API uses a token bucket algorithm; short bursts can still 429. Limits apply per model. The Start tier standard table lists Claude Opus 5 at 1,000 RPM, 2,000,000 ITPM, 400,000 OTPM—confirm live values on your Console Rate limits page. For most models, cached read tokens do not count toward ITPM.

When you need a team whiteboard after an API prototype, wbstorm is a room ID—see 部屋の作成と参加. For Claude Pro chat, see Claude Pro guide; for Cursor rules, how to write Cursor rules.

Does Claude Pro include the API?

No. Claude Pro is the claude.ai subscription; Console API usage is billed separately per Anthropic pricing and help pages.

Is my 429 rate or billing?

Both can return 429. Rate limit docs: RPM/ITPM/OTPM overages include retry-after; tier monthly spend cap uses error_code enforced_spend_limit_reached without retry-after.

Can I put the key in a browser app?

No. Use keys only on servers or secure local environments. Rotate or revoke leaked keys in the Console immediately.

Is this a wbstorm feature?

No. This article covers Anthropic Console and the Claude API only. wbstorm is a browser brainstorm room unrelated to API keys.

無料で会議を開始