Claude API key

Create a Claude API key in the Claude Console under API keys; it starts with sk-ant- and shows only once [1]. A Straitly key also works in Anthropic's SDK: set ANTHROPIC_BASE_URL to https://api.straitly.ai and ANTHROPIC_API_KEY to it [4][7]. Claude Fable 5.2 lists at $8.00 per 1M input tokens and $40.00 per 1M output tokens on Anthropic. [5]

Updated

export ANTHROPIC_BASE_URL="https://api.straitly.ai"
export ANTHROPIC_API_KEY="sk-YOUR_KEY"
from anthropic import Anthropic

client = Anthropic()  # reads both variables
reply = client.messages.create(
    model="claude-fable-5.2",
    max_tokens=16000,  # thinking counts toward this
    messages=[{"role": "user", "content": "Hello"}],
)
for block in reply.content:
    if block.type == "text":
        print(block.text)

What is the difference between an Anthropic key and a Straitly key?

Both call Claude in Anthropic's Messages format, so your code stays the same. The Straitly key also calls other labs.

DetailAnthropic keyStraitly key
Where you create itAPI keys page in the Claude Console [1]API keys page after you sign up [6]
What it looks likeStarts with sk-ant-, shown once at creation [1]Starts with sk- [6]
Base URL for Anthropic's SDKhttps://api.anthropic.com, the default [2]https://api.straitly.ai [7]
How it is sentAuthorization: Bearer plus anthropic-version; SDKs read ANTHROPIC_API_KEY [2][4]Authorization: Bearer, or Anthropic's SDK with your Straitly key [6][7]
Models it callsClaude models [5]Claude and other labs, 117 models [11]
How you payPer token, on your Console organization [3][5]Per token, from prepaid credits. No subscription, no minimum [10]
Limits to startSet by usage tier; new organizations may start below the standard limits, and each tier has a monthly spend cap [3]300 / minute to start, 64 requests in flight, shared across keys [8]
One key per appPersonal or service account keys, optionally scoped to a workspace [1][2]Child keys, each with its own budget and rate limit [9]

How do I get a Claude API key from Anthropic?

Four steps in the Claude Console, from Anthropic's own guide [1]. If the Create key button is greyed out, your role cannot make keys; ask an organization admin.

  1. Sign in to the Claude Console

    Sign up at platform.claude.com, or sign in to the account you have [1].

  2. Open the API keys page

    It is at platform.claude.com/settings/keys [1].

  3. Create the key

    Name it, pick an expiration and a linked account, and scope it to a workspace if you use them [1].

  4. Copy it once and store it

    Save the sk-ant- key in a secrets manager or as ANTHROPIC_API_KEY. The Console will not show it again [1][4].

How do I use a Straitly key in place of a Claude API key?

Change two settings and keep the rest of your code. The same key calls all 117 models [11].

  1. Create a key

    Sign up, add prepaid credits, and create a key on the API keys page [6][10].

  2. Point Anthropic's SDK at Straitly

    Set ANTHROPIC_BASE_URL to https://api.straitly.ai, with no /v1; the SDK adds /v1/messages itself [4][7].

  3. Set the key

    Put your Straitly key in ANTHROPIC_API_KEY. The OpenAI SDK works too, with base URL https://api.straitly.ai/v1 [6][7].

How do I make my first Claude API call?

Send a Messages request with the key as a bearer token. Read the text from the content blocks; token counts are in usage [7].

curl https://api.straitly.ai/v1/messages \
  -H "Authorization: Bearer $STRAITLY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-sonnet-5-5",
    "max_tokens": 256,
    "messages": [{"role": "user", "content": "Say hello in one sentence."}]
  }'

A 429 carries Retry-After: wait that long, then retry [8]. Keep the key on your server, never in browser code or a public repository [7].

Which Claude models does the key call, and what do they cost?

Every current Claude line, newest first, from the live catalog. Cache, batch and long-context rates are on Claude API pricing.

USD per 1M tokens, input / output

ModelReleasedContextModel IDAnthropic list price
Claude Fable 5.2Anthropic9 Nov 20261Mclaude-fable-5.2$8.00 / $40.00
Claude Haiku 5.5Anthropic7 Oct 20261Mclaude-haiku-5-5$0.10 / $0.50
Claude Sonnet 5.5Anthropic28 Sep 20261Mclaude-sonnet-5-5$2.00 / $10.00
Claude Opus 5.5Anthropic22 Sep 20261Mclaude-opus-5-5$4.00 / $20.00

From the live catalog on 25 November 2026 [11]. Each model's rate is on its own page. List prices are Anthropic's own, matched on its pricing page on 24 November 2026 [5]. Where a maker sells a model at more than one rate, the list price shown is the lowest one it sells for live calls outside mainland China, and the model's page says which.

What else do people ask about Claude API keys?

Ask a question
  • No. A Claude plan is a claude.ai login. The Claude API needs a Claude Console account and an API key, billed per token [2][5]. A Straitly key is also billed per token, from prepaid credits [10].
  • With an Anthropic key, set ANTHROPIC_API_KEY and approve the key once when Claude Code asks. To run it on Straitly, set ANTHROPIC_BASE_URL to https://api.straitly.ai and ANTHROPIC_AUTH_TOKEN to your Straitly key [14]. The Claude Code API page has the details and what changes [13], and the setup guide has a one-paste setup.
  • Create a new one. Anthropic shows a key only once, at creation, and it cannot be viewed again in the Console [1]. Revoke the old key if it may have leaked. The same goes for a Straitly key: create a new key on the API keys page and revoke the old one [6].
  • No. Zero data retention is on by default for every account and key: prompts and completions are never written to disk or logs and never used for training. Only billing metadata is kept: timestamp, model, key, token counts, latency, status and the amount charged [12].
  • You pay per token at each model's rate, from prepaid credits, with no subscription and no minimum. A failed request costs nothing. Each model's current rate is on its own page at straitly.ai/models. Claude Fable 5.2 lists at $8.00 per 1M input tokens and $40.00 per 1M output tokens on Anthropic. That is Anthropic's list price, matched on 24 November 2026. [5][10][11]

Sources

Last updated 23 November 2026. Anthropic's Console and docs change often. If something here is out of date, tell us at straitly.ai/contact.

  1. [1]Anthropic docs: get your Claude API keyplatform.claude.com, checked 23 November 2026
  2. [2]Anthropic docs: API overviewplatform.claude.com, checked 23 November 2026
  3. [3]Anthropic docs: rate limitsplatform.claude.com, checked 23 November 2026
  4. [4]Anthropic docs: Python SDKplatform.claude.com, checked 23 November 2026
  5. [5]Anthropic pricingplatform.claude.com, checked 23 November 2026
  6. [6]Straitly quickstartstraitly.ai/docs/quickstart, checked 23 November 2026
  7. [7]Straitly endpointsstraitly.ai/docs/endpoints, checked 23 November 2026
  8. [8]Straitly errors and limitsstraitly.ai/docs/errors, checked 23 November 2026
  9. [9]Straitly child keysstraitly.ai/docs/child-keys, checked 23 November 2026
  10. [10]Straitly pricingstraitly.ai/pricing, checked 23 November 2026
  11. [11]Straitly modelsstraitly.ai/models, checked 25 November 2026
  12. [12]Straitly data retentionstraitly.ai/docs/data-retention, checked 23 November 2026
  13. [13]Claude Code APIstraitly.ai/claude-code-api, checked 23 November 2026
  14. [14]Claude Code docs: connect to an LLM gatewaycode.claude.com, checked 23 November 2026
What each source says
Anthropic docs: get your Claude API key
Keys live on the API keys page of the Claude Console. Create key, name it, pick an expiration and linked account. The full key starts with sk-ant- and is shown only once, at creation; a lost key cannot be viewed again, so create a new one.
Anthropic docs: API overview
The Claude API is at https://api.anthropic.com. Requests need a Console account and an API key, sent as Authorization: Bearer (x-api-key is a legacy fallback, still supported), plus anthropic-version. Workspaces separate environments; a key not scoped to a workspace also sends anthropic-workspace-id.
Anthropic docs: rate limits
Limits are set per organization by usage tier and measured in requests, input tokens and output tokens per minute. New organizations may start in an Evaluation tier below the standard limits. The Start, Build and Scale tiers each carry a monthly spend cap.
Anthropic docs: Python SDK
The client reads ANTHROPIC_API_KEY, and the ANTHROPIC_BASE_URL environment variable sets the base URL.
Anthropic pricing
Anthropic's own per-token prices for every Claude model. The list prices on this page are the ones matched on it on 24 November 2026; it was opened again on 23 November 2026 and showed the same rates.
Straitly quickstart
Create a key on the API keys page and keep it in an environment variable. Auth is Authorization: Bearer sk-.... OpenAI /chat/completions and Anthropic /messages formats.
Straitly endpoints
Base URL https://api.straitly.ai/v1. The Anthropic SDK takes https://api.straitly.ai and adds /v1/messages itself; the OpenAI SDK takes the full base URL. Keep the key on your server, not in browser code or a public repository.
Straitly errors and limits
Default account limits, shared across keys; rate-limit answers carry Retry-After. Accounts can have custom limits.
Straitly child keys
Give each app or customer its own key with its own budget, rate limit and history, all billed to your prepaid balance.
Straitly pricing
Billed per token from prepaid credits. Nothing is added on top. A failed request costs nothing. No subscription and no minimum.
Straitly models
Every model on Straitly with its ID, context window and current rate, from the live catalog.
Straitly data retention
Zero data retention on by default for every account and key; prompts and completions never written to disk or logs and never used for training; only billing metadata is kept.
Claude Code API
How Claude Code runs on an API key or a gateway base URL instead of a subscription, from Anthropic's Claude Code docs.
Claude Code docs: connect to an LLM gateway
Point Claude Code at a gateway with ANTHROPIC_BASE_URL. ANTHROPIC_AUTH_TOKEN is sent as Authorization: Bearer; ANTHROPIC_API_KEY is sent as X-Api-Key and asks you to approve it once. If you were not told which kind, use ANTHROPIC_AUTH_TOKEN.

Get a key and send one request.

Prepaid, per token, no subscription and no minimum.