1. Base URL and authentication
Every request goes to the gateway endpoint with your workspace API key as a Bearer token. Keys are issued on the Command Center API Keys panel and look like gw-live-….
- Base URL:
https://sentinelgateway.ai/v1 - Auth header:
Authorization: Bearer YOUR_API_KEY - Endpoint:
POST /v1/chat/completions(streaming and non-streaming)
2. First request with cURL
curl https://sentinelgateway.ai/v1/chat/completions \
-H "Authorization: Bearer $SENTINEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Ping"}]
}'
3. Drop-in SDK snippets
Python
from openai import OpenAI
client = OpenAI(
base_url="https://sentinelgateway.ai/v1",
api_key=os.environ["SENTINEL_API_KEY"],
)
resp = client.chat.completions.create(
model="claude-3-5-haiku-20241022", # any routable model
messages=[{"role": "user", "content": "Ping"}],
)
print(resp.choices[0].message.content)
Node / TypeScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://sentinelgateway.ai/v1",
apiKey: process.env.SENTINEL_API_KEY,
});
const resp = await client.chat.completions.create({
model: "llama-3.3-70b-versatile",
messages: [{ role: "user", content: "Ping" }],
});
Model routing is prefix-based: gpt-*/o1-*/o3-* go to OpenAI, claude-* to Anthropic, llama-*/mixtral-*/gemma-* to Groq, and gemini-* to Gemini. The response always carries the model that actually served the request.
4. Gateway headers
| Header | Direction | Behavior |
|---|---|---|
X-Fallback-Model |
Request | Model to serve from when the primary provider fails transiently (429, 5xx, timeout). Deterministic 4xx errors are never masked. |
X-Sentinel-Original-Model |
Response | Present on fallback responses; the model you originally requested, when a different one served the call. |
Cache-Control: no-cache |
Request | Skips all cache reads and writes for the request. |
X-Sentinel-Cache: false |
Request | Gateway-specific equivalent of no-cache for non-HTTP-native clients. |
5. Error codes
| Status | Type | Meaning |
|---|---|---|
400 | invalid_request_error | Malformed JSON body or an unconfigured provider key for the requested model. |
401 | authentication_error | Missing or invalid API key. |
403 | unverified_email | Free-tier key inactive until the account email is verified. |
429 | quota_exceeded | Monthly token quota exhausted. The body includes an upgrade_url for one-click plan upgrades. |
429 | rate_limit_exceeded | Per-key request velocity or daily token velocity exceeded; resets automatically. |
503 | service_unavailable | Transient gateway dependency unavailable (fail-closed quota gate). Safe to retry with backoff. |
Retry guidance: retry 429 rate_limit_exceeded and 503 with exponential backoff. Do not retry 401/403, and treat 429 quota_exceeded as a billing signal, not a transient error.
6. Where to go next
- Designing a zero-downtime fallback pipeline — the architecture behind the router.
- Redis vector caching — how the semantic cache decides a hit.
- PII scrubbing — what gets masked before prompts leave the gateway.
- Create a free workspace — 10,000 tokens a month, no credit card.