Get started/API key
API Keys & Authentication
Every public endpoint accepts the same API key in either Authorization: Bearer or x-api-key. Current Anthropic SDK/CLI versions default to Authorization: Bearer; Claude Code and older compatible clients may use x-api-key.
On this pageexpand_more
Header formatlink
Public endpoints accept Authorization: Bearer YOUR_API_KEY and the Anthropic-standard x-api-key: YOUR_API_KEY. If both headers are sent, they must contain the same key.
HTTP
# OpenAI SDKs and clients
Authorization: Bearer YOUR_API_KEY
# Anthropic SDKs and Claude Code
x-api-key: YOUR_API_KEYKey safetylink
Do not ship keys in browser code, public repositories, client bundles, or logs.
Key managementlink
Use the API page to create, pause, rename, and delete keys, and to inspect usage records.
Hosted credentialslink
When hosted credentials are enabled, that key only uses your credentials and does not fall back to the public pool.