Bridge by Wekoya / Docs / Decisions

Decisions (Jev)

Updated

Jev, by TypeSafe, does not write text. You give it something to look at (a message, a document, a record) and named questions about it, and it answers each one with a probability you can act on, usually in under a second. Use it to route support tickets, flag risky payments, grade answers or tag content, where a chat model would be slower, dearer and harder to parse. Send it to POST /v1/decisions, not to chat completions. A typical call costs about ₦0.03, from your Wekoya balance.

curl https://wekoya-api.wekoya.tech/v1/decisions \
  -H "Authorization: Bearer $WEKOYA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "jev-latest",
    "state": "Help! My payouts have been failing for 3 days and I am losing customers.",
    "questions": {
      "department": {
        "type": "choice",
        "instructions": "Which team should handle this?",
        "criteria": {
          "billing": "Payments, invoicing, refunds",
          "technical": "Bugs, outages, integrations",
          "sales": "Pricing, upgrades, new accounts"
        }
      },
      "urgent": { "type": "noul", "instructions": "Is this urgent?" },
      "frustration": {
        "type": "score",
        "instructions": "How frustrated is the customer?",
        "criteria": ["calm", "annoyed", "angry"]
      }
    }
  }'
TypeAsk withYou get back
choicecriteria: each label and what it means (1 to 255 of them)choice, its confidence, and a probability for every label
scorecriteria: 2 to 10 levels, lowest firstscore, a weighted position from 0 (first level) up; legend maps each position to its level
noulJust instructions: a yes or no questionnoul: the probability that the answer is yes, from 0 to 1
{
  "id": "dec_…",
  "object": "decision",
  "model": "jev-latest",
  "version": "jev-1.13.0",
  "answers": {
    "department": {
      "type": "choice",
      "choice": "billing",
      "confidence": 0.69,
      "probabilities": { "billing": 0.79, "technical": 0.21, "sales": 0.0 }
    },
    "urgent": { "type": "noul", "noul": 0.95 },
    "frustration": {
      "type": "score",
      "score": 1.94,
      "confidence": 0.91,
      "legend": { "0": "calm", "1": "annoyed", "2": "angry" },
      "probabilities": { "0": 0.0, "1": 0.06, "2": 0.94 }
    }
  },
  "usage": { "input_tokens": 403, "output_tokens": 70 },
  "wekoya": { "cost": 0.03, "currency": "NGN", "usage_status": "reported" }
}

model is jev-latest (also accepted as jev) or jev-preview; version says which release answered. Up to 50 questions per call and about 32,000 tokens in total. state can be text or JSON:

import os, requests

reply = requests.post(
    "https://wekoya-api.wekoya.tech/v1/decisions",
    headers={"Authorization": f"Bearer {os.environ['WEKOYA_API_KEY']}"},
    json={
        "model": "jev-latest",
        # A string, or structured data: Jev reads JSON as well as text.
        "state": {"amount_ngn": 450000, "country": "NG", "account_age_days": 2},
        "questions": {
            "review": {"type": "noul", "instructions": "Should a person review this payment before it goes through?"},
        },
    },
    timeout=30,
)
reply.raise_for_status()
if reply.json()["answers"]["review"]["noul"] > 0.8:
    send_to_review_queue()

Everything that applies to chat applies here: key scopes and model allow-lists, end users and their budgets (X-Bridge-End-User), and the same errors. A call that fails costs nothing. Jev runs on your Wekoya balance only, so it does not use your own provider keys. Decision models are left out of GET /v1/models so chat pickers never offer them; list them with GET /v1/models?type=decision.