API reference
Authentication, endpoints, streaming, reasoning and errors on the OpenAI surface, the native Anthropic APIs, and the per-endpoint compatibility matrix.
Authentication
Every request to /v1/* authenticates with a virtual key in the Authorization: Bearer header. Create keys under Workloads in the Console.
- The secret is shown once, and only its hash is stored.
- A key is a credential for a workload. The workload owns rate limits, budget, allowed models and policy overrides. Organisation policy still applies.
- A key may carry an optional expiry. After it, the key is refused exactly like an unknown one.
- A model that is not on the workload's non-empty allow-list is refused with a sealed
403 permission_errorbefore anything is dispatched. The refusal itself lands in the audit chain. - A workload may limit its keys to endpoint families, for example chat and embeddings. Other families get a sealed
403 operation_not_allowedbefore anything is dispatched. - Creating a production key requires a verified email address.
- One exception: the signed, time-limited download links for anonymized documents need no key.

curl https://api.sluis.ai/v1/models \ -H "Authorization: Bearer $SLUIS_KEY" # a model outside the workload's allow-list never dispatches: # → 403 permission_error, and the refusal is sealed in the audit chain
{
"object": "list",
"data": [
{
"id": "mistral/mistral-large-latest",
"object": "model",
"created": 1704067200,
"owned_by": "mistral",
"kind": "text",
"context_window": 128000,
"capabilities": { "tools": true, "vision": false, "reasoning": null },
"residency": { "jurisdiction": "EU", "region": "Paris, France", "country": "FR", "owner_is_eu": true },
"resolves_to": null,
"pricing": {
"input_eur_per_mtok": 0.55,
"output_eur_per_mtok": 1.65,
"cached_input_eur_per_mtok": 0.055,
"audio_input_eur_per_mtok": null,
"audio_output_eur_per_mtok": null,
"long_context": [{ "from_tokens": 200000, "input_eur_per_mtok": 1.1, "output_eur_per_mtok": 3.3 }],
"eur_per_page": null,
"eur_per_minute": null,
"eur_per_image": null,
"estimated": false
}
},
{
"id": "sluis/fast",
"object": "model",
"created": 1704067200,
"owned_by": "sluis",
"kind": "text",
"context_window": 128000,
"capabilities": { "tools": true, "vision": false, "reasoning": null },
"residency": { "jurisdiction": "EU", "region": "Paris, France", "country": "FR", "owner_is_eu": true },
"resolves_to": "mistral/mistral-large-latest",
"pricing": { "input_eur_per_mtok": 0.55, "output_eur_per_mtok": 1.65, "cached_input_eur_per_mtok": 0.055, "audio_input_eur_per_mtok": null, "audio_output_eur_per_mtok": null, "long_context": [{ "from_tokens": 200000, "input_eur_per_mtok": 1.1, "output_eur_per_mtok": 3.3 }], "eur_per_page": null, "eur_per_minute": null, "eur_per_image": null, "estimated": false }
},
{
"id": "sluis/auto",
"object": "model",
"created": 1704067200,
"owned_by": "sluis",
"kind": null,
"context_window": null,
"capabilities": { "tools": null, "vision": null, "reasoning": null },
"residency": null,
"resolves_to": null,
"pricing": null
},
{
"id": "sluis/ocr",
"object": "model",
"created": 1704067200,
"owned_by": "sluis",
"kind": "ocr",
"context_window": null,
"capabilities": { "tools": null, "vision": null, "reasoning": null },
"residency": null,
"resolves_to": null,
"pricing": {
"input_eur_per_mtok": null,
"output_eur_per_mtok": null,
"cached_input_eur_per_mtok": null,
"audio_input_eur_per_mtok": null,
"audio_output_eur_per_mtok": null,
"long_context": [],
"eur_per_page": 0.01,
"eur_per_minute": null,
"eur_per_image": null,
"estimated": false
}
}
]
}Endpoints
Sluis exposes the OpenAI-compatible surface below, plus the native Anthropic paths described further down.
Endpoints without a first-class handler are proxied verbatim to the routed provider, streaming included, so OpenAI-compatible upstreams keep full fidelity.
A browser that opens a path the API does not serve, such as the bare API host, is redirected to these docs. API clients still get a plain 404.
| Endpoint | Purpose |
|---|---|
| POST / | Chat completions, the primary surface: routing, data protection, caching, streaming. |
| POST / | Legacy text completions. |
| POST / | Embeddings. |
| POST / | Moderation classification. |
| POST / | The OpenAI Responses API. |
| POST / | Native System One typed decisions, not OpenAI chat messages. |
| POST / | Document OCR (Mistral, or fully local with model sluis/ocr), billed per page. With the dlp_documents policy on, inline documents are anonymized before they leave. |
| POST / | Document anonymization: personal data swapped for «MERGE_TAG»s, images blurred. Billed per page or image. |
| POST / | Async anonymization jobs: enqueue a large document, poll /jobs/{id} and fetch /jobs/{id}/result. The signed download link (/v1/documents/deliverables/{id}) is time-limited and needs no API key. |
| GET / | Models allowed by your policy, credentials and workload, with kind, context window, capabilities, residency, alias target and this organisation's final EUR pricing, excluding VAT. |
| GET / | One model's metadata and organisation-specific pricing, in the same shape as the list. |
| POST / | Transcription, translation and speech, proxied to the routed provider. With model sluis/transcribe, POST /v1/audio/transcriptions runs Sluis's own speech to text with speaker detection. See Speech to text. |
| POST / | Image generation and edits, proxied. mistral/image-generation is the exception: Mistral serves it only through its agent connector, so the gateway translates the OpenAI request and answers with b64_json, billed per image. |
| POST / | Video generation, proxied. |
| / | File operations, proxied on your organisation's own key (BYOK or a custom provider). Files with purpose=batch are the exception: they go through the gateway's own gate and may use managed keys. |
| / | OpenAI-shaped batches: upload a JSONL file with purpose=batch to /v1/files, then create, poll and cancel here. Every line clears data protection and residency like a live call. Results arrive within 24 hours, billed at half the live price. Mistral, Azure, OpenAI and Qwen. |
| POST / | Anthropic Message Batches: create, list, get, results and cancel. Off unless your deployment enables them. They need content retention and run on Anthropic models only. Otherwise these routes return 404. |
| POST / | Native Anthropic Messages ingress: point any Anthropic SDK tool at Sluis, with any connected model. |
| POST / | Local token estimate for Anthropic SDK context management. Nothing is dispatched. |
| GET / | Native Anthropic model discovery (list and get), answered from the in-process catalog. At /v1/models the anthropic-version header selects the same shape. |
| HEAD / | Warm-up probe for Anthropic SDK clients such as Claude Code: 200 with an empty body. |
| GET / | OpenAI Realtime compatible WebSocket for live speech to speech with vertex/gemini-3.8-live, hosted in the EU multi-region on Google Vertex AI. Also served at /openai/v1/realtime; the model query parameter is required. Authenticate the upgrade request with Authorization: Bearer or x-api-key. It speaks the GA event names; the beta OpenAI-Beta: realtime=v1 shapes, ephemeral client secrets, browser sub-protocol keys and G.711 audio are not supported. Server-side tools, session resumption, voice replication and avatar output are refused at setup. Text is protected as on every endpoint; audio and video frames are forwarded uninspected. A session ends at a EUR 2 spend ceiling, and the provider closes a connection after roughly 10 minutes; reconnect to continue. Billed per token at the model's per-modality rates (text, audio, image and video frames), from the provider's usage report. Not available in Sluis Workspace, the Playground or sluis/* aliases. The full event list is in the agent skill. |
| GET / | Native Gemini Live WebSocket (BidiGenerateContent), also at /ws/google.cloud.aiplatform.v1.LlmBidiService/BidiGenerateContent; the version in the service name may be v1, v1beta, v1beta1 or v1alpha. A google-genai SDK with the gateway origin as base URL connects unchanged. Authenticate the upgrade request with x-goog-api-key, Authorization: Bearer or x-api-key; the ?key= query parameter is not accepted. Frames are relayed as the Gemini Live protocol defines them, and setup.model is gemini-3.8-live. Refusals arrive as a WebSocket close frame with the reason as text. Same model, limits, data protection and billing as /v1/realtime. |
curl https://api.sluis.ai/v1/chat/completions \ -H "Authorization: Bearer $SLUIS_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mistral/mistral-large-latest", "messages": [{ "role": "user", "content": "Say hi" }] }'
{
"id": "chatcmpl-9f2e…",
"object": "chat.completion",
"model": "mistral-large-latest",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "Hi! How can I help?" },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 9, "completion_tokens": 8, "total_tokens": 17 }
}
Every JSON body above may also carry the gateway extension sluis.remove, naming terms that must be pseudonymized out of the prompt before it is dispatched. It is stripped before the request leaves the gateway; see the Data protection reference.
# Document OCR, billed per page. Returns pages[] markdown + usage_info.pages_processed. # model "sluis/ocr" runs the gateway's own OCR engine: fully local, no provider egress (inline data: URLs only). curl https://api.sluis.ai/v1/ocr \ -H "Authorization: Bearer $SLUIS_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mistral/mistral-ocr-latest", "document": { "type": "document_url", "document_url": "https://example.com/invoice.pdf" } }'
{
"pages": [{
"index": 0,
"markdown": "# Invoice 2026-118\nAcme BV · Keizersgracht 1…",
"images": [],
"dimensions": { "dpi": 150, "height": 1754, "width": 1240 }
}],
"model": "mistral-ocr-latest",
"usage_info": { "pages_processed": 1, "doc_size_bytes": 48213 }
}Speech to text with speaker detection
Set the model to sluis/transcribe and send POST /v1/audio/transcriptions. The gateway runs its own speech to text, with no provider egress.
- Send a multipart
fileof up to 240 minutes. The language is detected automatically. response_formatisjson(the default),textorverbose_json(segments with a speaker).- Billed at €0.02 per minute of audio, per started second.
- The organisation's DLP mode applies to the transcript, like
sluis/ocr. - It answers
503where the deployment does not run transcription.
# Speech to text with speaker detection, billed €0.02 per minute of audio (per started second). # model "sluis/transcribe" runs in the gateway's own worker: no provider egress, language detected automatically. curl https://api.sluis.ai/v1/audio/transcriptions \ -H "Authorization: Bearer $SLUIS_KEY" \ -F model=sluis/transcribe \ -F response_format=verbose_json \ -F file=@meeting.m4a
{
"task": "transcribe",
"duration": 94.2,
"text": "Goedemorgen allemaal.\nGoedemorgen, fijn dat jullie er zijn.",
"segments": [
{ "id": 0, "start": 0.4, "end": 2.1, "text": "Goedemorgen allemaal.", "speaker": "speaker_1" },
{ "id": 1, "start": 2.6, "end": 5.0, "text": "Goedemorgen, fijn dat jullie er zijn.", "speaker": "speaker_2" }
],
"usage": { "type": "duration", "seconds": 95 }
}# Document anonymization, billed per page/image. PII becomes «MERGE_TAG»s; images are blurred. curl https://api.sluis.ai/v1/documents/anonymize \ -H "Authorization: Bearer $SLUIS_KEY" \ -F file=@contract.docx \ -F 'options={ "entities": ["person_name", "email", "iban"], "remove": ["Project Nightingale"] }'
{
"filename": "contract.docx",
"content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"content_base64": "UEsDBBQABgAIA…",
"summary": { "pages": 4, "images": 1, "categories": ["EMAIL", "IBAN", "PERSON_NAME"], "downgraded": false },
"mapping": [
{ "token": "«PERSON_NAME_1»", "original": "Jan de Vries" },
{ "token": "«IBAN_1»", "original": "NL91ABNA0417164300" }
]
}
System One typed decisions
# The router behind sluis/auto: send state only, not questions. curl https://api.sluis.ai/v1/systemone \ -H "Authorization: Bearer $SLUIS_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"sluis/typed/router", "state":{"request":"Compare these two supplier contracts clause by clause and list the risks.", "previous":"Here are both contracts.", "attachments":["contract_a.pdf (application/pdf)","contract_b.pdf (application/pdf)"]}}'
{
"model": "sluis/typed/router",
"answers": {
"reasoning": { "type": "noul", "noul": 0.9412,
"probabilities": { "false": 0.0588, "true": 0.9412 },
"confidence": 0.9412, "answer_confidence": 0.9412 },
"complexity": { "type": "score", "score": 2.31,
"legend": { "0": "trivial", "1": "simple", "2": "moderate", "3": "hard" },
"probabilities": { "0": 0.01, "1": 0.12, "2": 0.42, "3": 0.45 },
"confidence": 0.2612, "answer_confidence": 0.45 },
"task": { "type": "choice", "choice": "document",
"probabilities": { "code": 0.01, "writing": 0.03, "translation": 0.01, "extraction": 0.05,
"document": 0.86, "support": 0.02, "smalltalk": 0.01, "action": 0.01 },
"confidence": 0.6888, "answer_confidence": 0.86 }
},
"decision": { "route": "sluis/reasoning", "demand": "strong" },
"revision": ""
} | Local router contract (sluis/typed/router) | Behaviour |
|---|---|
| Model ids | sluis/typed/router is the router Sluis uses for sluis/auto, with its own calibrated questions. For your own questions, use a typesafe/jev-* model with your own TypeSafe key. |
| sluis/ | Send the text a request carries: state.request (required), and optional previous, system and attachments (a string or a list of "name (mime)" strings); a plain string is the request. It answers reasoning (noul, P(needs multi-step reasoning)), complexity (score, 0 trivial to 3 hard, with legend and probabilities per level) and task (choice over code, writing, translation, extraction, document, support, smalltalk, action). decision holds the route and demand sluis/auto would take from this text alone, or null. Files, images, JSON mode, tools, prompt size and your organisation's policy are not part of this input and can change a real sluis/auto route. answers.reasoning keeps the keys it always had; the rest is additional. |
| TypeSafe | Bring your own key only; no sluis/* alias reaches it. Name the model explicitly, for example typesafe/jev-latest. The normal gate applies: it is a US provider, so your residency policy must allow US. The other rows describe sluis/typed/router only. |
| Availability | Every answer comes from verified model weights, reported as revision. If the router is unavailable or cannot be verified, the call fails closed with 503. |
| State | Required JSON object, list (array) or string, at most 128 KiB (131072 bytes) of serialized JSON before DLP. Missing or invalid state returns 422; oversized state returns 413. |
| Questions | sluis/typed/router supplies its own calibrated questions: any questions field, including null or an empty object, returns 400. |
| Response | JSON with model, answers, decision and revision (weights SHA256). Each answer has its type, its typed value (choice, score or noul), confidence, probabilities, legend and answer_confidence. No chat completion or streaming envelope. |
| Latency | sluis/typed/router usually answers well under 200 ms; when busy it returns 503 with Retry-After: 2. |
| Data protection | Tenant DLP applies locally to the state: block refuses; tokenize or mask rewrites what the router is shown. Per-request removal terms are honoured. |
| Residency | Processed on Sluis infrastructure with no outside provider and no upstream residency routing step. |
| Metering | Each successful local decision is sealed and billed per input token at €0.01 per 1M tokens; output is free. The router reports no token count, so input is estimated at about 4 characters per token over the state it was shown. Normal limits, budgets and model allow-lists still apply. |
| Aliases | An existing tenant alias with the same name takes precedence over the local router. |
Document input
Attach a PDF, Word, image or plain-text file to a chat request as a "type": "file" content part carrying a base64 file_data data URL.
Any routed model accepts it. Providers that understand file parts natively receive them unchanged. For every other provider the gateway converts the document before dispatch.
How the model receives the document
- With a PDF renderer, vision-capable models get each PDF page as an
image_urlpart. The budget is 48 pages per request, shared across all attached documents, and provider limits can apply. Without a renderer, the deployment's fallback either extracts the text or refuses. - Models without image input get the document's extractable text as prompt text. The data protection scan then covers it like any other text.
- Longer or heavier documents belong on
/v1/ocr. - The Responses API takes
input_fileparts instead of the nestedfileshape of chat completions. - Sluis cannot inspect or resolve provider-side
file_idreferences. They pass through only to a provider that supports them, on your own provider key, with document inspection off. Otherwise inline the bytes asfile_data.
Data protection for documents
- With the
dlp_documentspolicy on, the document is anonymized or refused before anything leaves the gateway. - With it off and a protective DLP mode (
tokenize,maskorblock), documents that would travel as uninspectable images are refused. Underallow_logthey pass with an explicit unscanned marker in the audit trail. - Audio parts (
input_audio) cannot be scanned.block, or required AI recognition with document inspection enabled, refuses them with422. Otherwise they carryx-sluis-unscanned: audio.
# Attach a document as an OpenAI-style `file` content part. The gateway # normalizes it for the routed provider, so this works on any model. curl https://api.sluis.ai/v1/chat/completions \ -H "Authorization: Bearer $SLUIS_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "scaleway/gemma-4-26b-a4b-it", "messages": [{ "role": "user", "content": [ { "type": "file", "file": { "filename": "drawing.pdf", "file_data": "data:application/pdf;base64,'"$(base64 -w0 drawing.pdf)"'" } }, { "type": "text", "text": "Which discipline does this drawing document?" } ] }] }'
import OpenAI from "openai"; import { readFileSync } from "node:fs"; const client = new OpenAI({ baseURL: "https://api.sluis.ai/v1", apiKey: process.env.SLUIS_KEY, }); const pdf = readFileSync("drawing.pdf").toString("base64"); const reply = await client.chat.completions.create({ model: "vertex/gemini-3.1-pro", messages: [{ role: "user", content: [ { type: "file", file: { filename: "drawing.pdf", file_data: `data:application/pdf;base64,${pdf}` } }, { type: "text", text: "Which discipline does this drawing document?" }, ], }], });
Streaming
Set stream: true and the response arrives as server-sent events. Each frame is a chat.completion.chunk delta, and the stream ends with data: [DONE].
Streams are never buffered in the gateway: they tee through it, and the audit seal and metering happen even if the client hangs up early.
Ask for stream_options.include_usage and the gateway requests a final usage frame from the provider. If the provider sends none, or the stream is cut off, the gateway estimates the usage for metering.
To see what a streamed call cost your organisation, send x-sluis-include-cost: true together with stream_options.include_usage. The final usage object then carries sluis_cost_eur, see Cost of a call.
Bedrock keeps reasoning separate from the answer in reasoning_content and reasoning_signature, including streamed deltas. Refusals use finish_reason: content_filter, output limits use length, even with partial tool calls. Do not execute incomplete tool arguments. AWS streaming exceptions become sanitized error frames.
Keepalive, headers and restarts
- After 15 seconds without a frame the gateway writes an SSE comment line (
: keepalive) between events, so proxies with idle timeouts keep the connection open while a model thinks. SSE clients ignore it. - Streams carry
Cache-Control: no-cacheandX-Accel-Buffering: no. - When a gateway replica restarts, it keeps serving open streams for up to five minutes. A stream still open after that ends with an error event with code
server_restarting, so retry the request. - Tokenized streams accept individual events up to 4 MiB. Larger events end the stream with an error.
stream = client.chat.completions.create(
model="mistral/mistral-large-latest",
messages=[{"role": "user", "content": "Write a haiku"}],
stream=True,
stream_options={"include_usage": True},
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")const stream = await client.chat.completions.create({ model: "mistral/mistral-large-latest", messages: [{ role: "user", content: "Write a haiku" }], stream: true, stream_options: { include_usage: true }, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); }
# the raw event stream on the wire
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Water"}}]}
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":" finds a way."}}]}
data: {"object":"chat.completion.chunk","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":12,"completion_tokens":9,"total_tokens":21}}
data: [DONE]Reasoning
Pass the OpenAI reasoning_effort parameter (minimal | low | medium | high) on any thinking-capable model. Sluis translates it per provider (Gemini's thinking level, Claude's adaptive thinking effort) and omits it where a model would reject it, so one parameter works across the whole catalog.
resp = client.chat.completions.create(
model="vertex/claude-opus-4-8",
messages=[{"role": "user", "content": "Prove it step by step…"}],
reasoning_effort="high", # minimal | low | medium | high
)Prompt caching
Repeated prompt prefixes (system prompts, tools, conversation history) can be cached at the provider to reduce cost and latency. Sluis translates Anthropic-style cache_control blocks (optional 5m or 1h TTL) and OpenAI's top-level prompt_cache_key and prompt_cache_retention per provider.
Several system or assistant breakpoint boundaries may collapse during translation, including mixed TTLs.
| Provider | Prompt-cache behaviour |
|---|---|
| Anthropic | Explicit cache_control on system blocks, message content and tools, including TTL. Reads and writes are reported separately. |
| Bedrock | cache_control becomes Converse cachePoint blocks in system, messages and toolConfig. |
| OpenAI · Azure | Automatic caching. After opt-in, prompt_cache_key and prompt_cache_retention are kept on chat and Responses; unsupported options and markers are stripped. |
| Gemini · Vertex | Gemini implicit caching and reported cached-token usage work; explicit cachedContent references are unsupported. Claude on Vertex translates cache_control and TTL as on Anthropic. |
| xAI · DeepSeek · Mistral · Qwen · Moonshot · Zhipu | Automatic caching where offered; all explicit directives are stripped. Moonshot's native usage.cached_tokens is recognized. |
| Scaleway | Automatic caching where offered; all explicit directives are stripped. Reads use Scaleway's official EUR cached-input tariff when available, not LiteLLM. |
| Nebul | Automatic caching where offered; all explicit directives are stripped. Reads use the official EUR cached-input tariff when available. |
| Nebius · nebius-eu | Automatic caching where offered; all explicit directives are stripped. Official live prices do not borrow LiteLLM cache discounts; a LiteLLM fallback may supply a cache tariff when no official model price exists. |
| Custom | After tenant opt-in, directives pass through unchanged; support is the operator's contract. |
Explicit prompt caching is opt-in
Explicit prompt caching is an organisation-level setting (provider_prompt_cache). It is off by default and independent of Sluis content retention and exact response caching. Enable it in Console › Data protection.
- Cached prefixes stay at the provider after Sluis data protection has filtered them.
- When it is off, the gate removes
prompt_cache_key,prompt_cache_retention,prompt_cache_options,cache_controlandprompt_cache_breakpoint. It does not disable the provider's own automatic caching. - Without your own key for a provider, calls run on a Sluis credential that other organisations share. On OpenAI and Azure, Sluis sets a
prompt_cache_keyderived from your organisation in place of yours. On every other provider the cached-token counts in your usage show 0. Billing still applies the real cache discount.
Billing and limits
- Cache reads and writes are subsets of the total prompt tokens, not extra input. Reads use the available cache tariff.
- Anthropic 1h writes use the TTL-specific rate when the usage breakdown and tariff are available. Otherwise the default creation rate applies.
- A missing cache tariff means ordinary input pricing, never zero billing.
- Cache usage appears in the audit drawer and in Usage & budget.
- Long prompts are billed at the provider's long-context rate. Once the prompt (cached tokens included) passes the model's threshold, the whole call bills at that rate. It is shown under the price in the Models table.
On a Sluis-managed key, Sluis refuses a request with 400, before anything is sent, when it selects a surcharge Sluis cannot meter:
- a
cache_controlttlother than5m, where the provider honours it (Anthropic, Bedrock, Claude on Vertex) - a
service_tierother thanauto,default,flexorstandard_only - the Anthropic long-context beta (
context-1m) on a model Sluis has no long-context rate for
Your own provider key forwards all three unchanged.
Error codes
Errors use the OpenAI error envelope; the error.type value mirrors the HTTP status, so your SDK's error handling keeps working unchanged.
| Code | When |
|---|---|
| 400 invalid_request_error | Malformed request body or parameters. |
| 400 invalid_request_error | Model id missing its provider prefix. Every callable id is provider/model, for example mistral/mistral-large-latest. The message reads: model must be provider-prefixed. |
| 400 invalid_request_error | The request carries the removed x-sluis-dlp header. Per-request overrides were replaced by workload option overrides: configure them in Console › Workloads. |
| 401 authentication_error | Missing or unknown API key. |
| 402 insufficient_quota | No active plan, or the budget is reached. Activate a plan or raise the budget. The request never reaches a provider. |
| 403 permission_error | The key lacks permission, for example the model is not on the workload's allow-list. |
| 422 invalid_request_error | Refused before dispatch, for example data protection in block mode matched the request. |
| 422 document_too_large_to_scan | A document is too large for the path it took: a page still over the render pixel cap at the minimum scan resolution, or a file over the text-extraction byte cap. Large-format pages (A0 and A1 drawings) are downscaled automatically. Shrink or split the document and resubmit. |
| 429 rate_limit_error | Rate limit reached. Enforced at the gateway, so the request never hits a provider. |
| 403 permission_error | Blocked by residency policy: no allowed jurisdiction serves the request. The body includes the reason. |
| 403 scope_violation | Refused by the workload's scope guard in block mode: the call falls outside the scope written for that workload. The message carries the guard's reason, and the request never reaches a provider. |
| 422 malware_detected | The uploaded file matched a malware signature and was rejected before it was stored or parsed. The signature name is never returned. |
| 503 pdf_renderer_unavailable | An inline PDF had to be sent as page images because the routed model reads image input, but this deployment has no PDF renderer. It is refused instead of being answered from extracted text, which would discard what a drawing or scan shows. |
| 503 malware_scan_unavailable | The uploaded file could not be scanned for malware (scanner down or slow, or the file is over the 100 MiB scan limit), so it was not accepted. Nothing was stored. Retry with backoff. |
| 503 scope_guard_unavailable | The workload's scope guard is in block mode but could not reach a verdict, so the call is refused instead of let through. Retry with backoff. |
| 503 auth_unavailable | The gateway could not read its key store, so it could not verify the key. The key is not known to be invalid. Retry with backoff and honour Retry-After. |
| 504 api_error | The provider did not answer within the workload's answer timeout: 300 seconds by default, 10 to 600 if the workload sets it, shorter if the request sent x-sluis-upstream-timeout. error.sluis.cause is timeout. The gateway did not replay the call, because the provider may still be running it. Shorten the prompt or ask for a longer timeout before resending. |
| 5xx api_error | Upstream provider failure after retries. The circuit breaker steers traffic around unhealthy providers. The body carries the provider's own message and an error.sluis object naming the cause and every attempt, with its upstream status or transport error and how long it took. |
{
"error": {
"message": "model must be provider-prefixed, e.g. \"mistral/mistral-large-latest\"",
"type": "invalid_request_error",
"param": null,
"code": "invalid_request"
}
}{
"error": {
"message": "model not permitted for this API key",
"type": "permission_error",
"param": null,
"code": "permission_denied"
}
}{
"error": {
"message": "provider `openai` (jurisdiction `US`) is not permitted by the tenant's residency policy",
"type": "permission_error",
"param": null,
"code": "permission_denied"
}
}Anthropic Messages API
Sluis speaks the Anthropic Messages API natively. Point Claude Code or any Anthropic SDK at the gateway and call POST /v1/messages. /anthropic/v1/messages is the unambiguous prefixed path to the same handler.
The request is translated into the internal shape, clears the same Inspect, Route, Seal and Meter pipeline as every other call, and comes back in Anthropic's format, streaming included.
Authentication
- Send your Sluis key in Anthropic's
x-api-keyheader or in the usualAuthorization: Bearerheader. Both are accepted. - The
anthropic-versionheader is accepted with any value and never required. OnGET /v1/modelsits presence selects the Anthropic shape. - Parsing is deliberately open-world: unknown body fields, unknown content-block types, unknown
anthropic-betavalues and the?beta=truequery Claude Code sends are tolerated, not refused. - Beta flags travel byte for byte to Anthropic-family upstreams and are ignored anywhere else.
Endpoints
| Endpoint | Purpose |
|---|---|
| POST / | Messages, buffered or streaming. Supports system prompts (string or blocks), tools and tool results (including error results and images inside them), images, document blocks, thinking and redacted_thinking blocks in history, and cache_control markers on every cacheable position. |
| POST / | Local token estimate for SDK context management. Nothing is dispatched, retained or metered. |
| GET / | Native model discovery in Anthropic's shape, answered from the in-process catalog. At the root path the anthropic-version header selects this shape, and without it you get the OpenAI shape. Under /anthropic it always applies. The before_id, after_id and limit cursors are best effort, and created_at is a fixed placeholder because the catalog has no per-model release date. |
| HEAD / | The warm-up probe Claude Code sends before a session: HEAD only, answered with 200 and an empty body. |
Model routing
The wire format never restricts the model: the ingress is a codec, and the model id owns the route.
- A bare id such as
claude-sonnet-5resolves through this ingress's default provider,anthropic, unless your organisation points it elsewhere (for example tovertexfor EU-hosted Claude). The residency gate still decides whether that target may serve the request. - Pin a target explicitly with a provider-prefixed id, such as
vertex/claude-opus-4-8. - Or pass a
sluis/*alias. An Anthropic SDK tool then runs on any connected provider, inside your policy.
Streaming
With "stream": true the answer is the full Anthropic event grammar:
message_start, thencontent_block_start,content_block_deltaandcontent_block_stopfor each block, thenmessage_deltawith cumulative usage (including cache read and creation tokens), thenmessage_stop.- Text arrives as
text_delta, tool arguments asinput_json_delta, and reasoning asthinking_deltaplussignature_deltawhen the routed provider produced it. message_startcarries the input token count when the provider reports it in its first chunk. Otherwise it starts at zero, andmessage_deltareports the updated usage.- A
pingevent followsmessage_startand repeats after roughly 15 seconds of upstream silence, so a long thinking turn never trips a client watchdog. - A failure mid-stream is re-encoded as an
errorevent instead of a truncated stream. stop_sequencecarries the matched sequence when the answer came from an Anthropic-family provider, and is null otherwise.- Send
x-sluis-include-cost: trueand themessage_deltausage also carriessluis_cost_eur, your organisation's price of the call in EUR, plussluis_cost_estimated: trueonly when estimated. See Cost of a call.
# native Anthropic Messages: the model id owns the route, not the wire format curl https://api.sluis.ai/v1/messages \ -H "x-api-key: $SLUIS_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "vertex/claude-opus-4-8", "max_tokens": 256, "system": "Be concise.", "messages": [{ "role": "user", "content": "Say hi" }] }' # /anthropic/v1/messages is the unambiguous prefixed path for the same handler
{
"id": "msg_01f7…",
"type": "message",
"role": "assistant",
"model": "claude-opus-4-8",
"content": [{ "type": "text", "text": "Hi! How can I help?" }],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 9,
"output_tokens": 8,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0
}
}# "stream": true: the full event grammar, ping keep-alives included
event: message_start
data: {"type":"message_start","message":{"id":"msg_01f7…","role":"assistant","model":"claude-opus-4-8","usage":{"input_tokens":9,"output_tokens":0}}}
event: ping
data: {"type":"ping"}
event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hi!"}}
event: ping
data: {"type":"ping"}
event: content_block_stop
data: {"type":"content_block_stop","index":0}
event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":8,"cache_read_input_tokens":0}}
event: message_stop
data: {"type":"message_stop"}Errors
Failures from the Messages handlers use Anthropic's envelope: a top-level "type": "error" with the vendor error type. That includes refusals that never reach a model, such as an unknown key or a data protection block.
The vendor types are invalid_request_error, authentication_error, billing_error, permission_error, not_found_error, conflict_error, request_too_large, rate_limit_error, api_error and overloaded_error.
- The response carries a
request-idheader and arequest_idbody field, the correlation id for your client. - Where the call produced an audit row, the
x-sluis-request-idheader identifies that row. An authentication failure has no audit row. - Gateway-handled HTTP 5xx responses also carry a separate diagnostic
x-request-id. A safe caller-supplied id is echoed on other responses too. Errors generated by an edge proxy before the gateway are outside this guarantee. - Gateway-level refusals that happen before the handler, such as ledger backpressure or overload, can come back in the OpenAI error shape.
# failures from the Messages handlers are Anthropic-shaped: auth and # data-protection refusals included { "type": "error", "error": { "type": "rate_limit_error", "message": "rate limit exceeded" }, "request_id": "req_9f2e…" }
# mcp_servers is refused, not quietly passed through: an external MCP # server called by the model would sit outside the Sluis gate { "type": "error", "error": { "type": "invalid_request_error", "message": "`mcp_servers` is not supported: an external MCP server reached from the model would bypass the Sluis tool gate. Register the server with Sluis and call it through the compliance-native MCP gateway (`/v1/mcp`), which audits and meters every tool call." }, "request_id": "req_4c81…" }
A non-empty mcp_servers array is refused with 400 invalid_request_error instead of being forwarded. A model calling an external MCP server itself would sit outside the Sluis gate. Register the server in the Console and call its tools through the MCP gateway instead, where every executed tool call is inspected, routed, sealed and metered.
Compatibility matrix
What the native ingresses cover today, endpoint by endpoint. This table is the claim: what is not listed here as supported is on the roadmap, deliberately refused, or a different product surface, never quietly implied.
| Anthropic | Status | Notes |
|---|---|---|
| POST / | ✓ native | Buffered and streaming, tools, images, document blocks, thinking round-trip and prompt-cache markers. |
| POST / | ✓ local estimate | Answered locally. Nothing is dispatched. |
| GET / | ✓ native | Native list and get shape from the in-process catalog. Header-negotiated at the root path, unconditional under /anthropic. |
| HEAD / | ✓ | Claude Code's warm-up probe, HEAD only. |
| Message Batches | ✓ opt-in | Available when your deployment enables it: create, list, get, results and cancel, for models that resolve to Anthropic. Otherwise 404. Use the OpenAI-shaped /v1/batches for other providers. |
| Files | ✗ roadmap | The Files API is not bridged. Inline document blocks and file_data cover the common path. |
| mcp_servers | ✗ rejected | A non-empty array is refused with 400 instead of forwarded. Register the server and use the Sluis MCP gateway. |
| Skills · Agents · Admin | ✗ out of scope | Skills, managed agents and the admin, usage and cost APIs are a different product surface, not inference compatibility. |
Cross-protocol routing
Vendor-only fields survive as long as the request lands on a provider that speaks the same protocol. An Anthropic request served by an Anthropic-family provider keeps its thinking blocks, cache markers, beta flags and matched stop_sequence.
Routed across protocols, those fields are dropped at dispatch and never rejected at ingress. The audit row records both the wire format and the resolved provider, so any degradation is attributable.
Opaque values are never rewritten: thinking signatures and redacted_thinking payloads are forwarded verbatim or not at all. That is also why a parked thinking block that the data protection scan flags is dropped rather than masked: a rewritten block would carry an invalid signature.