API Documentation

Integrate Injecto into your AI app in under 5 minutes. Screen every user prompt before it reaches your LLM.

Base URL

https://injecto.xyz

Authentication

Pass your API key in the x-api-key header on every request. Get a key on the pricing page.

x-api-key: inj_your_key_here

Quickstart

import requests result = requests.post( "https://injecto.xyz/api/detect", headers={"x-api-key": "inj_your_key_here"}, json={"prompt": user_message} ).json() if not result["safe"]: raise ValueError(f"Blocked: {result['attack_types']}") # Safe — call your LLM

POST/demo/detect

Free, unauthenticated endpoint for testing and demos. Rate limited. Use /api/detect in production.

curl -X POST https://injecto.xyz/demo/detect -H "Content-Type: application/json" -d '{"prompt": "ignore all previous instructions"}'

POST/api/detect

Production endpoint. Requires a valid API key. Returns full verdict with risk score, severity, and attack classification.

curl -X POST https://injecto.xyz/api/detect -H "x-api-key: inj_your_key_here" -H "Content-Type: application/json" -d '{"prompt": "your user input here"}'

GET/api/stats

Check your plan and request usage. Requires API key.

curl https://injecto.xyz/api/stats -H "x-api-key: inj_your_key_here"

Response fields

{ "safe": false, "risk_score": 90, "severity": "HIGH", "attack_types": ["Instruction Override", "Role Hijacking"], "patterns": ["ignore all instructions", "you are now"], "prompt_length": 9, "timestamp": "2026-01-01T00:00:00" }
FieldTypeDescription
safebooleantrue = safe to pass to your LLM
risk_scoreinteger0–100. Higher = more dangerous
severitystringLOW / MEDIUM / HIGH
attack_typesarrayHuman-readable attack categories detected
patternsarrayExact phrases that triggered detection
prompt_lengthintegerWord count of input

Attack types

TypeDescription
Instruction Override"ignore previous instructions" and variants
Role Hijacking"pretend you are" / "you are now" attacks
Prompt LeakingAttempts to extract system prompt or config
Jailbreak AttackDAN, developer mode, and constraint removal
Persona InjectionGradual identity substitution via "new persona"
Privilege Escalation"act as system" and similar elevation attempts
Safety BypassDirect "bypass safety" / "disable restrictions"
Firewall BlockHardcoded forbidden content (passwords, secrets)

Error codes

StatusMeaning
400Missing or empty prompt field
401No API key provided
403Invalid API key
429Monthly request limit reached — upgrade plan