Developer docs · Quick start · about 5 minutes
Quick start
This guide takes you from zero to your first checked request. You create a key, point your existing OpenAI-compatible client at Gateboard, send a request, and read the decision receipt. Your prompts, models and application code stay as they are.
What you need
- A Gateboard account. Sign up if you do not have one.
- An application that calls an LLM through an OpenAI-compatible client: the official OpenAI SDKs, LangChain, LlamaIndex, or plain HTTP.
- Permission to change one configuration value (the base URL) and one secret (the API key).
Step 1: Create a key and pick its sector pack
Open the Keys page, give the key a name, and choose the policy pack it enforces, for example kids, patients or banking. The pack travels with the key: your code never names it, and changing the pack never needs a deploy.
One key per product and environment
Use separate keys for staging and production, and for products in different sectors. Each key has its own pack, model list, budget and evidence trail.
Step 2: Change the base_url
Point your client at the Gateboard gateway and use the new key. Store the key as a secret, never in code.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://gw.gateboard.ai/v1",
api_key=os.environ["SENTRIA_API_KEY"],
)Step 3: Send a request
Send any request. This one contains a name and a phone number, so with the patients or kids pack you can see redaction at work.
resp = client.chat.completions.create(
model="phoeniqs-glm5",
messages=[{"role": "user", "content": "My name is Mario Rossi, call me on +39 333 123 4567"}],
)
print(resp.choices[0].message.content)The response has the usual OpenAI shape. When a control changed something, the content ends with the marker [SENTRIA_GUARDRAILS_APPLIED] and, depending on the pack, a notice such as an AI disclosure.
Step 4: Read the receipt
Open the evidence explorer. Every call, allowed or blocked, has one row: the pack, what each control decided, the rule that fired, and a hash that chains it to the previous row. The verifier checks the whole chain end to end.
The evidence stores hashes of prompts and responses, not the raw text. The conformity report in the admin area turns these rows into a document mapped to EU AI Act requirements.
What happens on every request
- The key is resolved to your account, its pack, its model list and its budget.
- Duplicate submissions collapse, and rate and budget limits are applied.
- The prompt is checked against the pack: personal data is redacted, forbidden requests are blocked.
- The model answers, and the answer is checked again before it reaches your app.
- The decision is written to the evidence log, with usage counted in the same transaction.
Handling blocks and errors
A blocked request returns HTTP 403 in the OpenAI error shape, with the pack, the category and arequest_id you can look up in the evidence explorer. Show your user a clear refusal, never the raw message.
Blocked request
HTTP/1.1 403 Forbidden
{
"error": {
"message": "Input blocked by guardrail policy: Classified as 'violence'",
"type": "policy_violation",
"code": "input_guardrail_blocked",
"policy_pack": "kids",
"violation_category": "violence",
"request_id": "req_7d8f3c9e"
}
}| code | status | meaning | what to do |
|---|---|---|---|
| invalid_api_key | 401 | Missing or invalid Bearer token | Check the key and the Authorization header |
| model_not_found | 400 | The model is not allowed for this key | Call GET /v1/models to list the models your key may use |
| input_guardrail_blocked | 403 | The prompt violates the key's policy pack | Show the user a refusal; log the request_id |
| output_guardrail_blocked | 403 | The model's answer violates the policy pack | Show a fallback message; log the request_id |
| quota_exceeded | 429 | The key's budget for the period is spent | Raise the budget in the portal or wait for retry_after |
| rate_limit_exceeded | 429 | Too many requests per minute for this key | Back off and retry after the Retry-After header |
| upstream_error | 502 | The model provider returned an error | Retry with backoff |
Latency
What each control costs per request. The cost class is known today; the times are filled in from a benchmark run, and until then each cell says so.