Five examples you can run unchanged

Complete requests — a state, typed questions and a command — for five jobs a decision model does well. Each body on this page is sent to the live handler by the test suite, so none of them can quietly stop working.

What is reproducible here

Every body on this page is the exact body the test suite sends to POST /api/v1/decisions, with only the model provider stubbed. If a field is renamed, a label is rejected or a limit is lowered, the test fails before this page can publish a request that no longer works.

What repeats is the request and the invariants of the answer: every declared label appears in probabilities, each distribution sums to 1, the response names the model that answered, and the call carries a requestId. What does not repeat is the number itself — the distribution comes from the weights, and it can move when the model does. One run is one observation, not a benchmark.

Two contracts are shown where they differ. POST /api/v1/decisions needs an API key and carries choice, noul and score questions. POST /api/decide needs no key and carries choice questions only, so its body below leaves the other questions out and names them instead of hiding them.

No key yet? Every keyless body below runs from a terminal now, counted against the free allowance for the browser session it names. A paid key raises the daily quota, lifts the state cap from 8,000 characters to the model’s window, and adds the noul and score questions.

Support ticket: queue and urgency

One message, two questions: which queue owns the ticket, and how fast a human has to see it.

Routing and triage are usually two systems fed by two models, or by a list of keywords that rots. Here they are two questions about the same state in one call, so they cost one decision and they cannot disagree about what the message says. The queue is a choice over four labels; urgency is a score over four ordered levels, which returns a number and a distribution rather than a bucket somebody chose in advance.

The keyless body carries the choice questions only; urgency needs the keyed endpoint.

POST /api/v1/decisions · your API key

curl --fail-with-body https://clef-flash.com/api/v1/decisions \
  -H 'content-type: application/json' \
  -H "authorization: Bearer $CLEF_FLASH_KEY" \
  --data-binary @- <<'CLEF_REQUEST'
{
  "text": "Nadia wrote: I was charged twice for the October invoice — $38 on 2 October and $38 again on 3 October. I emailed support on Monday and got no reply. This is the second month in a row I have had to chase this, and I am close to cancelling.",
  "questions": [
    {
      "id": "queue",
      "type": "choice",
      "instructions": "Which queue should own this ticket?",
      "criteria": {
        "billing": "a charge, an invoice, a refund or a plan change",
        "technical": "a bug or an error message",
        "account": "login, access or profile details",
        "cancellation": "they want to stop paying"
      }
    },
    {
      "id": "urgency",
      "type": "score",
      "instructions": "How quickly does this need a human?",
      "criteria": [
        "whenever",
        "this week",
        "today",
        "immediately"
      ]
    }
  ]
}
CLEF_REQUEST

POST /api/decide · no key

curl --fail-with-body https://clef-flash.com/api/decide \
  -H 'content-type: application/json' \
  --data-binary @- <<'CLEF_REQUEST'
{
  "state": "Nadia wrote: I was charged twice for the October invoice — $38 on 2 October and $38 again on 3 October. I emailed support on Monday and got no reply. This is the second month in a row I have had to chase this, and I am close to cancelling.",
  "questions": [
    {
      "id": "queue",
      "prompt": "Which queue should own this ticket?",
      "options": [
        "billing",
        "technical",
        "account",
        "cancellation"
      ]
    }
  ],
  "sessionId": "example-support-triage"
}
CLEF_REQUEST

What a correct answer must contain

  • answers.queue.probabilities holds exactly the four declared labels and sums to 1.
  • answers.urgency.score is a number from 0 to 3, and needsReview is true whenever its confidence is below the 0.85 threshold.
  • Both questions were answered by one call, so they cost one decision against the daily quota.

Comment: a policy decision and its category

A noul question asks a yes/no as a probability; a choice question names the policy area. Neither hands you a verdict you have to take on faith.

Moderation is a threshold decision, not a classification. noul gives you P(the comment breaks the rule), so the bar stays yours: auto-remove above 0.95, queue for a human between 0.5 and 0.95, publish below 0.5. The second question only runs when a human is going to look anyway, and it saves them from reading the thread to work out why the comment was held.

The keyless body carries the choice questions only; violates needs the keyed endpoint.

POST /api/v1/decisions · your API key

curl --fail-with-body https://clef-flash.com/api/v1/decisions \
  -H 'content-type: application/json' \
  -H "authorization: Bearer $CLEF_FLASH_KEY" \
  --data-binary @- <<'CLEF_REQUEST'
{
  "text": "Comment on the release thread: 'Been using this for a year and it is fine, but whoever runs your support account is a joke and should be fired.'",
  "questions": [
    {
      "id": "violates",
      "type": "noul",
      "instructions": "Does this comment break the rule against personal attacks?",
      "criteria": {
        "true": "it attacks a person rather than the product or the service",
        "false": "it criticises the product or the service without attacking a person"
      }
    },
    {
      "id": "category",
      "type": "choice",
      "instructions": "Which rule does the comment touch?",
      "criteria": {
        "harassment": "personal abuse aimed at a person",
        "spam": "advertising, links or repetition",
        "off_topic": "nothing to do with the discussion",
        "none": "within the rules"
      }
    }
  ]
}
CLEF_REQUEST

POST /api/decide · no key

curl --fail-with-body https://clef-flash.com/api/decide \
  -H 'content-type: application/json' \
  --data-binary @- <<'CLEF_REQUEST'
{
  "state": "Comment on the release thread: 'Been using this for a year and it is fine, but whoever runs your support account is a joke and should be fired.'",
  "questions": [
    {
      "id": "category",
      "prompt": "Which rule does the comment touch?",
      "options": [
        "harassment",
        "spam",
        "off_topic",
        "none"
      ]
    }
  ],
  "sessionId": "example-comment-moderation"
}
CLEF_REQUEST

What a correct answer must contain

  • answers.violates.noul is a probability between 0 and 1 — compare it with your own bar; it is not a verdict.
  • answers.violates.needsReview is true when neither side of the question gets a clear majority.
  • answers.category.probabilities holds exactly the four declared categories and sums to 1.

Inbound enquiry: intent and a buying signal

Two cheap questions that decide whether a human replies today or the enquiry waits in the queue.

Intent alone cannot tell a buyer from someone asking for free support, and a keyword filter cannot tell either. Pairing a choice over intent with a noul about budget names turns two weak signals into a routing rule you can defend: high intent and P(budget) above 0.8 goes to sales today, high intent with a low budget probability goes to the onboarding sequence, and low intent goes to support.

The keyless body carries the choice questions only; budget needs the keyed endpoint.

POST /api/v1/decisions · your API key

curl --fail-with-body https://clef-flash.com/api/v1/decisions \
  -H 'content-type: application/json' \
  -H "authorization: Bearer $CLEF_FLASH_KEY" \
  --data-binary @- <<'CLEF_REQUEST'
{
  "text": "Contact form: 'Hi — we are a 40-person logistics company in Rotterdam. We are evaluating decision models for our support queue and would need roughly 30,000 calls a month. I have budget approved for this quarter and can sign off; can we get a call this week?'",
  "questions": [
    {
      "id": "intent",
      "type": "choice",
      "instructions": "What is this sender trying to do?",
      "criteria": {
        "buying": "evaluating or asking to purchase",
        "support": "asking for help with something they already use",
        "partnership": "proposing a commercial arrangement of their own",
        "spam": "no genuine enquiry behind the message"
      }
    },
    {
      "id": "budget",
      "type": "noul",
      "instructions": "Does the sender name a budget, an approval or a purchase process?",
      "criteria": {
        "true": "they mention money set aside, an approved spend or a sign-off they can give",
        "false": "they ask about price or features without naming any authority to buy"
      }
    }
  ]
}
CLEF_REQUEST

POST /api/decide · no key

curl --fail-with-body https://clef-flash.com/api/decide \
  -H 'content-type: application/json' \
  --data-binary @- <<'CLEF_REQUEST'
{
  "state": "Contact form: 'Hi — we are a 40-person logistics company in Rotterdam. We are evaluating decision models for our support queue and would need roughly 30,000 calls a month. I have budget approved for this quarter and can sign off; can we get a call this week?'",
  "questions": [
    {
      "id": "intent",
      "prompt": "What is this sender trying to do?",
      "options": [
        "buying",
        "support",
        "partnership",
        "spam"
      ]
    }
  ],
  "sessionId": "example-lead-qualification"
}
CLEF_REQUEST

What a correct answer must contain

  • answers.intent.probabilities names all four labels and sums to 1.
  • answers.budget.noul is the probability that the sender can approve a purchase, on its own scale — it is not a share of the intent question.
  • A spam enquiry scores low on both questions, which is what the routing rule keys on.

Transaction JSON: ledger category and a review flag

A state can be a JSON object. Here the fields are the evidence and the questions are the two decisions the ledger has to make.

A string of escaped JSON is the shape a model reads worst, so the endpoint sends an object as an object. Categorisation is a choice over the ledger accounts; review is a score over three ordered levels, which lets the accounting team set where the line sits instead of accepting a yes/no from a classifier.

The keyless body carries the choice questions only; review needs the keyed endpoint.

POST /api/v1/decisions · your API key

curl --fail-with-body https://clef-flash.com/api/v1/decisions \
  -H 'content-type: application/json' \
  -H "authorization: Bearer $CLEF_FLASH_KEY" \
  --data-binary @- <<'CLEF_REQUEST'
{
  "state": {
    "merchant": "Uber",
    "description": "Ride to client office after the workshop",
    "amount": 48.2,
    "currency": "USD",
    "occurred_on": "2026-11-04",
    "card": "corporate",
    "submitted_by": "a.reyes"
  },
  "questions": [
    {
      "id": "category",
      "type": "choice",
      "instructions": "Which ledger account does this expense belong to?",
      "criteria": {
        "travel": "transport to or between work locations",
        "meals": "food and drink",
        "software": "subscriptions and licences",
        "hardware": "equipment",
        "other": "none of the above"
      }
    },
    {
      "id": "review",
      "type": "score",
      "instructions": "How much human review does this expense need?",
      "criteria": [
        "post automatically",
        "check the receipt",
        "hold for approval"
      ]
    }
  ]
}
CLEF_REQUEST

POST /api/decide · no key

curl --fail-with-body https://clef-flash.com/api/decide \
  -H 'content-type: application/json' \
  --data-binary @- <<'CLEF_REQUEST'
{
  "state": {
    "merchant": "Uber",
    "description": "Ride to client office after the workshop",
    "amount": 48.2,
    "currency": "USD",
    "occurred_on": "2026-11-04",
    "card": "corporate",
    "submitted_by": "a.reyes"
  },
  "questions": [
    {
      "id": "category",
      "prompt": "Which ledger account does this expense belong to?",
      "options": [
        "travel",
        "meals",
        "software",
        "hardware",
        "other"
      ]
    }
  ],
  "sessionId": "example-expense-category"
}
CLEF_REQUEST

What a correct answer must contain

  • The JSON object travels as an object: state carries it, and the model reads fields rather than escaped text.
  • answers.category.probabilities lists all five ledger accounts and sums to 1.
  • answers.review.score runs from 0 (post automatically) to 2 (hold for approval).

Error report: component and severity

Both questions are choices, so this example runs end to end without an API key.

An on-call rotation needs a page, not a paragraph of generated prose. Two choices over the same report name the component that owns the failure and how loudly to wake someone — and because both are choices, the free /api/decide contract can run the whole thing, which is the fastest way to check that the model agrees with your judgement on real incidents before wiring it in.

POST /api/v1/decisions · your API key

curl --fail-with-body https://clef-flash.com/api/v1/decisions \
  -H 'content-type: application/json' \
  -H "authorization: Bearer $CLEF_FLASH_KEY" \
  --data-binary @- <<'CLEF_REQUEST'
{
  "text": "Checkout failed for three customers in ten minutes.\nTypeError: Cannot read properties of undefined (reading 'amount')\n  at createPaymentIntent (billing/checkout.ts:142:31)\n  at handlePost (app/api/checkout/route.ts:88:12)\nUpstream returned 402 for card_declined, then the handler threw before the refund branch ran.\nOnly the EUR flow is affected; USD checkouts completed.",
  "questions": [
    {
      "id": "component",
      "type": "choice",
      "instructions": "Which component owns this failure?",
      "criteria": {
        "api": "request handling, validation or routing",
        "billing": "payments, invoices or credits",
        "ui": "rendering or client-side behaviour",
        "auth": "login, sessions or permissions"
      }
    },
    {
      "id": "severity",
      "type": "choice",
      "instructions": "How severe is this incident?",
      "criteria": {
        "low": "cosmetic or internal only",
        "medium": "degraded for some users, workaround exists",
        "high": "customers cannot complete a purchase",
        "critical": "data loss, security exposure or full outage"
      }
    }
  ]
}
CLEF_REQUEST

POST /api/decide · no key

curl --fail-with-body https://clef-flash.com/api/decide \
  -H 'content-type: application/json' \
  --data-binary @- <<'CLEF_REQUEST'
{
  "state": "Checkout failed for three customers in ten minutes.\nTypeError: Cannot read properties of undefined (reading 'amount')\n  at createPaymentIntent (billing/checkout.ts:142:31)\n  at handlePost (app/api/checkout/route.ts:88:12)\nUpstream returned 402 for card_declined, then the handler threw before the refund branch ran.\nOnly the EUR flow is affected; USD checkouts completed.",
  "questions": [
    {
      "id": "component",
      "prompt": "Which component owns this failure?",
      "options": [
        "api",
        "billing",
        "ui",
        "auth"
      ]
    },
    {
      "id": "severity",
      "prompt": "How severe is this incident?",
      "options": [
        "low",
        "medium",
        "high",
        "critical"
      ]
    }
  ],
  "sessionId": "example-incident-triage"
}
CLEF_REQUEST

What a correct answer must contain

  • answers.component and answers.severity both come back, each with all four labels in its probabilities.
  • Both questions are choice, so the keyless body below carries the whole request — nothing is left out.
  • The top-level needsReview is true when any answer falls below the threshold, which is your cue to page a human instead of the on-call.

Adapting one of these

Replace the state with your own text, or with a JSON object, and keep the questions. The schema is the part that costs thought: a choice needs 2–12 labels with one line of guidance each, a noul needs exactly true and false, and a score needs 2–7 levels ordered worst to best. Guidance is what the model reads when labels alone are ambiguous, so it is worth writing carefully.

Questions are batched, not pooled: one request may carry up to 8 questions about the same state and it still costs one decision. Two different states are two requests. Without a key the state is capped at 8,000 characters and the body at 64 KB; a paid key accepts 8 MB, and the state cap becomes the window of the model you name.

  • The default threshold is 0.85. An answer below it comes back with needsReview: true, and the threshold is yours to move between 0.5 and 1.
  • Name a model to pin the answer to specific weights; leave model out to use this deployment’s default. The response always says which model actually answered.
  • Branch on code, never on the error sentence. The full list is on /docs.
Clef-Flash playground community-hosted

Community-hosted demo of the 9B model. Runs live in your browser session.

Frequently asked questions

Can I run these without an API key?

Yes, while every question is a choice. Each example shows a keyless body for /api/decide; those are counted against the free allowance of the browser session named in the body. The two examples with a noul or score question show the keyed body as well, because that contract is what carries them.

Why will my probabilities differ from someone else’s run?

Because they are the model’s numbers, not a fixed table. The weights and the state decide the distribution, and a model update can move it. What stays fixed is the shape: every declared label appears, the distribution sums to 1, and the response names the model and the request.

Do these examples go stale?

They live in the repository beside the code and are sent to the endpoint by the test suite on every run. If one stops being accepted, the test fails and the page is not published with it. The request bodies here cannot drift from the contract without breaking the build.

How many decisions does one of these cost?

One, however many questions it carries — up to 8 per request. The daily quota counts calls, not questions; model time is what the separate credit allowance measures, and it grows with the length of the state.

Need a higher quota?

Paid plans raise the daily limit and issue an API key. See the pricing page, or write to us for volume.