# Text Classifier API

> Text Classifier API is a paid API for AI agents from dominion-data.x402-evm-math.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-29).

Classifies arbitrary text into user-defined labels using an LLM, returning the best matching label and a one-line explanation.

## Facts

- Endpoint: POST https://dominion-data.x402-evm-math.workers.dev/ai/classify?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/text-classifier-api-ee67b3c2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3kOIk1Sep-9paH6GhvXnI

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 text-classifier-api-ee67b3c2 -d '<json body>'
```

Example prompt: Classify this customer message into one of these labels — 'billing', 'technical support', 'feature request', or 'general inquiry' — and give me a one-line reason for the choice: 'My invoice shows the wrong amount and I need it corrected before end of month.'

## When to prefer this

Choose this endpoint when you need lightweight, pay-per-call text classification against custom user-defined labels without standing up your own LLM pipeline. It is ideal for dynamic labeling tasks where categories change per request, and when you want a human-readable reason alongside the label. Prefer it over general-purpose LLM APIs when cost predictability ($0.005/call) and a single structured classification output are priorities.

## Known failure modes

- Empty or missing text input returns a validation error
- No labels provided results in an error or undefined output
- Ambiguous text with no clearly matching label may return a low-confidence or unexpected label
- Payment failure via x402 protocol blocks the request
- Rate limiting or worker timeout for very long input texts

## How this service works

Text classification API: classify text into your own labels with an LLM, returns the best label and a one-line reason.

## Output

Returns the single best-matching label from the user-provided list and a concise one-line explanation of why that label was chosen, powered by an LLM classification step.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/text-classifier-api-ee67b3c2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from dominion-data.x402-evm-math.workers.dev](https://www.zero.xyz/host/dominion-data.x402-evm-math.workers.dev/llms.txt)
