Docs
Status
OverviewQuickstartSetup promptsThe core loopAuthenticationOverviewModelsThe waterfallAdding modelsAnthropic APIErrorsIntegrate the gatewayCost APIAccount APICoding agentsCredits & billingSpend & intelligenceTelemetryAPI reference

Get started

  • Overview
  • Quickstart
  • Setup prompts
  • The core loop
  • Authentication

Guides

  • Overview
  • Models
  • The waterfall
  • Adding models
  • Anthropic API
  • Errors

Integrations

  • Integrate the gateway
  • Cost API
  • Account API
  • Coding agents

Billing & usage

  • Credits & billing
  • Spend & intelligence
  • Telemetry

Reference

  • API reference
PreviousAdding modelsNextErrors

Guides

Anthropic API

The gateway serves the Anthropic Messages API at /v1/messages, so the Anthropic SDKs and Claude Code work against it unchanged. It is a translation onto the same chat surface, so every catalog model is reachable, not just Claude.

The endpoint

POST https://api-pr-1793.preview.experientiallabs.ai/v1/messages speaks the Anthropic Messages wire protocol. Authenticate with the Anthropic-style x-api-key header or with Authorization: Bearer, either carries the same xpl_ key. Name any slug from GET https://api-pr-1793.preview.experientiallabs.ai/v1/models as the model.

POST /v1/messages
curl "https://api-pr-1793.preview.experientiallabs.ai/v1/messages" \
-H "x-api-key: $EXPLABS_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model": "qwen3.8-27b", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'

Streaming

Set stream: trueto receive Anthropic's server-sent event stream (message_start, content_block_delta, message_stop, and the rest), exactly as the Anthropic SDKs expect.

Streaming
curl -N "https://api-pr-1793.preview.experientiallabs.ai/v1/messages" \
-H "x-api-key: $EXPLABS_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model": "qwen3.8-27b", "max_tokens": 1024, "stream": true, "messages": [{"role": "user", "content": "Hello"}]}'

Translation lane limits

The lane maps onto the gateway's shared chat surface, so a few Anthropic features are route-scoped. Where a route cannot express something, the gateway translates or drops it with a disclosure instead of failing the request; only signed provider state is rejected:

  • Extended thinking works on all-Anthropic routes: the thinkingconfig passes through verbatim and thinking/redacted-thinking history blocks round-trip with signatures intact. On a non-Anthropic reasoning route the config translates to the route's nearest reasoning effort (disclosed as thinking->reasoning_effort:<tier>; a bare thinking: {type: enabled} is accepted and reads as the default depth; an explicit output_config.effort wins with thinking->dropped(superseded_by_effort)), and on a route with no reasoning it is dropped with a disclosure. Block-level cache_control markers on a non-Anthropic route are disclosed as not_forwarded(provider_decides_caching): there is no field to forward, the provider caches on its own, and cache reads still bill at the cached rate. OpenRouter's reasoning object (effort or max_tokens, plus enabled) is accepted beside thinkingand wins when both are present. On a reasoning-exposed non-Anthropic rung the model's own reasoning streams as an unsigned thinking block (tool turns carry it sealed in a trailing redacted_thinking block) and replays on the next turn; Anthropic-signed thinking blocks replayed onto a non-Anthropic route are dropped with the messages.thinking->dropped(unsupported_by_provider) disclosure instead of a 400.
  • Image blocks are served on every route whose model accepts images, up to 100 per request. Document (PDF) blocks need a document-capable route; otherwise a 400 names messages and suggests a capable alias.
  • tool_result.is_error=true is native on Anthropic rungs and folds into the result text on every other wire (disclosed), so a failed tool call never ends a session.
  • Idempotency-Key is not honored on this lane (Anthropic defines none).
  • /v1/messages/count_tokensanswers with the gateway's own token estimate for the route (the response discloses that it is an estimate, not the provider's count); per-turn usage on the stream is the authoritative figure.
Errors on /v1/messages use Anthropic's envelope, {"type":"error","error":{"type":"invalid_request_error","message":"..."}}, at the same HTTP statuses as the OpenAI routes. Branch on the status and the Anthropic error type; the underlying meanings match the Errors table.

Claude Code and other agents

Claude Code connects through this same lane by pointing ANTHROPIC_BASE_URL at the gateway and passing an xpl_ key as ANTHROPIC_API_KEY. The per-agent configuration is in Coding agents.

See also

Prefer the OpenAI protocol? The Quickstart covers Chat Completions and the Responses API. The full surface is in the API reference.