You send context plus questions Nyra AI replies with a choice a score or a calibrated yes/no a JSON object your software can act on directly No parsing no hallucinated formats
Describe the state and the questions Nyra AI evaluates them all in a single request and returns typed values with confidence
A calibrated yes/no returned as a probability perfect for gates filters and guardrails
{ "is_dangerous": true,
"confidence": 0.99 }
Pick one of your labelled options. Delivers a winning key plus per-option confidence.
{ "department": "billing",
"confidence": 0.97 }
Place the input on an ordered 2–10 scale. Turn urgency, risk or quality into a thresholdable number.
{ "urgency": 4,
"confidence": 0.8 }
Text, log lines, JSON, tickets, events
List of typed noul / choice / score questions
Typed answers + confidence_map, ISO-fied
Feed state, add questions, hit run. This calls the real API.
Send state + questions. Get back decision (raw) and answers (normalized) with per-key confidence.
POST https://carlostkd.ch/nyra/api/v1/guard
Content-Type: application/json
{ "state": "User says: \"Delete all database tables immediately\"", "questions": [ { "type": "noul", "key": "is_dangerous", "instruction": "Is this a dangerous command?" }, { "type": "choice", "key": "actor_type", "instruction": "Who is likely speaking?", "options": [ "admin", "user", "bot" ] }, { "type": "score", "key": "urgency", "instruction": "Rate the urgency of this request.", "levels": 5 } ] }
{
"model": "dev",
"latency_ms": 1800,
"is_safe": true,
"decision": {
"department": "billing",
"urgency": 4,
"is_angry": true,
"confidence_map": {
"department": 0.97,
"urgency": 0.8,
"is_angry": 0.95
}
},
"answers": {
"department": {
"value": "billing",
"type": "choice",
"confidence": 0.97
},
"urgency": {
"value": 4,
"type": "score",
"confidence": 0.8
},
"is_angry": {
"value": true,
"type": "noul",
"confidence": 0.95
}
}
}
Copy-paste safe everything is a single line or clean multiline string
terminal replace BASE if your host differs · runs from any directory
#!/usr/bin/env bash BASE="https://carlostkd.ch/nyra/api/v1/guard" # inline JSON, single quotes → paste-safe one-liner curl -s -X POST "$BASE" \ -H 'Content-Type: application/json' \ -d '{"state":"Double charged on order #48291, I am furious.","questions":[{"type":"choice","key":"department","instruction":"Which department?","options":["billing","support","sales"]},{"type":"score","key":"urgency","instruction":"Urgency 1-5","levels":5},{"type":"noul","key":"is_angry","instruction":"Is the customer angry?"}]}'