ForHosting KIT · Text & AI

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.

● StablePer request + per item$0.003
Use it from WebAPIEmailApp soonTelegram soon

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.

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.

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.

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.

POSThttps://api.kit.forhosting.com/text/topic-classify

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.

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"]}'
{
  "items": [
    "valor-1",
    "valor-2"
  ]
}
{
  "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.

Per request$0.003
Per item$0.0135

Published price — no tokens, no invented credits. A failed task is never charged.

max_tokens20000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
422task_failedThe task failed after 3 retries. You are never charged for it.

Read the full KIT documentation →