Skip to main content
Get a decision from Sage in a few minutes.

Prerequisites

  • A Levanto API key (lv_live_...) — see Authentication if you don’t have one yet

Endpoint

https://sage.levanto.ai

Make a Yes/No decision

Every /decide call requires your API key — see Authentication for the header options and error codes.
endpoint="https://sage.levanto.ai"

curl -s \
  -H "Authorization: Bearer $SAGE_API_KEY" \
  -H 'Content-Type: application/json' \
  "$endpoint/decide" -d '{
  "content": "Marketing email draft promotes '\''guaranteed 40% returns'\'' and describes the product as '\''risk-free'\'' for accredited investors.",
  "question": {
    "id": "needs_compliance_review",
    "kind": "yesno",
    "instructions": "Does this copy require compliance review before send?"
  }
}'
Example response:
{
  "id": "needs_compliance_review",
  "kind": "yesno",
  "result": {
    "probability": 0.92,
    "confidence": 0.84,
    "answer": "yes"
  },
  "meta": { "model": "levanto-sage-v0.5", "latency_ms": 97.4 }
}

Request shape

Every /decide request uses this structure:
{
  "content": "<content to evaluate>",
  "question": {
    "id": "<stable result id>",
    "kind": "<yesno | choice | scale | sort | tags>",
    "instructions": "<question to answer>"
  }
}
Use content for the thing being evaluated. Use question.kind to select the decision kind and question.instructions for the criterion.
Each decision kind has its own size limits (option counts, tag counts, content length). See Limits before sending large requests.

Endpoints

MethodPathAuth requiredPurpose
GET/readyNoModel readiness — 503 while loading, 200 when ready
POST/decideYesOne decision
POST/decide/batchYesMany decisions

Next steps

Yes/No

Binary questions with probability and confidence.

Choice

Pick the best option from a set.

Use cases

Routing, guardrails, moderation, and ops triage patterns.