Docs
Status
OverviewQuickstartSetup promptsThe core loopAuthenticationChatAgentOverviewModelsThe waterfallPlansAdding modelsData controlsContent moderationKYCResellersOpenAI compatibilityEmbeddingsAnthropic APIGemini APIErrorsIntegrate the gatewayCost APIRequest log APIAccount APICoding agentsSwitch gatewaysCredits & billingSpend & intelligenceSpend APITelemetryBecome a providerProvider guideAPI reference

Get started

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

Experiential Agent

  • Chat
  • Agent

Guides

  • Overview
  • Models
  • The waterfall
  • Plans
  • Adding models
  • Data controls
  • Content moderation
  • KYC
  • Resellers
  • OpenAI compatibility
  • Embeddings
  • Anthropic API
  • Gemini API
  • Errors

Integrations

  • Integrate the gateway
  • Cost API
  • Request log API
  • Account API
  • Coding agents
  • Switch gateways

Billing & usage

  • Credits & billing
  • Spend & intelligence
  • Spend API
  • Telemetry

Providers

  • Become a provider
  • Provider guide

Reference

  • API reference

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-1310.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-1310.preview.experientiallabs.ai/v1/models as the model.

POST /v1/messages
curl "https://api-pr-1310.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: true to 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-1310.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"}]}'

Retries and route selection

Messages generation accepts the same gateway.retry and gateway.routing extension as Chat and Responses. Python SDK users pass it through extra_body; disable the SDK's own retries independently withmax_retries=0. This example allows exactly one gateway generation dispatch, with no fallback or hidden repair redial.

Messages with application-owned retries
curl "https://api-pr-1310.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"
}
],
"gateway": {
"retry": {
"max_attempts_per_route": 1,
"max_total_attempts": 1,
"backoff": {
"type": "none"
}
},
"routing": {
"allow_fallbacks": false
}
}
}'

For bounded retries, configurable exponential backoff, or selecting an eligible lower rung by its opaque route_id, see the request policy guide. The extension is not valid on /v1/messages/count_tokens or batch lines. A Messages Idempotency-Key still does not create replay protection.

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 thinking config 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 are preserved on supported Anthropic and OpenRouter adapters and translated into Bedrock cache checkpoints. Generic adapters that cannot carry a marker disclose it as not forwarded; a successful request or a listed cached price does not guarantee a cache hit. The organization's prompt caching switch (Settings, Data controls) only turns the gateway's own caching off. One-hour markers are accepted and billed at the lane's one-hour cache-write rate (Anthropic: 2x input; five-minute writes are 1.25x). Usage distinguishes cache_read_input_tokens and cache_creation_input_tokens. OpenRouter's reasoning object (effort or max_tokens, plus enabled) is accepted beside thinking and 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_tokens answers 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. Its startup connectivity probe, a keyless HEAD /api/hello, answers 200 exactly as Anthropic's API does; it is not a request and needs no 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.

PreviousEmbeddingsNextGemini API