Zero-shot text classification into your labels (intent, sentiment, topic, routing)
ai_classifyZero-shot classification task: send text (max 8,000 chars) and 2-50 labels; get one label (or every applicable label with multi_label=true) guaranteed to be from your list, plus a one-sentence reason. Invalid output → 422, not charged. Runs on our Cloudflare Worker using Workers AI (IBM Granite 4.0 micro, Apache-2.0). No calibrated probabilities. Limited daily capacity: 503 (not charged) when used up. Price: $0.002 USDC on Base per call, paid with x402 (MCP transport: an unpaid call returns the x402 PaymentRequired object; retry with params._meta["x402/payment"]). Same tool over HTTP: POST /api/ai/classify.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | text to label, max 8,000 characters | |
| labels | Yes | 2-50 labels (JSON array or comma-separated string) | |
| multi_label | No | ||
| instructions | No | optional labelling guidance |