Documentation

Documentation

Classify

POST /v1/classify — a label and calibrated probabilities per input from an open NLI model, no generated text. Rerank, grade, guard and route at a few milliseconds per item, billed per input token.

POST https://paraloncloud.com/v1/classify answers a closed question about each input with a label and calibrated probabilities, in one forward pass. Nothing is generated, so a decision costs a few milliseconds instead of a paragraph of reasoning, and there is no free-form text to parse.

The model behind it is an NLI cross-encoder (natural language inference): given a premise and a hypothesis, it says whether the hypothesis is entailed by the premise, contradicted by it, or neutral. That one primitive covers reranking, grading, guardrails, routing and fact-checking, with the question written as a sentence rather than trained in.

Request

curl https://paraloncloud.com/v1/classify \
  -H "Authorization: Bearer $PARALON_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openjev-4b",
    "pairs": [
      {"premise": "The invoice was paid on March 3rd by bank transfer.",
       "hypothesis": "The invoice has been settled."},
      {"premise": "The invoice was paid on March 3rd by bank transfer.",
       "hypothesis": "The invoice is still open."}
    ]
  }'
fieldtypenotes
modelstringa model listed by GET /v1/models with "type": "classification"
pairsarray of {premise, hypothesis}rendered for the model as Premise: …\nHypothesis: …
inputstring or array of stringsthe raw text the model classifies, if you prefer to format it yourself; use one of pairs or input, not both

Up to 256 items per request, 4,096 tokens per item.

Response

{
  "object": "list",
  "model": "openjev-4b",
  "data": [
    {"index": 0, "label": "entailment",    "probs": [0.0004, 0.9871, 0.0125], "num_classes": 3},
    {"index": 1, "label": "contradiction", "probs": [0.9612, 0.0031, 0.0357], "num_classes": 3}
  ],
  "usage": {"prompt_tokens": 58, "total_tokens": 58, "completion_tokens": 0}
}

label is the most probable class. probs are in the order [contradiction, entailment, neutral] for openjev-4b, and sum to 1. Results keep the order of the request.

What to build with it

The trick is to phrase the question as a hypothesis.

Rerank search results. Premise: the query. Hypothesis: The correct answer is: {passage}. Sort your top-50 from embeddings by the entailment probability; 64 passages take under 200 ms on one GPU.

Grade answers against a reference. Premise: {question}\nReference answer: {reference}. Hypothesis: Answer: {candidate}. Entailment means the candidate agrees with the reference; contradiction means it does not.

Guardrails. Premise: the model's reply. Hypothesis: This text reveals a customer's personal data, or whatever you must not ship. Run it on every reply before it reaches the user.

Check a RAG answer against its sources. Premise: the retrieved document. Hypothesis: each sentence of the generated answer. A sentence that is contradicted or neutral is not supported by the source.

Route. Premise: the user's message. Hypotheses: The user wants a refund, The user reports a bug, The user asks about pricing. Take the highest entailment.

Classify documents without training. Write each label as a sentence and let entailment pick. The document classification guide does this with a chat model; the same pipeline on /v1/classify skips the generated text and its parsing.

What it is not for: anything that needs generated text, multi-step reasoning, or a "why". It decides; it does not explain.

Models

curl https://paraloncloud.com/v1/models -H "Authorization: Bearer $PARALON_API_KEY"

Classification models carry "type": "classification". Today that is openjev-4b: OpenJev, Qwen3.5 4B turned into a three-way NLI cross-encoder, MIT licensed, 4,096-token input, English-first with the multilingual base of Qwen3.5.

Billing and limits

Billed per input token at the model's input price on premium keys; a free key draws on its trial. There are no output tokens. The key's requests-per-minute and in-flight limits are the same as for chat completions. Not available through the Batch API.

Errors

statuswhen
400 invalid_request_errorthe model is not a classification model, input and pairs both sent, an empty input, more than 256 items, or an item over 4,096 tokens
429 rate_limit_errorkey rate limit, in-flight limit, or every worker busy (workers_busy, retry after the Retry-After seconds)
503 / 502no worker for the model, or every attempt failed; retry