Classify text
You define the categories that matter to your business, and this endpoint sorts every piece of text into the one — or several — that fits, at whatever volume you throw at it. No fixed taxonomy to work around, no retraining a model every time your category list changes.
Run it online
Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.
Why a fixed taxonomy usually isn't the answer
Off-the-shelf classifiers tend to assume a generic set of categories — news topics, industry verticals, that sort of thing — which rarely matches the exact labels a real business actually needs, like 'billing dispute' versus 'shipping delay' versus 'product defect'. text/topic-classify takes your category list as part of the request itself, so the output maps directly onto the buckets your team already works in, not the ones a generic model happened to be trained on.
The mechanics of a call
POST your text items to /text/topic-classify along with the categories you want considered, and you'll get a task_id back straight away while the job runs asynchronously. Once finished, results arrive by signed webhook or through a signed link valid for 24 hours, with each item tagged by the category or categories it matched, plus a confidence score you can use to decide what needs human review.
Where automated text classification came from
Sorting documents by subject predates computers entirely — library card catalogs and the Dewey Decimal System solved the same problem for physical books a century ago. What's changed is speed and granularity: instead of a librarian assigning one call number per book, a classifier can now assign categories to thousands of short texts per minute, and your categories don't have to fit a universal library scheme, they just have to fit your workflow.
Where this earns its place
Content teams sorting an incoming article backlog by section before publishing. Marketplaces auto-tagging product listings into the right catalog category at upload time. Legal and compliance teams pre-sorting document dumps by document type before a human review pass. Knowledge base teams routing incoming questions to the right help article category.
Fitting classification into automation
Because you control the category list per call, this endpoint adapts as your taxonomy evolves — a new product line or a new support category doesn't require retraining anything, just an updated list in your next request. Combined with the async delivery model, it drops into ingestion pipelines cleanly: classify on arrival, let the webhook write the category onto the record, and build downstream logic on top of labels that already match how your team thinks about the content.
What you can do with it
Editorial backlog sorting
Classify a backlog of thousands of drafted articles into your existing section taxonomy before an editor ever opens the queue.
Marketplace listing categorization
Auto-tag new product listings into your exact catalog structure at upload time instead of relying on sellers to pick the right category themselves.
Support content routing
Sort incoming help-desk questions into the specific knowledge base categories your documentation is organized around, cutting the time to the right answer.
Document intake sorting
Pre-classify a large batch of scanned or extracted documents by type — contract, invoice, correspondence — before a compliance team reviews them.
FAQ
How does the text classification API work?
You send your text items plus the list of categories you want it sorted into to POST /text/topic-classify, and get back each item's matching category or categories, delivered by webhook or a signed 24-hour link once the async job finishes.
Can I use my own custom categories instead of a fixed list?
Yes, that's the core design — you pass your own category list on each call, so classification always maps to the taxonomy your business actually uses.
Can a text be classified into more than one category?
Yes, results can include multiple matching categories with individual confidence scores when a piece of text genuinely spans more than one topic.
Is there a free tier?
There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.
What's the pricing?
$0.003 per request plus $0.0135 per item, so classifying 2,000 listings costs the base fee plus $26, billed only for items that complete.
How many categories can I define per request?
You can define the category set your workflow needs per call; keeping the list focused and mutually distinct generally produces cleaner, more confident results.
Can I classify large batches at once?
Yes, the endpoint is built for bulk, asynchronous processing so a batch of thousands of items runs without holding your application thread open.
What happens to submitted text afterward?
Text is deleted after the retention window and never used for training; failed items are retried automatically up to three times, and a task that never completes is never billed.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/text/topic-classify \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"items":["valor-1","valor-2"]}'const res = await fetch("https://api.kit.forhosting.com/text/topic-classify", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"items": [
"valor-1",
"valor-2"
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/text/topic-classify",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"items": [
"valor-1",
"valor-2"
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/text/topic-classify", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"items":["valor-1","valor-2"]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"items":["valor-1","valor-2"]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/text/topic-classify", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"items": [
"valor-1",
"valor-2"
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "text.topic_classify",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_tokens | 20000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
422 | task_failed | The task failed after 3 retries. You are never charged for it. |