Gateway
Chat completions
OpenAI-compatible chat completions through the Guardion Gateway. Same request and response shape as the OpenAI Chat Completions API; guardrails run inline. If a guardrail blocks under a block config, the gateway returns the Guardion verdict instead of the model output.
/v1/chat/completionsHow to use the Gateway
The Guardion Gateway is an OpenAI-compatible reverse proxy that runs your guardrails inline on every LLM call. Point your existing OpenAI/Anthropic SDK at the gateway base URL, add two headers, and every request is evaluated before it reaches the provider (and the response on the way back).
The gateway always forwards your own provider key to the LLM — Guardion never stores it. It only authenticates you (x-guardion-api-key) and applies the guardrail policy (x-guardion-policy).
https://gateway.guardion.ai
Headers
x-guardion-api-keystringrequiredYour Guardion API key (authenticates against Guard).
AuthorizationstringrequiredYour own provider key, e.g. Bearer sk-..., forwarded to the provider as-is.
x-guardion-policystringPolicy slug that loads guardrail definitions (controls guardrails, not routing).
x-guardion-providerstringLLM provider (e.g. openai, anthropic). Inferred from the model prefix if omitted.
Body Parameters
modelstringrequiredModel id, e.g. gpt-4o.
messagesMessage[]requiredChat messages (OpenAI format).
...anyAny other OpenAI Chat Completions parameter (temperature, stream, tools, …).
Response
idstringCompletion id.
objectstringAlways "chat.completion".
choicesChoice[]Standard OpenAI choices. When a guardrail blocks, the gateway returns the Guardion verdict (flagged labels + correction) instead of the model completion.
usageUsageToken usage: { prompt_tokens, completion_tokens, total_tokens }.
curl https://gateway.guardion.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "x-guardion-policy: my-policy-slug" \
-H "x-guardion-api-key: $GUARDION_API_KEY" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [{ "role": "user", "content": "Hello!" }]
}'
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "gpt-4o",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help you today?" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 9, "completion_tokens": 12, "total_tokens": 21 }
}