# fastapi.online Zero-Shot Text Classifier

> fastapi.online Zero-Shot Text Classifier is a paid API for AI agents from api.fastapi.online, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Classifies a piece of text into one of several user-defined labels without any prior training, using a self-hosted zero-shot classification model.

## Facts

- Endpoint: POST https://api.fastapi.online/zero-shot-classify
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fastapi-online-zero-shot-text-classifier-5bf09665
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_g83v1Iry2DIO9uI-6iRb6

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability fastapi-online-zero-shot-text-classifier-5bf09665 -d '<json body>'
```

Example prompt: Can you classify the following customer review into one of these categories — 'shipping issue', 'product defect', 'billing problem', or 'general praise' — and tell me which fits best: 'My order arrived three weeks late and the packaging was completely crushed.'

## When to prefer this

Choose this endpoint when you need to categorize text into custom, domain-specific labels without having trained a classifier — especially useful for ad hoc routing, triage, or analysis tasks where labels vary per request. Prefer this over fine-tuned classifiers when flexibility matters more than peak accuracy, and over general LLM prompting when you want structured confidence scores across multiple candidate labels at low per-call cost ($0.001 USDC).

## Known failure modes

- Fewer than 2 labels provided — request rejected
- More than 20 labels provided — request rejected
- Text exceeds 8000 characters — request rejected
- Empty or missing text field — validation error
- Payment not included or insufficient — 402 Payment Required
- Model may assign low confidence to all labels if text is ambiguous or unrelated to all candidates

## How this service works

Chat, embeddings, OCR, speech-to-text, image editing, image understanding (captioning/Q&amp;A), text-to-speech, translation, writing tools, classification tools, developer tools, local utilities, format/checksum validators, encoding &amp; crypto utilities, date/time calculators, geo/coordinate math, math &amp; finance calculators, novelty tools, and business/social writing generators — 179 endpoints in all, across multiple specialized self-hosted models. Pay per call with crypto — no signup — or get an API key.

## Output

Returns a ranked list of the candidate labels with a confidence score for each, indicating how well each label matches the input text. The highest-scoring label represents the predicted class.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "maxLength": 8000,
   "minLength": 1
  },
  "labels": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "maxItems": 20,
   "minItems": 2
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fastapi-online-zero-shot-text-classifier-5bf09665/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.fastapi.online](https://www.zero.xyz/host/api.fastapi.online/llms.txt)
