API reference

Endpoints

Method and pathPurposeAuth
POST /v1/guard/checkThe guard on its own, with no model behind it: you send text, you get an allow or block decision.Bearer key
POST /v1/chat/completionsChat completions, guarded on input and output.Bearer key
GET /v1/billing/balanceYour credit balance (USD).Bearer key
GET /v1/billing/paymentsYour payments, newest first.Bearer key
POST /v1/billing/checkoutCard or SEPA top-up through a hosted checkout page. Not enabled yet.Bearer key
POST /v1/billing/mollie/checkoutiDEAL, Bancontact, card or bank-transfer top-up in euros through a hosted payment page (Mollie). Body: {"amount_eur": 25}. Not enabled yet.Bearer key
POST /v1/billing/x402/topupStablecoin top-up (USDC or EURC) with the x402 protocol. Not enabled yet.Bearer key
GET /v1/modelsModels the operator offers.None
GET /healthStatus, active guard kind and model, policy id, version and hash, and guard limits.None
GET /api/audit/verifyVerifies the ledger hash chain. See Audit ledger.Operator; restrict at your proxy

POST /v1/guard/check

The safety gate on its own, with no model behind it. Use it to screen prompts before they reach your own model, to screen your model's answers, or to gate user content in a product that never calls our proxy. It runs the same checks as the proxy and is bound by the same fail-closed rules: if the check cannot be completed you get an error, never an "allow".

Request fields

A JSON body with Authorization: Bearer. Unknown fields are refused, so a typo can never become an unchecked request.

FieldRules
stage"input" (default) or "output".
inputA non-empty string: shorthand for one user message.
messagesA non-empty array of messages, as in chat completions, with the same roles and the same rules for content. Send input or messages, not both.
outputRequired for stage: "output": the assistant text to check. With input or messages it is read as the prompt context for that output. Not allowed for stage: "input".
depthOptional: standard (default), deep, exhaustive, long_context or long_context_fast; for stage: "input" only. Only the depths the operator offers are accepted (400 depth_unavailable otherwise, nothing billed). See below.
sensitivityOptional, for stage: "input" only: standard (default) blocks what the guard calls unsafe; strict also blocks what it calls controversial. Anything else is 400 invalid_sensitivity, nothing billed. Same price. See "Severity and sensitivity" below.
curl -s https://API_HOST/v1/guard/check -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
  -d '{"input":"Summarise the GDPR in two sentences."}'

# Is this answer allowed to go back to the user?
curl -s https://API_HOST/v1/guard/check -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
  -d '{"stage":"output","input":"the user prompt (optional)","output":"the model answer"}'

# A deeper look, if the operator offers it
curl -s https://API_HOST/v1/guard/check -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
  -d '{"input":"...","depth":"deep"}'

Screening depth

depthWhat is judged
standardThe whole text, once.
deepThe whole text, and the last sentence of the last user message on its own.
exhaustiveThe whole text, and every sentence on its own.
long_contextA long-context model reads the whole text in one call, whatever its length.

A request buried inside ordinary framing (a friendly paragraph, "for an audit") can be missed when the text is read once and is found when its sentences are judged on their own. Reading more also raises the chance that harmless text is blocked, and the deeper depths cost more, so choose by which mistake costs you more. Each gateway offers only the depths its operator has enabled (GET /health lists them as guardDepth). Asking for another one is refused with 400 depth_unavailable (an unknown name: invalid_depth) before anything is billed: you never silently get a shallower check than the one you asked for. The answer says which depth was used.

Response

{
  "id": "req_...",
  "object": "guard.check",
  "stage": "input",
  "depth": "standard",
  "decision": "block",
  "category": "cbrn_weapons",
  "reason": "short, generic explanation from the classifier",
  "severity": "unsafe",
  "sensitivity": "standard",
  "policy": { "id": "...", "version": "1.0.0", "sha256": "64 hex characters" },
  "usage": { "characters": 3400, "billed_blocks": 4, "price_per_block_usd": 0.000075 },
  "cost_usd": 0.0003,
  "credits_remaining_usd": 24.99
}

A decision is data, not an error: an allow and a block are both HTTP 200. decision is "allow" or "block"; for an allow, category is "none" and reason is null. usage.depth_price_multiplier appears only when the operator prices the depth above standard. severity (also the header x-valetta-severity) is the guard's own label for the text, safe, controversial or unsafe; it is null for stage: "output".

Severity and sensitivity

The local guard answers safe, controversial or unsafe. By default only unsafe is a block, and the response tells you when a text you were allowed was controversial, so you can log it, send it to review or ask the user. Set sensitivity: "strict" to block controversial text too. Strict is a trade, not a free setting: it blocks more of what is harmful and also more of what is harmless, most of all text that merely sounds dangerous, so test it on your own traffic before you rely on it. The label has three levels, not a probability, so there is no threshold to tune beyond these two. It applies to the local guard only: the long-context model and the policy-model gate say safe or unsafe, so on a text long enough to go to the long-context model, strict changes nothing and severity is safe or unsafe.

StatusMeaningBilled
200A check happened: read decision.Yes
400Invalid body; code says which field (including invalid_role, depth_unavailable, invalid_depth).No
401Missing, malformed or revoked key.No
402Not enough credits for one check.No
413Body too large, or text too long to verify. There is no "allow" for text that could not be read.No
429Rate limit; see Retry-After.No
501stage: "output" while the operator has the output guard switched off: it never answers "allow" without checking.No
503The guard failed, timed out or is at capacity; see Retry-After. Never an allow.No

Only HTTP 200 means a check happened. Treat anything else as "not checked" and do not let the content through.

Price: per started block of 1,000 characters of what you send, at least one block, the same whether the answer is allow or block; the pricing page has the price and the minimum top-up. At a depth other than standard the operator may charge a multiple of it.

What it does not do

  • It judges only the text sent in that one call. If the decision depends on earlier turns, send them in messages.
  • It does not store your text: nothing from the request body is written to logs or to the ledger; only hashes feed the verdict cache.
  • allow is the classifier's judgement against the published policy: not a legal opinion, and not a guarantee about what a model will do with the text. The limits we have measured are on the security and evidence pages.

POST /v1/chat/completions

Request fields

FieldRules
modelRequired string, up to 200 characters. Must be a model the operator offers, otherwise unknown_model.
messagesRequired, non-empty array of objects with a role from system, developer, user, assistant, tool, function; any other role is refused with invalid_role. content is a string, an array of text parts, or null (for assistant tool calls). Any other part type is refused with unsupported_content_part.
streamBoolean. With the output guard on, the stream is buffered and released after inspection.
max_tokensInteger from 1 to 16,384. Omitted: 2048. max_completion_tokens is accepted as an alias. Out-of-range values are refused, not clamped.
nInteger from 1 to 4. Every choice is inspected.
tools, functions, function_call, response_formatForwarded, and also read by the input gate as part of the prompt.
temperature, top_p, stop, seed, presence_penalty, frequency_penalty, logit_bias, user, tool_choice, reasoning_effortForwarded unchanged.
Anything elseDropped. A key that differs from a recognised key only in letter case is rejected with non_canonical_key.

What the gate reads

  • Message text in every role is judged. Text in an assistant message, a tool message or a later system message is judged as its own text as well as in the conversation, and so are the tools / response_format definitions; tool-call arguments are read too. In our own test, harmful text placed in an assistant message was caught as often as the same text sent as a user message. Consequence for chat clients: because the whole history is checked on every request, an earlier assistant reply that names a harmful topic while refusing it can be blocked on its own text, on that turn and on later ones. Send only the history your application needs.
  • A normalised copy: Unicode-normalised, invisible characters removed, base64, hex and percent-encoded text decoded (two passes). Your original messages are what the model receives.
  • Long inputs in overlapping windows (default 3,500 characters with 500 overlap; the operator may set a lower cap, 1,600 on the CPU pilot we measured). Above the verification cap the request is refused with 413.

What the output guard reads

  • The text of every choice, tool-call arguments and reasoning fields.
  • For streams, the whole completion, before any byte is released. If the upstream ignores stream and replies with plain JSON, that reply is inspected too.
  • If a completion is too long to verify, it is refused with 451 and nothing is delivered.

Responses

Allowed: the upstream status and body, unchanged. Blocked on input or output: 451 with a JSON error object and the verdict headers. Everything else: see Errors and headers.

Billing-relevant behaviour

  • A request reserves an estimated cost up front and settles on actual usage. Requests refused before judgement (400, 401, 402, 413, 429) are not charged.
  • If the guard itself is unreachable (HTTP 500), the reservation is refunded and nothing is forwarded.
  • Blocked requests are charged for the inspection, not for model inference.

Billing endpoints

Status: balance and payments are available. iDEAL, Bancontact, card, SEPA and stablecoin top-ups are built and tested but not enabled: until they are, credits are added against an invoice or bank transfer, and a top-up call answers 501 payments_disabled. All the billing endpoints use the same Authorization: Bearer key as the guard and the same per-key rate limit. The pricing page has the price and the minimum top-up.

Balance and payments

curl -s https://API_HOST/v1/billing/balance  -H "Authorization: Bearer $KEY"
# {"object":"billing.balance","credits_usd":24.9,"reserved_usd":0.01,"spent_usd":1.1}

curl -s https://API_HOST/v1/billing/payments -H "Authorization: Bearer $KEY"
# {"object":"list","data":[{"id":"pay_...","provider":"stripe","amount_usd":26.78,"status":"completed","created_at":"...","completed_at":"..."}]}

Credits are held in US dollars. reserved_usd is what in-flight requests have set aside; spent_usd is the total settled. The payment list shows the last 100 payments of your account; provider is stripe, x402 or manual (an invoice top-up), and status is pending, completed or failed.

Card or SEPA top-up

curl -s https://API_HOST/v1/billing/checkout -H "Authorization: Bearer $KEY" -H "content-type: application/json" -d '{"amount_eur": 25}'
# {"object":"checkout.session","id":"cs_...","url":"https://checkout.stripe.com/...","currency":"eur","amount_eur":25,"credits_usd":26.785714,"expires_at":...}

The amount is in euro, with at most two decimals, from 5 to 5,000 by default (a deployment charging in US dollars takes amount_usd instead). Open url to pay on the payment provider's page: card data never reaches this API. Credits arrive when the provider confirms the payment, usually within seconds, not when your browser returns. The euro amount is converted to the dollar credit at a fixed rate (1.0714285714 dollars per euro), so the euro price per character does not change with the exchange rate. A wrong amount answers 400 invalid_amount.

Stablecoin top-up (x402)

POST /v1/billing/x402/topup   {"amount_usd": 25}    # USDC
                         or   {"amount_eur": 25}    # EURC
1) no PAYMENT-SIGNATURE header  -> 402, PAYMENT-REQUIRED header: base64 of what to pay (scheme, network, amount, asset, recipient)
2) PAYMENT-SIGNATURE: base64 of a signed transfer authorisation -> 200 {"status":"completed","credited_usd":...,"transaction":"0x..."}

Any x402 version 2 client library does both steps. One deployment accepts one asset: USDC (priced in US dollars) or EURC (priced in euro). The gateway checks the signed authorisation against the requirements it built itself before anything is settled.

StatusMeaning
200Credited. already_credited: true for a replay: nothing more is added.
202The transfer was broadcast and awaits confirmation; credits are added when it confirms.
400Malformed payment, or it does not match the requirements. Nothing was sent for settlement.
402Payment missing, expired, rejected, or settlement failed. A failed authorisation cannot be reused: sign a new one.
409The same authorisation is already being processed, or was used by another account.
501payments_disabled: this top-up method is not enabled on this gateway.
502The settlement service is unavailable (retry: nothing settled), or the outcome is unknown: do not pay again, contact us and we reconcile it.

A payment is credited at most once: a replayed webhook or a replayed authorisation never adds credit twice. Stablecoin payments leave the payer's wallet address and the transaction hash in our records, which are public on the chain; the privacy notice names the settlement service and the chain before this is enabled.