Skip to main content
POST https://api.pinference.ai/api/v1/classify runs Qwen3 Reranker 0.6B on prompts you format yourself. For each prompt it returns the model’s probability of answering “yes” over “no”, and the logit behind it. The Rerank API builds the same prompts from one query and a list of documents. Use classify to score pairs with different queries in one request, to write your own question, or to work with logits.

Prompt format

Qwen publishes this prompt for the model. {instruction}, {query} and {document} are your text:
The prompt ends with two newlines after </think>. The Rerank API uses exactly this template, with the default instruction below. This function builds the same string:
The API sends each prompt to the model unchanged and reads the model’s preference for “yes” over “no” at the prompt’s last token. It doesn’t check the format. A prompt that asks a yes-or-no question and ends with the exact assistant suffix, <|im_start|>assistant\n<think>\n\n</think>\n\n, gets a meaningful score. Before the suffix you can change the system message, the field labels and the instruction. A prompt without the suffix still returns a score, but that score has no defined meaning.

Classify prompts

Send one prompt as a string, or up to 1,000 as an array. This example uses format_pair from above:
The request returns:
With curl, the prompt is a JSON string with its newlines and quotes escaped:
To charge a team, add -H "X-Prime-Team-ID: your-team-id" to each request. See team billing.

Request body

The whole request body can be at most 16 MiB.

Response

Pick your own threshold for decisions. At a probability of 0.5 the model is undecided between “yes” and “no”. When two probabilities both round to 1.0, compare their logits to order them.

Usage and billing

Classification is billed on input tokens, usage.prompt_tokens, at $0.20 per million. There is no output charge.

Errors

Most errors return an error object with message, type and code, as the Chat Completions API does. A 401, a 404, or a 503 while authentication is unavailable returns a detail message instead.

vLLM compatibility

The request and response follow vLLM’s classification API, with logit added.