Authentication and credential boundaries

Use existing project permissions and the credential each client needs.

Also available as Markdown · all agent guides in one file

Key points

  • Send Authorization: Bearer <key> or x-api-key. If both are sent, they must contain the same credential.
  • The key determines project attribution and billing. The server enforces account, key, model, membership and spending limits.

Regular API keys

Use a key from a project you are authorized to access. The key determines project attribution and billing; selecting a model or changing request headers does not grant project membership.

Account status, key enabled/revoked state, model restrictions, project membership and spending limits are enforced by the server. The public model catalogue is not proof that a key can use a model.

Protocol-specific requests

EndpointSend
/v1/chat/completionsmessages
/v1/responsesinput
/v1/messagesmessages and max_tokens, and set anthropic-version: 2023-06-01

Choose a model whose supported_endpoints includes the requested endpoint. Do not assume every public model is translated between all three protocols.