Classification API
AI classification API: classify any text in one request
Short answer
An AI classification API takes a piece of text or JSON plus the labels you define and returns the best-matching label with a probability for each option. You don't train a model or parse chat output. You describe the categories in plain language, send the input, and act on the label and confidence in your code.
Most software is full of small classification problems: which team should handle this ticket, is this form submission spam, what kind of document was just uploaded, is this lead worth a call. For years the options were keyword rules (brittle) or training a custom model (slow and data-hungry). Large language models made it possible to classify from a description alone, but using a chat model as a classifier means writing prompts, requesting JSON, validating it and paying for generated text you throw away.
A classification API built on a decision model removes that overhead. You declare the options and receive a probability distribution over exactly those options, every time, in a fixed shape.
Get Early Access to ClassifierHub: 2× credits in your first paid month.
How it works
A request has three parts: the input (a string, an object or an array), instructions that say what to judge, and the options. Options can be a simple list of labels or a map from label to description. Descriptions matter: "billing: payments, invoices, refunds, charges" is far more reliable than "billing" alone, because it tells the model where the boundary between categories sits.
The response contains the winning label, a confidence value and the probability of every option. Because the output is constrained to your labels, there is no free text to parse and no risk of an invented category.
curl https://classifierhub.com/v1/classify \
-H "Authorization: Bearer $CLASSIFIERHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "I was charged twice for my subscription this month.",
"instructions": "Which team should handle this message?",
"options": {
"billing": "Payments, invoices, refunds, charges",
"technical": "Bugs, errors, outages",
"sales": "Buying, upgrading, pricing questions",
"other": "Anything else"
}
}'
# -> { "label": "billing", "confidence": 0.93,
# "probabilities": { "billing": 0.93, "technical": 0.03, "sales": 0.02, "other": 0.02 },
# "usage": { "credits": 1, "latency_ms": 420 } }The ClassifierHub API opens to Early Access members first.
Classification API vs. prompting an LLM
You can classify with any chat model by asking it to answer with a label. It works, but the costs add up at volume: output tokens, retries when the JSON is malformed, a validation layer, and latency measured in seconds for larger models. A chat model also returns a label without a meaningful probability, so you can't tell a confident answer from a guess.
A decision-model API answers in a single short call, charges for the input only (at the model level), and returns probabilities you can threshold. Keep generative models for the work that needs generation: writing replies, summarizing, extracting arbitrary fields.
Classification API vs. training your own model
A fine-tuned classifier can be excellent when you have thousands of labeled examples and categories that rarely change. Most teams have neither. With a description-based API you can ship on day one, change categories by editing text, and collect labeled data from production as you go. If you later outgrow it, that data is exactly what you need to train a dedicated model.
Designing good labels
Label design has a bigger effect on accuracy than anything else you control:
- Make options mutually exclusive, and describe the boundary between neighbors ("bug: something is broken" vs. "how_to: asks how to do something").
- Always include an "other" option so unclear inputs have somewhere to go.
- Keep one question per decision. Ask for urgency separately instead of creating "billing_urgent" and "billing_normal".
- Send only the fields the decision needs. A subject and the latest message usually beat an entire thread.
- Pick a confidence threshold from real examples and send anything below it to a person.
What you can classify
Anything you can describe: emails, support tickets, contact forms, reviews, chat messages, product listings, extracted document text, CRM records and AI agent actions. ClassifierHub ships ready-made templates for email triage, lead qualification, contact-form routing, support triage, document classification, spam detection and agent guardrails, and lets you define your own.
Frequently asked questions
Related guides
Last updated . ClassifierHub is an independent product built on top of the Jev decision model, accessed through OpenRouter. It is not affiliated with or endorsed by TypeSafe or OpenRouter.