Start today, with free test keys
Create a project, choose where its data is processed and change two lines of code.
- Free test keys (simulated responses)
- Real models prepaid or invoiced
- A signed route record on every served response
Developers
Point the OpenAI or Anthropic SDK, your framework or your coding agent at Situra’s URL, use a situ_ key, and each project enforces its residency tier.
For engineering, platform, data and ML teams integrating language models through an API.
- base_url="https://api.openai.com/v1",
+ base_url="https://api.situra.ai/v1",
- api_key=os.environ["OPENAI_API_KEY"],
+ api_key=os.environ["SITURA_API_KEY"], # situ_… Connected today Today: Gemini on Google Vertex AI, on the EU route. Planned, not connected: Anthropic, OpenAI and Mistral AI.
Works today
/v1/chat/completions/v1/models/v1/messages (Anthropic)streamingtoolsimage input/v1/embeddings** /v1/embeddings is implemented; embedding models are still to be confirmed in production.
Not yet (404)
Service status Guide: how to move from the OpenAI API to an EU route
Gateway URLhttps://api.situra.ai
In the Situra console, with your work email. Test keys (situ_test_) work straight away, before your organisation is verified. Live keys (situ_live_) work once the Situra team has activated your organisation (a person does it once your EU VAT number is validated and there is a business check or a completed payment) and, on prepaid, it has credit (or you have an invoiced account). We do not publish an activation time yet.
Choose its residency tier (EU, global or Spain) and logging mode. Residency applies to every key in the project. The Spain tier has no route today: its requests are refused (503 no_route).
ESEUGlobal
With an expiry and, optionally, a model allowlist. The secret is shown once: put it in your secret manager.
In your SDK. If you call a GPT or Claude model today, also change the model to gemini-2.5-flash or gemini-2.5-pro: GPT and Claude routes are planned, not connected.
The samples use gemini-2.5-flash, which answers in production today (Gemini on Google Vertex AI, EU route). GET /v1/models returns the models your project may use, given its tier; the model catalogue shows routes and prices per tier. By family: Gemini API in the EU (available today), Claude API in Europe and OpenAI API (GPT) in Europe (planned).
Frameworks such as LangChain, LlamaIndex, the Vercel AI SDK or LiteLLM connect through their OpenAI-compatible client, set to this base URL and key. We do not maintain framework-specific integrations.
The x-situra-residency header is optional and can only tighten the project’s tier, never loosen it.
Planned: Claude Code needs Claude models, and Claude routes are not connected yet (today Situra serves Gemini on Vertex AI). Claude Code sends the key as Authorization: Bearer; Situra also accepts x-api-key. Pin the models with the ANTHROPIC_*_MODEL variables: by default Claude Code asks for dated IDs (claude-haiku-4-5-20251001) that Situra does not recognise. The models must be allowed in the project, and the project’s tier decides where they run.
The console playground sends real requests through the gateway with one of your keys and shows the residency, route, latency and cost of every response.
Coding agents send a lot of context: source code, paths, sometimes secrets. Routing them through Situra applies the project’s residency, budgets and metadata logging just like any other application. Tools that accept an OpenAI-compatible base URL work the same way. Planned: Claude Code needs Claude models, whose routes are not connected yet; today Situra serves Gemini on Vertex AI. Residency options per provider: Claude API in Europe and OpenAI API (GPT) in Europe.
# Planned: Claude routes are not connected yet.
# This setup works once they are.
export ANTHROPIC_BASE_URL="https://api.situra.ai"
export ANTHROPIC_AUTH_TOKEN="situ_live_…" # key for the “agents” project
export ANTHROPIC_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-6"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5" The /v1/messages endpoint accepts the key in x-api-key, like Anthropic’s API.
curl https://api.situra.ai/v1/messages \
-H "x-api-key: $SITURA_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello"}]
}' situ_test_ keys are served by a sandbox built into the gateway: deterministic responses, realistic token counts and zero cost. They work even while your organisation is pending verification, so you can connect your tests on day one.
export SITURA_API_KEY="situ_test_…"
# The same code as before. With a test key:
# - the built-in sandbox answers with simulated, deterministic responses
# - with realistic token counts
# - zero cost, and records flagged as sandbox
python app.py What changes from the provider’s SDK is the base URL and the key, and today the model if you call one Situra does not serve. Everything else (bodies, streaming, tools, images, errors) follows the OpenAI or Anthropic format.
| Item | Value |
|---|---|
| Base URL, OpenAI SDK | https://api.situra.ai/v1 (base_url / baseURL, or OPENAI_BASE_URL) |
| Base URL, Anthropic SDK | https://api.situra.ai, without /v1: the SDK adds it (ANTHROPIC_BASE_URL for Claude Code) |
| Authentication | Authorization: Bearer situ_… or x-api-key: situ_…. If you send both, they must match |
| Key types | situ_live_… calls real models once the organisation is active; situ_test_… is served by the sandbox (simulated responses, zero cost) |
| Residency per request | x-situra-residency accepts es, eu or global (case-insensitive). It only tightens the project tier for that request: a value equal to or looser than the project’s tier (for example global) is accepted and ignored. Anything else returns 400 invalid_residency |
| Available models | GET /v1/models lists the models the key and project may use with at least one route allowed in their tier. Today that is Gemini on Google Vertex AI; the other providers are planned, not connected |
| Attestation public keys | https://api.situra.ai/.well-known/situra-attestation-keys (JWKS, no authentication) |
| Path | Method | Format |
|---|---|---|
/v1/chat/completions | POST | OpenAI |
/v1/embeddings | POST | OpenAI |
/v1/models | GET | OpenAI |
/v1/messages | POST | Anthropic |
/v1/messages/count_tokens | POST | Anthropic |
/.well-known/situra-attestation-keys | GET | JWKS |
| Header | What it states |
|---|---|
x-request-id | Request identifier, the same one you will see in the console |
x-situra-residency | Tier of the route that served the request: the project’s tier or a stricter one. Only on responses a route served (not on 502 or 503) |
x-situra-route-region | Region of that route, under the same condition |
x-situra-attempts | Number of routes tried |
x-situra-attestation | Signed record (EdDSA JWT) of the route, tier and region that served the response; verify it with the keys at /.well-known/situra-attestation-keys |
x-ratelimit-limit-requests / -remaining-requests | Per-minute request limit (the tighter of the key’s and the organisation’s) and what is left |
x-ratelimit-limit-tokens / -remaining-tokens | The organisation’s per-minute token limit and what is left |
retry-after | Seconds to wait before retrying (429 and some 503s) |
| Limit | Default | When exceeded |
|---|---|---|
| Organisation requests per minute | 60 (adjustable by Situra staff: tell us the volume you need) | 429 rate_limit_exceeded with retry-after |
| Organisation tokens per minute | 200,000 (adjustable) | 429 rate_limit_exceeded |
| Requests per minute for one key | None, unless you set one when creating the key | 429 rate_limit_exceeded |
| Concurrent requests per key | 64 per gateway replica (one replica runs today) | 429 too_many_concurrent_requests |
| Request body | 32 MiB | 413 request_too_large |
| Routes tried per request | 3, always within the allowed tier | 502 or 504 after the last |
| Upstream timeout | 300 s (to the headers for streams) | 504 upstream_timeout |
Limits use a continuous-refill bucket; the x-ratelimit-* headers show the limit and what is left. To raise your organisation’s limits (for many teams, say), tell us the volume you need in your evaluation request or on Contact.
/v1/images), audio, files, batches and moderation: they return 404 today. They are planned. Image input in chat does work.invalid_request. Function tools your own code executes work.store field is forced to false (completions are not saved for later retrieval; the provider’s abuse-monitoring retention still applies), and service_tier and inference_geo are removed, because they would change the price or the processing location.| HTTP | Code (error.code) | Meaning |
|---|---|---|
401 | missing_api_key, invalid_api_key, expired_api_key | Missing, invalid, expired or revoked key |
402 | insufficient_balance, credit_limit_reached, budget_exceeded | Insufficient balance (prepaid), credit limit reached (invoiced), or a hard-stop budget is exhausted |
400 | invalid_request, invalid_residency, unsupported_model, remote_media_not_supported | Invalid request: unsupported body or tool, unknown x-situra-residency value, a model without that capability, or images and documents by URL on a route that does not accept them (send them as base64) |
403 | organization_pending_verification | Your organisation is pending verification: until then only test keys (situ_test_) work |
403 | model_not_allowed, organization_suspended, regional_ingress_required | Model not allowed for the key or project, organisation suspended, or a request for an ES project that did not enter through the Spain regional endpoint (only where entry points outside Spain exist; today every request enters in Madrid and this code is not returned) |
404 | model_not_found, not_found | The model does not exist or is not available (today, any model without a connected route, such as GPT or Claude), or the API path does not exist (for example, /v1/images) |
429 | rate_limit_exceeded, too_many_concurrent_requests | Request or concurrency limit; includes retry-after |
503 | no_route | No allowed route for the project’s tier. Not transient: retrying does not help |
502 / 504 | upstream_error, upstream_timeout | Upstream failure after all allowed fallbacks |
Errors come back in the client’s format: OpenAI format on /v1/chat/… and /v1/embeddings, with the code in error.code; Anthropic format on /v1/messages, with the type in error.type and Situra’s code in error.code. no_route comes with x-should-retry: false, which the official SDKs honour.
{
"error": {
"message": "No route available.",
"type": "invalid_request_error",
"code": "no_route",
"param": null
}
} {
"type": "error",
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"code": "invalid_api_key"
}
} Every response a model serves carries x-situra-attestation: a compact JWS signed with Ed25519 (typ: situra-residency+jwt). Verify it with the public keys; then compare rid with x-request-id, and org/prj with your organisation and project.
import base64, hashlib, json, urllib.request
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
def b64d(s): return base64.urlsafe_b64decode(s + "=" * (-len(s) % 4))
def key_set(url="https://api.situra.ai/.well-known/situra-attestation-keys"):
jwks = json.load(urllib.request.urlopen(url))
keys = {}
for k in jwks["keys"]:
if k.get("kty") == "OKP" and k.get("crv") == "Ed25519":
raw = b64d(k["x"])
keys[hashlib.sha256(raw).hexdigest()[:16]] = Ed25519PublicKey.from_public_bytes(raw)
return keys
def verify(token: str, keys: dict) -> dict:
h64, p64, s64 = token.split(".")
header = json.loads(b64d(h64))
if header.get("alg") != "EdDSA" or header.get("typ") != "situra-residency+jwt":
raise ValueError("malformed")
keys[header["kid"]].verify(b64d(s64), f"{h64}.{p64}".encode("ascii")) # InvalidSignature
return json.loads(b64d(p64))
# Then: compare rid with x-request-id, and org/prj with your organisation and project
# claims = verify(response.headers["x-situra-attestation"], key_set())
# assert claims["residency"] in ("es", "eu") const b64u = (s) => Uint8Array.from(atob(s.replace(/-/g, "+").replace(/_/g, "/")), (c) => c.charCodeAt(0));
const hex = (buf) => [...new Uint8Array(buf)].map((b) => b.toString(16).padStart(2, "0")).join("");
const jwks = await (await fetch("https://api.situra.ai/.well-known/situra-attestation-keys")).json();
const keys = new Map();
for (const k of jwks.keys) {
if (k.kty !== "OKP" || k.crv !== "Ed25519") continue;
const kid = hex(await crypto.subtle.digest("SHA-256", b64u(k.x))).slice(0, 16);
keys.set(kid, await crypto.subtle.importKey("jwk", { kty: "OKP", crv: "Ed25519", x: k.x }, { name: "Ed25519" }, false, ["verify"]));
}
export async function verify(token) {
const [h, p, s] = token.split(".");
const header = JSON.parse(new TextDecoder().decode(b64u(h)));
if (header.alg !== "EdDSA" || header.typ !== "situra-residency+jwt") throw new Error("malformed");
const key = keys.get(header.kid);
if (!key) throw new Error("unknown key");
const ok = await crypto.subtle.verify({ name: "Ed25519" }, key, b64u(s), new TextEncoder().encode(`${h}.${p}`));
if (!ok) throw new Error("bad signature");
return JSON.parse(new TextDecoder().decode(b64u(p))); // { rid, org, prj, route, provider, region, residency, … }
} The attestation records which route, provider, region and tier served the request according to Situra’s catalogue. It does not prove what happens inside the provider. What the attestation is, and what it does not prove.
Create a project, choose where its data is processed and change two lines of code.
Last reviewed: