user.anthropic(): it returns a copy of one shared Anthropic client with that user
attached. The Atlaso object builds the shared client on first use and keeps it
free of user headers. In TypeScript, pass the class once: new Atlaso({ Anthropic }).
Install atlaso with @anthropic-ai/sdk in TypeScript or anthropic in Python:
ATLASO_KEY on your server. To bring your own Anthropic client, build it
once from anthropicOptions() (Python anthropic_options()), which provide the
key and the gateway origin, and pass it per request: user.anthropic(client).
Anthropic’s clients append /v1/messages themselves, so the base URL must omit
/v1. The options also keep an unrelated ANTHROPIC_AUTH_TOKEN out of the request.
A scoped call and its receipt
max_tokens means the answer reached your max_tokens limit
and was cut off: raise the limit. memoryIds or memory_ids are facts put into
this request’s prompt. They do
not prove the model used them. The cost is a decimal string when known. A
stream may end without cost; its receipt states why.
Streams
The receipt reads the reply headers at stream start, then updates frommessage_delta.atlaso and completes on message_stop. Consume the tracked
stream, not the original stream, to keep the receipt current. The tracker
passes every Anthropic event through unchanged.
Atlaso, call
messages.with_raw_response.create(..., stream=True), then iterate
atlaso.read_receipt(raw).stream. For an async raw response, read_receipt(raw) is awaited
for consistent behavior across Anthropic client versions.
For the messages.stream() helper, read its reply headers with
receiptFromHeaders() or receipt_from_headers() once the helper connects;
this provides a headers-only receipt.
Guards and errors
anthropic() checks the gateway URL, user header, and credential on every
request. It refuses redirects. The shared base client is never changed.
TypeScript’s Anthropic client wraps a locally refused request in its
APIConnectionError; atlaso.classify(error) returns the typed Atlaso
ConfigurationError information from its cause. Python surfaces
ConfigurationError directly. Use onReceipt and onError (on_receipt and
on_error in Python) for local callbacks; they send no telemetry.
The translated Messages route supports text, images, PDF documents, tools,
thinking, prompt caching, and structured output where the selected model
supports them. The gateway rejects unsupported fields with
unsupported_parameter and an Anthropic field path. Citations, server tools,
MCP servers, batches, and count_tokens are unavailable in this version;
models.list() is also unavailable through an Anthropic client. Errors carry
the normal Anthropic error envelope plus a gateway code and request ID. See
gateway errors for codes and retry guidance.