Developers

OpenAI- and Anthropic-compatible API, with EU routes

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.

What changes
- 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)
  • streaming
  • tools
  • image input
  • /v1/embeddings*

* /v1/embeddings is implemented; embedding models are still to be confirmed in production.

Not yet (404)

  • Responses API
  • batches
  • audio
  • files
  • moderation

Quickstart. From zero to your first request

  1. Create an account

    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.

  2. Create a project

    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

  3. Generate a key

    With an expiry and, optionally, a model allowlist. The secret is shown once: put it in your secret manager.

  4. Change the base URL and the key

    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.

Guide: how to move from the OpenAI API to an EU route

app.py
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.situra.ai/v1",
    api_key=os.environ["SITURA_API_KEY"],  # situ_live_…
)

response = client.chat.completions.create(
    model="gemini-2.5-flash",
    messages=[{"role": "user", "content": "Summarise this case file in three sentences."}],
)
print(response.choices[0].message.content)
Sign up Your first test key, in the console. No cost.

Console playground. Try models before writing code

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.

Situra console playground Situra console playground
Real console with demo data.

Coding agents. Claude Code and other agents, with the same governance

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.

  • One key per team or developer, with an expiry
  • A monthly budget with a hard stop
  • EU residency for your source code
  • Per-key usage in the console
~/.zshrc
# 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"

Anthropic format with curl

The /v1/messages endpoint accepts the key in x-api-key, like Anthropic’s API.

Terminal
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"}]
  }'

Test keys. Wire up CI before you are verified

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.

Terminal
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

Quick reference. Base URL, authentication and headers

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.

Quick reference
ItemValue
Base URL, OpenAI SDKhttps://api.situra.ai/v1 (base_url / baseURL, or OPENAI_BASE_URL)
Base URL, Anthropic SDKhttps://api.situra.ai, without /v1: the SDK adds it (ANTHROPIC_BASE_URL for Claude Code)
AuthenticationAuthorization: Bearer situ_… or x-api-key: situ_…. If you send both, they must match
Key typessitu_live_… calls real models once the organisation is active; situ_test_… is served by the sandbox (simulated responses, zero cost)
Residency per requestx-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 modelsGET /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 keyshttps://api.situra.ai/.well-known/situra-attestation-keys (JWKS, no authentication)

API surface. Endpoints, headers and errors

Endpoints
PathMethodFormat
/v1/chat/completionsPOSTOpenAI
/v1/embeddingsPOSTOpenAI
/v1/modelsGETOpenAI
/v1/messagesPOSTAnthropic
/v1/messages/count_tokensPOSTAnthropic
/.well-known/situra-attestation-keysGETJWKS
Response headers
HeaderWhat it states
x-request-idRequest identifier, the same one you will see in the console
x-situra-residencyTier 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-regionRegion of that route, under the same condition
x-situra-attemptsNumber of routes tried
x-situra-attestationSigned 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-requestsPer-minute request limit (the tighter of the key’s and the organisation’s) and what is left
x-ratelimit-limit-tokens / -remaining-tokensThe organisation’s per-minute token limit and what is left
retry-afterSeconds to wait before retrying (429 and some 503s)

Default limits

Default limits
LimitDefaultWhen exceeded
Organisation requests per minute60 (adjustable by Situra staff: tell us the volume you need)429 rate_limit_exceeded with retry-after
Organisation tokens per minute200,000 (adjustable)429 rate_limit_exceeded
Requests per minute for one keyNone, unless you set one when creating the key429 rate_limit_exceeded
Concurrent requests per key64 per gateway replica (one replica runs today)429 too_many_concurrent_requests
Request body32 MiB413 request_too_large
Routes tried per request3, always within the allowed tier502 or 504 after the last
Upstream timeout300 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.

What is not available yet

  • The Responses API, legacy completions, image generation (/v1/images), audio, files, batches and moderation: they return 404 today. They are planned. Image input in chat does work.
  • Provider-side server tools (web search, code execution, hosted MCP connectors): refused with 400 invalid_request. Function tools your own code executes work.
  • Images and documents by URL on routes that would have to fetch them inside Situra (for example Vertex AI): send them as base64.
  • OpenAI’s 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.

Status codes

Status codes
HTTPCode (error.code)Meaning
401missing_api_key, invalid_api_key, expired_api_keyMissing, invalid, expired or revoked key
402insufficient_balance, credit_limit_reached, budget_exceededInsufficient balance (prepaid), credit limit reached (invoiced), or a hard-stop budget is exhausted
400invalid_request, invalid_residency, unsupported_model, remote_media_not_supportedInvalid 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)
403organization_pending_verificationYour organisation is pending verification: until then only test keys (situ_test_) work
403model_not_allowed, organization_suspended, regional_ingress_requiredModel 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)
404model_not_found, not_foundThe 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)
429rate_limit_exceeded, too_many_concurrent_requestsRequest or concurrency limit; includes retry-after
503no_routeNo allowed route for the project’s tier. Not transient: retrying does not help
502 / 504upstream_error, upstream_timeoutUpstream 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.

/v1/chat/completions · 503
{
  "error": {
    "message": "No route available.",
    "type": "invalid_request_error",
    "code": "no_route",
    "param": null
  }
}
/v1/messages · 401
{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "Invalid API key.",
    "code": "invalid_api_key"
  }
}

More on routing and fallbacks

Verify the attestation. Without relying on Situra

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.

verify_attestation.py
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")
verify-attestation.mjs
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.

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

Last reviewed: