Quick Start
Make your first authenticated API call in under 5 minutes. We'll cover getting your API key, sending your first request, and interpreting the response.
Create an account and get your API key
Sign in at guardrail.ai/login using your GitHub or Google account. Once inside your dashboard, navigate to API Keys and click Generate New Key.
Your full key is shown only once at generation. Copy it to a secure secrets manager immediately. We store only a SHA-256 hash.
Send your first request
Use any HTTP client. The base URL is:
curl -X POST https://api.guardrail.ai/v1/guardrail/check \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "my-customer-support-agent",
"proposed_text": "Your credit card ending in 4242 has been refunded $200."
}'import requests
GUARDRAIL_URL = "https://api.guardrail.ai/v1/guardrail/check"
API_KEY = "sk_your_api_key_here"
response = requests.post(
GUARDRAIL_URL,
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"agent_id": "my-customer-support-agent",
"proposed_text": "Your credit card ending in 4242 has been refunded $200."
}
)
result = response.json()
print(result)const response = await fetch('https://api.guardrail.ai/v1/guardrail/check', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
agent_id: 'my-customer-support-agent',
proposed_text: 'Your credit card ending in 4242 has been refunded $200.',
}),
});
const result = await response.json();
console.log(result);Understand the response
Every successful call returns a structured JSON object.
{
"risk_score": 85,
"status": "flagged",
"flags": [
"PII detected: Credit card number suffix (4242) identified",
"Financial commitment: Unauthorized refund of $200 mentioned"
],
"redacted_text": "Your credit card ending in **** has been refunded $***."
}risk_scoreInteger 0–100. 0 = safe, 100 = maximum risk. We recommend rejecting anything above 60.
status`approved`, `flagged`, or `rejected`. Map this to your agent's allow/block logic.
flagsArray of human-readable strings explaining every rule violation found.
redacted_textA sanitized copy of the input text with sensitive data replaced by asterisks. Safe to log.
You're live!
You've successfully integrated Guardrail.ai. Each call costs $0.01 and is deducted from your credits balance automatically.