Skip to content

Anthropic API

Claude models are available two ways: through the OpenAI-compatible /v1/chat/completions endpoint like every other model, or through Anthropic's own Messages API at /v1/messages. The native endpoint accepts the same request and response shapes as api.anthropic.com, so an existing Anthropic client only needs its base URL changed.

from anthropic import Anthropic

client = Anthropic(
    base_url="https://llm.paydigital.shop",
    api_key="YOUR_KEY",
)

message = client.messages.create(
    model="claude-sonnet-4-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)

Both x-api-key and Authorization: Bearer are accepted, so the official SDKs work unmodified.

Endpoints

Endpoint Status
POST /v1/messages Available
POST /v1/messages/count_tokens Available
GET /v1/models Available
GET /v1/files, GET /v1/files/{id}, GET /v1/files/{id}/content, DELETE /v1/files/{id} Available
POST /v1/files (upload) Not available yet — see below
POST /v1/messages/batches and the rest of the Batches API Not available

What works on every Claude model

Verified against all twelve Claude models on this platform:

  • Multi-turn conversations, system prompts
  • Streaming (SSE) — content_block_delta through message_stop
  • Tool use, including tool_choice forcing a specific tool
  • Full tool round-trip — sending tool_result back and receiving the final answer
  • Vision — images as base64 in an image block
  • PDF documents — document blocks with a base64 payload
  • stop_sequences containing text
  • Token counting

What depends on the model

Three features are not uniform across models: temperature, extended thinking, and prompt caching. The per-model table is in Feature support by model — measured on this platform rather than copied from a vendor sheet.

The short version:

  • temperature is rejected by the newest models with temperature is deprecated for this model. Omit it there.
  • Extended thinking exists everywhere it is supported, but the newest models want {"type": "adaptive"} instead of {"type": "enabled"}.
  • Prompt caching works on some models, is intermittent on others, and never engages on the rest.

Not currently supported

Whitespace-only stop sequences. stop_sequences: ["\n\n"] and ["\n"] are rejected with HTTP 400 on every model:

stop_sequences: each stop sequence must contain non-whitespace

Sequences containing text — "STOP", "Observation:", "\nHuman:" — work normally. Agent frameworks that stop on a blank line need to use a marker with at least one non-whitespace character.

Message Batches. The endpoints do not exist. Requests to /v1/messages/batches return 404.

File uploads. Listing, metadata, download and delete behave as documented. Uploading a document for later reference by file_id is not available yet. Send documents inline instead — a base64 document block, as shown in Feature support by model — which works on every model today.

Prompt caching below the minimum. Anthropic does not cache a prefix shorter than 1024 tokens (2048 for Haiku). Below that, cache_control is accepted and silently ignored — the response is a normal 200 with cache_creation_input_tokens: 0. This is expected behaviour, not a failure.