POST /v1/decide
API reference
Bearer laya_ keys. state may be a string or JSON. Choice, score, and noul, plus batch decide, a free confidence gate, and application APIs. Prepaid input tokens; structured output is free.
Authentication
Authorization: Bearer laya_…
Content-Type: application/json
https://laya-model.comCreate keys on Account. Model aliases: english and multilingual.
POST /v1/decide
Alias POST /v1/systemone. A signed-in browser session bills the same balance. Anonymous callers get 1 free run by default (ANON_FREE_RUNS).
curl https://laya-model.com/v1/decide \
-H "Authorization: Bearer laya_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"state": {
"ticket": "I was charged twice and nobody has replied for 3 days.",
"channel": "email"
},
"questions": {
"route": {
"type": "choice",
"instructions": "Where should this go?",
"criteria": { "billing": "money", "bug": "broken", "account": "login" }
},
"urgency": {
"type": "score",
"instructions": "How urgent is this?",
"criteria": ["routine", "today", "urgent"]
},
"escalate": { "type": "noul", "instructions": "Escalate to a human now?" }
}
}'Request body
statestring, object, or array.questionsmap of ids to noul, choice, or score.- Only usage.input_tokens is billed. Structured output is free. A new Google account starts with 10k_monthly (10,000 input tokens each UTC month).
Batch decide
POST /v1/batch/decide: up to 20 states, shared questions. Each state is metered. Same laya_ key.
curl https://laya-model.com/v1/batch/decide \
-H "Authorization: Bearer laya_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"states":["Passage A","Passage B"],"questions":{"relevant":{"type":"noul","instructions":"Does this answer the question?"}}}'Confidence gate
POST /v1/gate applies a local policy and returns allow, review, or block. No upstream call, no token burn, and no key required.
curl https://laya-model.com/v1/gate \
-H "Content-Type: application/json" \
-d '{"answers":{"toxicity":{"type":"noul","noul":0.12}},"policy":{"min_confidence":0.55}}'Errors
401missing or invalid laya_ key, or the anonymous quota is used.402insufficient prepaid balance.429RPM, or the hourly / daily input-token cap.503IMPOSSIBL_API_KEY is not configured.
Application APIs
POST /v1/support/triageSupport TriageRoute a ticket, score urgency, and flag churn.POST /v1/email/triageEmail TriagePick a folder, a reply priority, and whether a human should answer.POST /v1/leads/qualifyLead QualifyScore fit and intent from a short inbound note.POST /v1/app/reviewApp ReviewLabel a store review and whether it needs a reply.POST /v1/agent/riskAgent RiskDecide whether an agent action should run, pause, or stop.POST /v1/prompt/guardPrompt GuardFlag instruction override attempts before they hit a tool.POST /v1/model/routeModel RouterPick a model lane for a task: small, reason, or human.POST /v1/pr/riskPR RiskScore a change description for deploy risk.POST /v1/context/filterContext FilterKeep or drop a retrieved chunk before it enters the prompt.POST /v1/social/post-analyzeSocial Post AnalyzerScore a draft post for hook, evidence, and format.POST /v1/content/classifyContent ClassifyLabel a page or post into a small taxonomy.POST /v1/ads/analyzeAds AnalyzeCheck a short ad for claim strength and policy risk.POST /v1/seo/page-relevanceSEO Page RelevanceDoes this page answer the query?POST /v1/content/moderateContent ModerateAllow, review, or block a user-generated snippet.POST /v1/rag/relevanceRAG RelevanceScore whether a passage answers the question.POST /v1/scam/spotScam SpotterSpot phishing and what the sender is pushing.POST /v1/review/fakeReview FakeEstimate whether a product review looks fabricated.