Skip to main content
The Wardin gateway speaks the Anthropic Messages API format. Point any compatible SDK at the gateway URL and swap in your virtual key — no other code changes.

Gateway URL

https://gw.wardin.ai

Authentication

The gateway accepts your virtual key in either header, so SDK defaults just work:
  • Authorization: Bearer wardin_sk_... (canonical — what the OpenAI SDK and most tools send)
  • x-api-key: wardin_sk_... (what the Anthropic SDK’s api_key mode sends)

Supported protocols

ProtocolEndpointUse for
Anthropic Messages API/v1/messagesClaude models
OpenAI Chat Completions/v1/chat/completionsGPT models, OpenAI-compatible clients
Embeddings/v1/embeddingsText embedding models

SDK examples

curl https://gw.wardin.ai/v1/messages \
  -H "Authorization: Bearer wardin_sk_YOUR_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Streaming

Streaming works without any changes. The gateway transparently forwards server-sent events (SSE) from the provider to your client. Token usage is parsed from the final message_delta event for billing.
with client.messages.stream(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Tell me a story"}],
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)

Request attribution headers

Add these optional headers to improve analytics granularity:
HeaderDescription
X-Wardin-Session-IdGroups multiple requests into a session (e.g., one coding task)
X-Wardin-Prompt-IdLinks the request to a prompt in the Prompt Registry
X-Wardin-Prompt-Version-IdPins the request to a specific prompt version
If X-Wardin-Session-Id is not provided, the gateway groups requests using idle-timeout bucketing (30-minute sliding window). See Sessions. User attribution comes from the virtual key’s owner — issue one key per developer rather than sharing keys.

Response headers

HeaderDescription
X-Wardin-CachePresent when the response was served from cache: HIT (L1 exact match) or SEMANTIC (L2 similarity match)

Health check

curl https://gw.wardin.ai/health
# {"status":"ok"}