Gateway URL
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’sapi_keymode sends)
Supported protocols
| Protocol | Endpoint | Use for |
|---|---|---|
| Anthropic Messages API | /v1/messages | Claude models |
| OpenAI Chat Completions | /v1/chat/completions | GPT models, OpenAI-compatible clients |
| Embeddings | /v1/embeddings | Text embedding models |
SDK examples
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 finalmessage_delta event for billing.
Request attribution headers
Add these optional headers to improve analytics granularity:| Header | Description |
|---|---|
X-Wardin-Session-Id | Groups multiple requests into a session (e.g., one coding task) |
X-Wardin-Prompt-Id | Links the request to a prompt in the Prompt Registry |
X-Wardin-Prompt-Version-Id | Pins the request to a specific prompt version |
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
| Header | Description |
|---|---|
X-Wardin-Cache | Present when the response was served from cache: HIT (L1 exact match) or SEMANTIC (L2 similarity match) |