Default WorkspaceAPI Reference
OpenAI-compatible REST endpoints & SDK quickstart

Quickstart

  • Base URL: https://api.sentiogate.dev/v1
  • Auth header: Authorization: Bearer sg_live_... (create a gateway key in the Vault; provider keys stay in your Vault, BYOK)
  • Client: any OpenAI SDK, or our open-source SDKs (Apache-2.0): sentiogate-python on PyPI (pip install sentiogate-python) and @sentiogate/sdk on npm (npm i @sentiogate/sdk). The SentioGate service itself is proprietary.
  • model: "auto" picks the cheapest qualifying model; any provider/model id pins one.
  • Per-request controls: route_preference (cost, quality or latency) and task_class in the body; X-Session-ID keeps a conversation on the same route; X-SentioGate-Cache, X-SentioGate-Tool-Trim, X-SentioGate-Loop-Stop and X-SentioGate-Tool-Guard headers switch those features for one request. Account-wide switches are under Routing policy in the dashboard.
curl https://api.sentiogate.dev/v1/chat/completions \
  -H "Authorization: Bearer sg_live_your_gateway_key" \
  -H "Content-Type: application/json" \
  -d '{"model": "auto", "messages": [{"role": "user", "content": "Hello"}]}'

How model: "auto" works

Send model: "auto" and SentioGate ranks the models you enabled in your Vault for each request, by cost, latency and current health. It automatically falls back to another model if one fails: on a rate limit (HTTP 429) or a server error it tries your next key for the same model, then the next ranked model, which can be on another provider. A 429 puts that model on that key into a cooldown shared across requests, honoring the provider's Retry-After, so later requests skip it.

Send a provider/model id to pin one model. A pinned model only gets key failover; it never switches to a different model. OpenRouter model ids keep their own slash, for example openrouter/anthropic/claude-sonnet-4. GET /v1/models lists the ids you can route to.

Authentication and your provider keys (BYOK)

  • Every request carries a SentioGate gateway key (sg_live_...) as Authorization: Bearer sg_live_.... Create one in the dashboard.
  • The Anthropic-compatible /v1/messages endpoint also accepts the key as x-api-key, which is what Anthropic SDKs and Claude Code send.
  • Your provider keys (for example OpenAI, Anthropic, Gemini, Groq, Mistral, DeepSeek, xAI or OpenRouter) go in the Vault, encrypted at rest. Providers bill your own accounts directly, with 0% token markup.
  • You can store up to 5 keys per provider, in priority order, with optional per-key spend and balance limits that pause a key.
  • model: "auto" only routes to models you enabled in the Vault.

Endpoints

POST /v1/chat/completionsOpenAI-compatible Chat Completions. With stream: true the Server-Sent Events stream is passed through and router metadata arrives in the X-SentioGate-Router response header.
GET /v1/modelsLists the model ids you can route to.
POST /v1/messagesAnthropic Messages API, for Claude Code and Anthropic SDKs. Claude models need your own Anthropic or OpenRouter key.
POST /v1/messages/count_tokensCounts input tokens for a Messages request.

Free community pool (no provider keys yet)

With a gateway key and no provider keys in your Vault, model: "auto" is answered by the free community pool: 600 requests per 5 hours per user during the beta, with no credit card. It is meant for testing your integration. Other model ids need your own provider key. Once you add keys, the same model: "auto" call routes across them with no code change.

Errors and retries

Errors use the OpenAI error shape: {"error": {"message", "type", "code"}}. Check error.code:

401 invalid_api_keyMissing or invalid gateway key.
403 no_enabled_modelsauto found no enabled models in your Vault. Enable at least one model.
403 community_model_onlyNo provider keys yet, and the request asked for a specific model. Send auto, or add your own key.
403 community_pool_disabled_with_byokThe request asked for the community pool while provider keys are saved. Send auto or a provider/model id.
429 upstream_rate_limitedYour providers rate-limited every model SentioGate tried. Wait for Retry-After, or add another key or provider.
429 community_pool_exhaustedYou used your community pool requests for this window. Retry-After is the time until it frees up.
503 community_busyThe shared community pool is briefly busy. Retry after the short Retry-After.

Wait at least Retry-After before retrying, and retry in one layer only: if you use the OpenAI SDK's built-in retries, leave SentioGate SDK retries off, or the other way round.

Which model answered: router metadata

Non-streaming responses include a router object next to the usual OpenAI fields, with the policy that ran, the reason a model was picked and any fallback attempts. Log it to see which provider and model actually answered. The full request and response schemas are in the endpoint reference below.

Endpoint reference

Inference

POST/chat/completionsCreate a chat completion (OpenAI-compatible)

With `stream: true` the upstream Server-Sent Events stream is passed through unchanged and router metadata is returned in the `X-SentioGate-Router` response header (JSON). Non-streaming responses carry the same metadata in the `router` field.

Parameters

X-Session-ID headerstring
Conversation or agent-session id (max 256 chars). Optional: keeps the requests of one session together, so `model: "auto"` stays consistent across tool turns and provider prompt caching works better.
X-SentioGate-Prompt-Cache header"off"
Send `off` to stop SentioGate adding a provider prompt-cache breakpoint. Client cache_control fields are always forwarded.
X-SentioGate-Cascade header"on" | "off"
Cascade (opt-in, non-streaming, `model: "auto"`): `on` first tries a cheaper model from your vault and, if its answer does not pass SentioGate's quality checks, retries once with the normal pick. Both attempts are billed by your provider. `off` turns it off for this request. The outcome is reported in `router.cascade`.
X-SentioGate-Length-Cap header"on" | "off"
Send `on` to enable the answer-length cap for this request (off by default), or `off` to disable it.
X-SentioGate-Cache header"off" | "bypass" | "force"
Send `off` (or `bypass`) to skip the response cache, or `force` to cache this request at any temperature (still never for streaming, tools or n>1). Responses carry `X-SentioGate-Cache` (`exact`, `semantic`, `miss` or `skip-<reason>`) and, on a hit, `X-SentioGate-Cache-Saved-USD`.
X-SentioGate-Tool-Trim header"on" | "off"
Tool-output trimming (on by default for `model: "auto"` and your own keys): shortens large tool results from earlier agent steps. System, user and assistant messages and the newest tool results are never changed. Send `off` to opt out for this request, or `on` to apply it when your account setting is off. Savings are reported in `router.tool_trim`.
X-SentioGate-Loop-Stop header"on" | "off"
Runaway-loop stop (on by default). When an agent looks stuck repeating the same steps, the request is flagged in the `X-SentioGate-Loop` response header and answered with 400 `loop_detected` instead of calling a model. Send `off` to only flag it (overrides the account setting); `on` forces the stop.
X-SentioGate-Tool-Guard header"flag" | "off"
Dangerous tool-call flag (on by default). When the model asks to run a tool call that looks dangerous, such as deleting the root or home directory, piping a download into a shell, sending credential files or secrets out, or force-pushing to main, the response is flagged in the `X-SentioGate-Guard` response header and in `router.guard`. On streams the flag arrives as an SSE comment line starting with `: x-sentiogate-guard` before the end of the stream. Flag only: the answer is never changed or blocked. Send `off` to skip the check for this request (overrides the account setting).
X-SentioGate-Allow-Queue header"on" | "off"
Advanced, for background jobs only. On a non-streaming request served by the free community pool, `on` lets a busy pool answer 202 Accepted with a poll link (`Location: /v1/batch/poll/{jobId}`) instead of a busy error. Requests on your own provider keys are always answered directly.

Request body ChatCompletionRequest

modelstring
`auto`, `provider/model` (e.g. `openai/gpt-4o-mini`) or a bare model id.
messagesrequiredMessage[]
fields
rolerequired"system" | "user" | "assistant" | "tool"
contentrequiredstring | object[]
namestring
streamboolean
temperaturenumber
Sent upstream only when set; unset uses the provider default.
max_tokensinteger
top_pnumber
frequency_penaltynumber
presence_penaltynumber
stopstring | string[]
task_class"classification" | "simple_qa" | "summarization" | "general" | "long_context" | "coding" | "reasoning"
Optional hint for `model: "auto"` that overrides the automatic task detection.
route_preference"cost" | "quality" | "latency"
`cost` (default): lowest price among suitable models. `quality`: prefer more capable models. `latency`: prefer faster models.
session_idstring
Same as header X-Session-ID.
cache_controlobject
Forwarded untouched to the provider. Block-level cache_control inside messages is also forwarded untouched.
prompt_cache_keystring
Forwarded (OpenAI-style cache routing key).
prompt_cacheboolean
false stops SentioGate auto-inserting a prompt-cache breakpoint.
cascadeboolean
Same as header X-SentioGate-Cascade.
length_capboolean
true enables the answer-length cap for this request (off by default; same as header `X-SentioGate-Length-Cap: on`). It applies only when you set no max_tokens / max_completion_tokens and the request is not streaming; an answer cut by the cap is retried once without it.
cacheboolean
false skips the response cache (same as header `X-SentioGate-Cache: off`); true opts in at any temperature (same as `force`). By default only deterministic requests are cached (a low temperature, or a single-turn factual question with temperature unset).
tool_trimboolean
false turns tool-output trimming off for this request (same as header `X-SentioGate-Tool-Trim: off`).
compress"auto" | "lossless" | "on" | "off"
Context compression. `auto` (default): lossless clean-up only, plus summarizing older turns when a long session nears the model's context limit. System prompts, code blocks and tool-call pairs are never changed, and provider prompt caching keeps working. `lossless`: never summarize. `on`: summarize older turns more readily. `off`: send messages unchanged. Header `X-SentioGate-Compress` is equivalent. Savings are reported in `router.compression`.
metadataobject
fields
task_class"classification" | "simple_qa" | "summarization" | "general" | "long_context" | "coding" | "reasoning"
Optional hint for `model: "auto"` that overrides the automatic task detection.
route_preference"cost" | "quality" | "latency"
`cost` (default): lowest price among suitable models. `quality`: prefer more capable models. `latency`: prefer faster models.
toolsobject[]
OpenAI-style tools; forwarded upstream.
tool_choiceobject
Forwarded upstream with tools.
parallel_tool_callsboolean
Forwarded upstream when set.
functionsobject[]
Legacy OpenAI functions; forwarded when tools is absent.
provider_keysobject
Per-request provider key overrides (not stored).

Responses

200Completion. `text/event-stream` when `stream: true`.
ChatCompletionResponse
idstring
objectstring
createdinteger
modelstring
choicesobject[]
fields
indexinteger
messageMessage
fields
rolerequired"system" | "user" | "assistant" | "tool"
contentrequiredstring | object[]
namestring
finish_reasonstringnull
usageobject
fields
prompt_tokensinteger
completion_tokensinteger
total_tokensinteger
cachedboolean
routerRouterInfo
SentioGate routing metadata. Informational; other fields may appear.
fields
latency_msinteger
End-to-end time at the edge (non-streaming).
providerstring
modelstring
policy"sentiogate_auto" | "explicit" | "cache"
task_class"classification" | "simple_qa" | "summarization" | "general" | "long_context" | "coding" | "reasoning"
Optional hint for `model: "auto"` that overrides the automatic task detection.
min_tierinteger
model_tierintegernull
estimated_prompt_tokensinteger
estimated_output_tokensinteger
estimated_cost_usdnumbernull
pricing_sourcestring
reasonstring
candidatesinteger
attemptsstring[]
`provider/model:status` per upstream attempt.
route_preference"cost" | "quality" | "latency"
`cost` (default): lowest price among suitable models. `quality`: prefer more capable models. `latency`: prefer faster models.
measured_latency_msnumbernull
Recently measured latency of the chosen model, if known.
prompt_cacheobject
Provider prompt-cache usage for this response and the estimated saving.
fields
cached_tokensinteger
cache_write_tokensinteger
saved_usdnumbernull
saved_sourcestringnull
autoobjectnull
agentobject
Present on `model: "auto"` requests that carry tools.
fields
toolsboolean
tool_roundsinteger
cost_sourcestring
How estimated_cost_usd was computed (for example from the provider's published prices, or `unknown_price`).
reasoning_retryobject
Present when a reasoning model returned an empty answer and the request was retried automatically. Both attempts are billed.
cascadeobject
Present when cascade was requested.
fields
attemptedboolean
escalatedboolean
reasonstring
`passed`, or why the cheaper answer was not used.
first_modelstring
first_cost_usdnumber
first_latency_msinteger
length_capobject
Answer-length cap: whether it applied, the token limit, and whether a truncated answer was retried uncapped.
fields
cap_appliedboolean
cap_tokensinteger
cap_retryboolean
cap_skipped"not_enabled" | "client_limit" | "streaming"
cacheobject
fields
hitboolean
layer"exact" | "semantic"
cost_usdnumber
saved_usdnumber
skippedstring
tool_trimobject
Present when tool-output trimming changed this request.
fields
trimmedinteger
chars_savedinteger
tokens_saved_estinteger
loopobject
Present when the agent looks stuck in a loop.
fields
suspectedboolean
countinteger
guardobject
Present when the answer contains tool calls and the dangerous tool-call flag is on. Flag only: the answer is not changed.
fields
mode"flag"
inspectedinteger
Tool calls checked.
flaggedinteger
Tool calls that look dangerous.
rulesstring[]
Ids of the matched rules, for example `rm-root-or-home`, `pipe-to-shell`, `secret-file-exfil`, `force-push-main`, `secret-in-outbound-args`.
compressionobject
fields
appliedboolean
original_tokensinteger
compressed_tokensinteger
saved_tokensinteger
saved_pctnumber
modestring
lossyboolean
summary_cost_usdnumber
400Invalid request body. Also when the agent looks stuck repeating the same steps and runaway-loop stop is on, the default (`loop_detected`). Change the approach or input and send again; retrying the same request gives the same answer.
Error
errorrequiredobject
fields
messagerequiredstring
typestring
code"invalid_api_key" | "no_provider_key" | "model_disabled_by_policy" | "no_capable_model" | "no_enabled_models" | "policy_limit_reached" | "provider_not_supported_on_edge"
providerstringnull
modelstringnull
401Missing or invalid SentioGate API key (`invalid_api_key`).
Error
errorrequiredobject
fields
messagerequiredstring
typestring
code"invalid_api_key" | "no_provider_key" | "model_disabled_by_policy" | "no_capable_model" | "no_enabled_models" | "policy_limit_reached" | "provider_not_supported_on_edge"
providerstringnull
modelstringnull
402No provider key in your vault for the requested provider, or no keys at all (`no_provider_key`).
Error
errorrequiredobject
fields
messagerequiredstring
typestring
code"invalid_api_key" | "no_provider_key" | "model_disabled_by_policy" | "no_capable_model" | "no_enabled_models" | "policy_limit_reached" | "provider_not_supported_on_edge"
providerstringnull
modelstringnull
403Model disabled by vault policy (`model_disabled_by_policy`), or auto found no capable/enabled model (`no_capable_model`, `no_enabled_models`).
Error
errorrequiredobject
fields
messagerequiredstring
typestring
code"invalid_api_key" | "no_provider_key" | "model_disabled_by_policy" | "no_capable_model" | "no_enabled_models" | "policy_limit_reached" | "provider_not_supported_on_edge"
providerstringnull
modelstringnull
429Vault spend/request cap reached (`policy_limit_reached`).
Error
errorrequiredobject
fields
messagerequiredstring
typestring
code"invalid_api_key" | "no_provider_key" | "model_disabled_by_policy" | "no_capable_model" | "no_enabled_models" | "policy_limit_reached" | "provider_not_supported_on_edge"
providerstringnull
modelstringnull
501Selected provider is not OpenAI-compatible and cannot be forwarded by the edge (`provider_not_supported_on_edge`).
Error
errorrequiredobject
fields
messagerequiredstring
typestring
code"invalid_api_key" | "no_provider_key" | "model_disabled_by_policy" | "no_capable_model" | "no_enabled_models" | "policy_limit_reached" | "provider_not_supported_on_edge"
providerstringnull
modelstringnull
502Upstream provider returned an error or was unreachable.
Error
errorrequiredobject
fields
messagerequiredstring
typestring
code"invalid_api_key" | "no_provider_key" | "model_disabled_by_policy" | "no_capable_model" | "no_enabled_models" | "policy_limit_reached" | "provider_not_supported_on_edge"
providerstringnull
modelstringnull
503Temporarily unavailable, for example the free community pool is busy (`community_busy`, with `Retry-After`).
Error
errorrequiredobject
fields
messagerequiredstring
typestring
code"invalid_api_key" | "no_provider_key" | "model_disabled_by_policy" | "no_capable_model" | "no_enabled_models" | "policy_limit_reached" | "provider_not_supported_on_edge"
providerstringnull
modelstringnull

Anthropic

POST/messagesCreate a message (Anthropic Messages API)

Anthropic-compatible endpoint for Claude Code and Anthropic SDKs: set `ANTHROPIC_BASE_URL=https://api.sentiogate.dev` and `ANTHROPIC_API_KEY` to your `sg_live_...` key (sent as `x-api-key` or `Authorization: Bearer`). `?beta=true` is accepted. With your own Anthropic key in the Vault, `claude-*` models are sent natively to Anthropic, so the request (thinking, tools, cache_control, documents) and the response or SSE stream are passed through as Anthropic sent them. Any other model (`auto`, `provider/model`, a bare id) is translated to an OpenAI-compatible chat completion on your vault keys and the answer is translated back into Anthropic's message shape and SSE event order (`message_start`, `content_block_*`, `message_delta`, `message_stop`). Without vault keys, only `auto` (or `sentiogate-community`) is served, on the free community models; other ids return 403 `permission_error`. For Claude Code set `ANTHROPIC_MODEL=auto` and `ANTHROPIC_SMALL_FAST_MODEL=auto` (and `ANTHROPIC_DEFAULT_HAIKU_MODEL=auto`). Claude models need your own Anthropic or OpenRouter key. A 429 carries the upstream `Retry-After` when the provider sent one. Router metadata is returned in the `X-SentioGate-Router` header.

Parameters

anthropic-version headerstring
Anthropic API version (default `2023-06-01`). Forwarded on native Anthropic calls.
anthropic-beta headerstring
Anthropic beta flags. Forwarded on native Anthropic calls.
X-SentioGate-Tool-Trim header"on" | "off"
Tool-output trimming (on by default for `model: "auto"` and your own keys): shortens large tool results from earlier agent steps. System, user and assistant messages and the newest tool results are never changed. Send `off` to opt out for this request, or `on` to apply it when your account setting is off. Savings are reported in `router.tool_trim`.
X-SentioGate-Loop-Stop header"on" | "off"
Runaway-loop stop (on by default). When an agent looks stuck repeating the same steps, the request is flagged in the `X-SentioGate-Loop` response header and answered with 400 `loop_detected` instead of calling a model. Send `off` to only flag it (overrides the account setting); `on` forces the stop.
X-SentioGate-Tool-Guard header"flag" | "off"
Dangerous tool-call flag (on by default). When the model asks to run a tool call that looks dangerous, such as deleting the root or home directory, piping a download into a shell, sending credential files or secrets out, or force-pushing to main, the response is flagged in the `X-SentioGate-Guard` response header and in `router.guard`. On streams the flag arrives as an SSE comment line starting with `: x-sentiogate-guard` before the end of the stream. Flag only: the answer is never changed or blocked. Send `off` to skip the check for this request (overrides the account setting).

Request body MessagesRequest

modelrequiredstring
`claude-*` (native with your Anthropic key; via OpenRouter as `anthropic/<id>` otherwise), `auto`, `sentiogate-community`, or `provider/model`.
max_tokensrequiredinteger
messagesrequiredobject[]
fields
rolerequired"user" | "assistant"
contentrequiredstring | object[]
systemstring | object[]
streamboolean
temperaturenumber
top_pnumber
top_kinteger
stop_sequencesstring[]
toolsobject[]
Custom tools are supported on every route; Anthropic server tools only on the native route.
tool_choiceobject
thinkingobject
metadataobject

Responses

200Message. `text/event-stream` when `stream: true`.
MessagesResponse
idstring
typestring
rolestring
modelstring
contentobject[]
stop_reason"end_turn" | "max_tokens" | "stop_sequence" | "tool_use" | "pause_turn" | "refusal" | null
stop_sequencestringnull
usageobject
fields
input_tokensinteger
output_tokensinteger
cache_creation_input_tokensinteger
cache_read_input_tokensinteger
400Invalid request (`invalid_request_error`). Also when the agent looks stuck repeating the same steps and runaway-loop stop is on, the default (`invalid_request_error`). Change the approach or input and send again; retrying the same request gives the same answer.
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
401Missing or invalid SentioGate API key (`authentication_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
402No provider key in your vault for the requested model (`billing_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
403Model not available without your own provider key, or disabled by vault policy (`permission_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
405Only POST (and HEAD) are supported.
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
413Request too large (`request_too_large`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
429Rate limited (`rate_limit_error`); `Retry-After` is set when known.
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
501The requested provider cannot be served by the edge (`api_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
502Upstream provider error (`api_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
504Upstream provider timed out (`timeout_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
529Upstream provider overloaded (`overloaded_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
POST/messages/count_tokensCount input tokens (Anthropic Messages API)

For `claude-*` models with your own Anthropic key in the Vault, Anthropic counts the tokens. Otherwise SentioGate returns an estimate. The `X-SentioGate-Token-Count` response header says which (`anthropic` or `estimate`).

Parameters

anthropic-version headerstring
Anthropic API version (default `2023-06-01`). Forwarded on native Anthropic calls.
anthropic-beta headerstring
Anthropic beta flags. Forwarded on native Anthropic calls.

Request body MessagesRequest

modelrequiredstring
`claude-*` (native with your Anthropic key; via OpenRouter as `anthropic/<id>` otherwise), `auto`, `sentiogate-community`, or `provider/model`.
max_tokensrequiredinteger
messagesrequiredobject[]
fields
rolerequired"user" | "assistant"
contentrequiredstring | object[]
systemstring | object[]
streamboolean
temperaturenumber
top_pnumber
top_kinteger
stop_sequencesstring[]
toolsobject[]
Custom tools are supported on every route; Anthropic server tools only on the native route.
tool_choiceobject
thinkingobject
metadataobject

Responses

200Token count
object
input_tokensrequiredinteger
400Invalid request (`invalid_request_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
401Missing or invalid SentioGate API key (`authentication_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring
429Rate limited (`rate_limit_error`).
AnthropicError
typerequiredstring
errorrequiredobject
fields
typerequired"invalid_request_error" | "authentication_error" | "billing_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "timeout_error" | "api_error" | "overloaded_error"
messagerequiredstring

Catalog

GET/modelsList routable model idspublic

Responses

200Model list
ModelList
objectstring
dataobject[]
fields
idstring
objectstring
owned_bystring
GET/providersList supported providerspublic

Responses

200Providers
objectobject
GET/pricingModel list prices used for routing and cost estimatespublic

Responses

200Pricing snapshot
objectobject
GET/pricing/modelsPer-model list prices (USD per token), context length, tool support and capability tierpublic

Responses

200Model price catalog
object
sourcestring
fetched_atstringnull
countinteger
modelsobject
POST/waitlistGet an email when a coming-soon paid plan launches ("Notify me" on /pricing)public

No account needed; when signed in, the account is linked to the sign-up. Stores only the email, the plan and the time. Signing up twice for the same plan is fine and returns the same answer. Nothing is emailed until the plan launches. Rate limited per IP.

Request body

emailrequiredstring
planrequired"pro" | "team"

Responses

200On the list
object
status"subscribed"
plan"pro" | "team"
messagestring
400Invalid email or plan
Detail
detailstring
429Too many sign-ups from this address; see Retry-After
Error
errorrequiredobject
fields
messagerequiredstring
typestring
code"invalid_api_key" | "no_provider_key" | "model_disabled_by_policy" | "no_capable_model" | "no_enabled_models" | "policy_limit_reached" | "provider_not_supported_on_edge"
providerstringnull
modelstringnull
503Temporarily unavailable
Detail
detailstring
GET/benchmarksPer-model latency and success rates measured from recent routed trafficpublic

Responses

200Measured model stats
BenchmarkList
windowstring
measuredboolean
benchmarksobject[]
fields
providerstring
modelstring
samplesinteger
p50_latency_msnumbernull
avg_ttft_msnumbernull
error_rate_pctnumbernull

Auth

POST/auth/loginExchange email/password for a session JWTpublic

Request body

emailrequiredstring
passwordrequiredstring

Responses

200Session
object
tokenstring
rolestring
userobject
workspacesobject[]
400Missing fields
Detail
detailstring
401Invalid email or password
Detail
detailstring
GET/auth/meCurrent user

Responses

200User and workspaces
objectobject
401Not authenticated
Detail
detailstring
GET/auth/keysList SentioGate API keys (prefixes only)

Responses

200Keys
objectobject
401Not authenticated
Detail
detailstring
POST/auth/keysCreate a SentioGate API key (`sg_live_...`, shown once)

Request body

namestring

Responses

201Created key; `raw_key` is only returned here
objectobject
401Not authenticated
Detail
detailstring
DELETE/auth/keys/{key_id}Revoke a SentioGate API key

Parameters

key_id pathrequiredstring

Responses

200Revoked
objectobject
401Not authenticated
Detail
detailstring

Vault

GET/vault/keysList stored provider keys (masked) and model policy

Responses

200Vault
objectobject
401Not authenticated
Detail
detailstring
POST/vault/keysStore or update a provider key (encrypted at rest) and model policy

Request body

providerrequiredstring
api_keystring
model_overridesobject
key_policy_defaultsobject

Responses

200Stored
objectobject
400Invalid key or provider
Detail
detailstring
401Not authenticated
Detail
detailstring
DELETE/vault/keys/{provider}Delete a stored provider key

Parameters

provider pathrequiredstring

Responses

200Deleted
objectobject
401Not authenticated
Detail
detailstring

Cache

GET/cache/statsYour response-cache entries, hits and recorded savings

Responses

200Cache stats
objectobject
401Not authenticated
Detail
detailstring
DELETE/cacheDelete your cached responses (other users are never affected)

Responses

200Cleared
objectobject
401Not authenticated
Detail
detailstring

Integrations

GET/integrations/langfuseYour Langfuse export settings (the secret key is never returned)

Responses

200Settings
LangfuseSettings
configuredboolean
enabledboolean
include_contentboolean
hoststring
Langfuse host, for example `https://cloud.langfuse.com` or `https://us.cloud.langfuse.com`.
public_keystringnull
Masked public key.
has_secret_keyboolean
updated_atintegernull
Unix time in milliseconds.
401Not authenticated
Detail
detailstring
503Temporarily unavailable
Detail
detailstring
PUT/integrations/langfuseSave Langfuse export settings

Opt-in export of a trace per chat request to your own Langfuse project. Off by default. Fields you leave out keep their saved value; `secret_key` is write-only and stored encrypted. Enabling needs both keys. Prompts and answers are only exported when `include_content` is true; otherwise traces carry metadata only (model, provider, token usage, cost, latency, status).

Request body LangfuseSettingsUpdate

enabledboolean
include_contentboolean
Also export prompts and answers. Default false (metadata only).
hoststring
HTTPS Langfuse host (self-hosted allowed; private addresses are rejected).
public_keystring
Starts with `pk-lf-`.
secret_keystring
Starts with `sk-lf-`. Write-only: stored encrypted and never returned.

Responses

200Saved settings
LangfuseSettings
configuredboolean
enabledboolean
include_contentboolean
hoststring
Langfuse host, for example `https://cloud.langfuse.com` or `https://us.cloud.langfuse.com`.
public_keystringnull
Masked public key.
has_secret_keyboolean
updated_atintegernull
Unix time in milliseconds.
400Invalid JSON, host or key, or enabling without both keys
Detail
detailstring
401Not authenticated
Detail
detailstring
503Temporarily unavailable
Detail
detailstring
DELETE/integrations/langfuseTurn off the Langfuse export and delete the saved keys

Responses

200Settings after deletion (`configured: false`)
LangfuseSettings
configuredboolean
enabledboolean
include_contentboolean
hoststring
Langfuse host, for example `https://cloud.langfuse.com` or `https://us.cloud.langfuse.com`.
public_keystringnull
Masked public key.
has_secret_keyboolean
updated_atintegernull
Unix time in milliseconds.
401Not authenticated
Detail
detailstring
503Temporarily unavailable
Detail
detailstring
POST/integrations/langfuse/testCheck the saved Langfuse keys against your Langfuse host

Responses

200Result. `ok: false` with a `detail` when the keys are missing, rejected or the host is unreachable; `status` is the HTTP status Langfuse answered (0 when unreachable).
object
okrequiredboolean
statusinteger
detailstring
401Not authenticated
Detail
detailstring
429Tested too often; `Retry-After` says when to try again.
object
okboolean
detailstring
503Temporarily unavailable
Detail
detailstring

Discover

POST/workload/analyzeEstimate savings from an uploaded log export (JSON, JSONL or CSV, max 5 MB). Nothing is stored.public

Request body

rawstring
File contents
recordsobject[]

Responses

200Estimated report
objectobject
400Empty or unparseable input
Detail
detailstring
413Upload too large
Detail
detailstring

Batch

POST/batch/enqueueSubmit an asynchronous task to the free community pool

Request body

item_textstring
messagesMessage[]
fields
rolerequired"system" | "user" | "assistant" | "tool"
contentrequiredstring | object[]
namestring
modelstring

Responses

202Queued task with poll_url
object
job_idstring
statusstring
poll_urlstring
400Invalid payload
Detail
detailstring
401Sign-in or API key required
Detail
detailstring
403The free community pool is not available for this account (for example when you have provider keys in the Vault)
Detail
detailstring
413Item too large
Detail
detailstring
429Personal allowance (600 requests per 5 hours) used up, too many pending items, or rate limited
Detail
detailstring
GET/batch/poll/{jobId}Check status and retrieve results of an enqueued batch task

Parameters

jobId pathrequiredstring

Responses

200Job status and completed model output (owner only)
object
job_idstring
statusstring
responseobject
401Sign-in or API key required
Detail
detailstring
404Job not found (or not yours)
Detail
detailstring