provider

Anthropic Claude

Direct answerDirect Anthropic Messages calls require x-api-key and anthropic-version. This site recommends Bearer and also accepts native x-api-key on /v1/messages; an HTTP 200 stream can still carry an error event.

Updated · Reviewed

Official positioning

Anthropic provides text, image understanding, reasoning, coding, and tool use through Claude models and Messages API. The official model overview publishes context, maximum output, and lifecycle details; thinking, vision, caching, batching, and tool capabilities must be checked per model.

Messages protocol structure

Messages uses top-level system, messages with user or assistant roles, and typed content[] blocks; max_tokens is required. A client tool call returns tool_use; the application validates and executes it, then returns tool_result with the same ID. Model output is not application authorization.

Direct versus gateway authentication

Direct Anthropic REST requires an Anthropic-issued key in x-api-key plus anthropic-version. This site recommends Authorization: Bearer with a site-issued key on /v1/messages and also accepts the site key in x-api-key. Configure base URL, credential, and headers together, and never send an Anthropic key to this gateway.

Streaming and error handling

Messages streams contain message/content-block start, delta, and stop events, plus possible ping, unknown events, and an in-stream error after HTTP 200. Mark complete success only after message_stop, and preserve request ID, stop reason, and usage. Retry only transient 429 and 5xx conditions confirmed to be temporary.

Workloads and production checks

Claude fits long-document analysis, complex code changes, research and enterprise knowledge work, and agents with repeated tool loops. Before production, verify the exact model ID, context, maximum output, stop reasons, rate limits, retention, geography, and retirement dates, then contract-test system placement, content blocks, tool results, and stream events.

Reviewed provider catalog

Latest models by capability

These are provider-catalog models, not a promise of availability on this site. Confirm callable IDs, endpoints, and pricing in the model marketplace.

Text, reasoning, and code

Check live availability in the model marketplace

Use cases

  • Long-running agent tasks
  • Complex coding workflows
  • Enterprise knowledge work

API protocols

  • /v1/messages

FAQ

Which authentication headers do direct Anthropic and this gateway require?

Direct Anthropic REST requires an Anthropic-issued key in x-api-key plus anthropic-version. This site recommends Authorization: Bearer and also accepts a site key in x-api-key on /v1/messages. Do not mix the two providers' keys.

Should a Claude system prompt be placed in messages?

No. Messages API uses the top-level system field, while input message roles are user or assistant. Preserve this structure on the gateway's Claude-native route.

Does Claude execute a tool automatically after returning tool_use?

Client tools do not. The application validates the name and arguments, performs a controlled action, and returns tool_result with the same ID. Anthropic server tools such as Web Search have a different execution boundary.

Why can a Claude stream fail after HTTP 200?

SSE can carry an in-stream error after the connection starts. Handle ping, unknown events, error, and a disconnect before message_stop instead of marking success from HTTP 200 alone.

Does a full Claude context window always return 400?

No. An oversized input can return 400, while selected newer models can return a successful message with model_context_window_exceeded as stop_reason when generation reaches the window.

Official sources

  1. Claude Model Overview Official
  2. Claude API Overview Official
  3. Anthropic Get Started Official
  4. Anthropic Create a Message Official
  5. Anthropic Tool Use Official
  6. Anthropic Streaming Messages Official
  7. Claude API Errors Official
  8. Claude Stop Reasons Official
  9. Claude API Rate Limits Official