inference-providers

Anthropic

first_party

DocsConsoleStatusPricing

Getting credentials

api-key

api_key via header (header x-api-key)

Key prefix: sk-ant-api

Environment: ANTHROPIC_API_KEY

Extra headers: anthropic-version: 2023-06-01

Console → Settings → API Keys. Keys are org-scoped; optional expiry (3h to never).

Credentials docs

oauth

oauth via header (header x-api-key)

Extra headers: anthropic-beta: oauth-2025-04-20 anthropic-version: 2023-06-01

Flow: authorization_code_pkce

Scopes: org:create_api_key user:profile user:inference

Token transport: header

Run Claude Code and sign in with a Claude subscription; OAuth tokens are sent via x-api-key (not Bearer).

Credentials docs

Endpoints

IDURLProtocolAuth
v1-messageshttps://api.anthropic.com/v1/messagesanthropic-messagesany
v1-messages-batcheshttps://api.anthropic.com/v1/messages/batchesanthropic-messagesany

API surfaces

textstreamingbatchcount_tokensprompt_cachingfiles

Quirks

Models offered

ModelWire IDEndpointStatusReasoning
anthropic/claude-fable-5claude-fable-5v1-messagesgaadaptive · default adaptive · mandatory · returns thinking_blocks · round-trips signature
anthropic/claude-haiku-4-5claude-haiku-4-5v1-messagesgabudget · default on · returns thinking_blocks · round-trips signature
anthropic/claude-opus-5claude-opus-5v1-messagesgaadaptive · default adaptive · returns thinking_blocks · round-trips signature
anthropic/claude-sonnet-5claude-sonnet-5v1-messagesgaadaptive · default adaptive · returns thinking_blocks · round-trips signature