GOPURA

Evaluation

Structured, calibrated decisions in one call — ask typed questions about any state and get boolean/choice/score answers with probabilities.

POST /v1/evaluate turns free-form judgement into structured, calibrated decisions. You send some state (a string, or structured data like a record or chat log) plus a map of typed questions, and get back one calibrated answer per question — a probability, a chosen option, or a score — in a single call. It's backed by TypeSafe Jev, a purpose-built evaluation model: fast, cheap (billed on input tokens only), and it answers many questions in parallel per request.

Unlike asking a chat model to "return JSON", the answers are calibrated and typed — you don't parse prose and hope.

curl https://api.gopura.net/v1/evaluate \
  -H "Authorization: Bearer $GOPURA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "typesafe-ai/jev",
    "state": "Customer: my order never arrived and I want a refund now.",
    "questions": {
      "frustrated": { "type": "boolean", "instructions": "Is the customer frustrated?" },
      "intent": { "type": "choice", "instructions": "What do they want?",
                  "criteria": { "refund": "money back", "reship": "item resent", "info": "just asking" } },
      "urgency": { "type": "score", "instructions": "How urgent is this?",
                   "criteria": ["low", "medium", "high"] }
    }
  }'

Question types

TypeYou provideYou get back
booleaninstructions (+ optional criteria){ probability } (0–1)
choiceinstructions + criteria (map option→description, 2–255){ choice, probabilities, confidence }
scoreinstructions + criteria (ordered array, 2–10 levels){ score, probabilities, confidence } — score is a float position on the scale

Send 1–50 questions in a single request; each answer comes back under the key you chose.

Response

{
  "object": "evaluation",
  "model": "typesafe-ai/jev",
  "answers": {
    "frustrated": { "type": "boolean", "probability": 0.94 },
    "intent": { "type": "choice", "choice": "refund",
                "probabilities": { "refund": 0.9, "reship": 0.06, "info": 0.04 }, "confidence": 0.9 },
    "urgency": { "type": "score", "score": 1.8,
                 "probabilities": { "0": 0.05, "1": 0.35, "2": 0.6 }, "confidence": 0.7 }
  },
  "usage": { "cost": 0.0000250, "input_tokens": 500, "output_tokens": 12 }
}

Billed on input tokens only (output is free), so a typical multi-question call is a few thousandths of a cent — the exact figure rides in usage.cost as everywhere on Gopura.

What to use it for

  • Verify an extraction — pair it with /v1/extract or a document pack: "Does the extracted total match the line items?" (boolean), "Is this a valid timesheet?" (choice). Extract → evaluate the extraction.
  • Guardrails — "Is this message about our products?" (boolean), cheaply and calibrated, before dispatching to a chat model.
  • Routing — "Which queue should this go to?" (choice) as fast app logic.
  • Scoring / moderation — grade responses or content against a rubric (score).

state can be structured JSON (a record, a chat transcript, an extracted object), not just a string — evaluate the actual shape of your data. Sending a non-evaluation model here returns a 400 naming the right endpoint.