Skip to main content
Anthropic-compatible drop-in endpoint. Change one line in your existing @anthropic-ai/sdk code and everything works. Requires the ai:chat scope.

Migrating from Anthropic

Request shape, response shape, streaming events, and tool use are Anthropic’s exact wire format. Your existing code, types, and tooling continue to work.

Request

The request body is identical to Anthropic’s Messages API. Key fields:

Streaming events

When stream: true, the event stream uses Anthropic’s exact wire format:
This means libraries and utilities that parse Anthropic SSE streams work without modification.

Compliance behavior

All HASP compliance checks apply — PHI Guard, BAA enforcement, credit metering — regardless of which endpoint you use. Compliance is a property of your organization, not the endpoint shape.
  • PHI Guard runs on all messages. If phi_mode=redact (default), PHI is replaced with placeholders before the upstream call. If phi_mode=block, the request returns 403 PHI_BLOCKED using the HASP error envelope.
  • BAA required. No active BAA → 402 BAA_REQUIRED on every request.
  • Credit metering. Credits are deducted after each successful response. Exhausted credits → 402 AI_CREDITS_EXHAUSTED.

Native-only flags are rejected

Parameters that exist in the native /v1/ai/chat endpoint but not in Anthropic’s wire format are rejected with 400 UNSUPPORTED_PARAMETER rather than silently accepted:
  • store — use POST /v1/ai/chat if you need stateless (no-content-storage) requests.
  • Any other non-Anthropic field.
This keeps the contract honest — if you send store: false and get a 200 back, you might wrongly assume the content wasn’t stored.

Graduating to native features

Customers using /v1/messages can migrate endpoint-by-endpoint to /v1/ai/chat to gain:
  • store: false for stateless requests
  • PHI entity metadata in responses
  • Run and conversation management
No breaking changes are required for the migration — the two endpoints are independent.

Error codes