Developers / JevModel

How to classify text with the JevModel API

Classify text into your own labels with a Choice request. See the input, illustrative response, error handling and human-review path.

Last updated:

1. Define the labels and the review path

A text classification API assigns an input to a defined category. JevModel uses a Choice question whose criteria describe your labels; you do not train a model here. For support routing, distinguish billing, technical and review instead of forcing every message into a specialist queue. A selected label is a model judgment, not permission to issue a refund. Start with anonymized examples from your own workflow.

Route customer support with JevChoice, Score, and Noul

2. Send a server-side Choice request

Sign in, verify your email and create a key in Console → API keys. Store it in JEVMODEL_API_KEY on your server. This Bash example sends one live request and may consume allowance or tokens. The serialized validated request, including label descriptions, must fit within 8,000 characters. The endpoint accepts two to twelve Choice labels and one to eight questions; the example uses one question.

JevModel API: request and responseJevModel pricing and free Jev runs
curl --fail-with-body https://jevmodel.app/api/v1/systemone \
  -H "Authorization: Bearer $JEVMODEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"state":"I was charged twice. Please correct my invoice.","questions":{"queue":{"type":"choice","instructions":"Choose the support queue that should review this message.","criteria":{"billing":"Charges, refunds and invoice corrections.","technical":"Application errors and service outages.","review":"Mixed, unclear or unsupported requests."}}}}'

3. Read the answer without confusing probability and confidence

The answer below is illustrative, not a recorded API run. In a successful response, inspect data.answers.queue.choice and its probabilities. Confidence is a separate summary of the distribution: for the three options shown, the upstream Choice formula gives 0.85 from a top probability of 0.90. Neither number establishes correctness on future tickets. Usage, quota and request_id are omitted from this answer excerpt; see the full envelope in the API guide.

Jev probability, confidence and human-review thresholdsEvaluate a Jev workflow
{
  "code": 0,
  "message": "ok",
  "data": {
    "answers": {
      "queue": {
        "type": "choice",
        "choice": "billing",
        "probabilities": {
          "billing": 0.9,
          "technical": 0.06,
          "review": 0.04
        },
        "confidence": 0.85
      }
    }
  }
}

4. Check errors before taking action

Check HTTP status, then code === 0, then validate the answer type, chosen label and numeric fields. Missing fields, close probabilities, unknown labels or service failures should lead to review. HTTP 429 indicates an allowance or balance limit; 502 and 503 indicate model or connection failure. Do not treat a failure as a safe classification. There is no idempotency-key support: a lost response may follow a successful billed call, so inspect history before retrying.

JevModel API: request and responseAdd a decision gate before tool use

How do you test a backlog?

Run the existing support-classification example offline to check your client setup. Use --live only when ready for a real request. For many inputs, Console → Batch offers browser processing and CSV export; it is not an asynchronous server job. Join the exported answers to reviewer labels outside the site, measure per-class mistakes and review coverage, and compare rules or embeddings on the same held-out set.

Batch text classification with the JevModel APIJev vs embeddings and zero-shot classifiersJev or rules?
node quickstart/node.mjs support-classification
# Run from the cloned jevmodel-examples repository. Offline by default.

JevModel is independent and not affiliated with TypeSafe AI.