# Text Classifier API

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

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

## Facts

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

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-abe80b67 -d '<json body>'
```

Example prompt: Classify this sentence into one of my labels — 'bullish', 'bearish', or 'neutral' — and give me a one-line reason: 'The Fed signaled three rate cuts ahead, sending equities soaring.'

## When to prefer this

Choose this endpoint when you need lightweight, fast LLM-powered text classification with fully custom labels and a human-readable reason — ideal for routing, tagging, or intent detection pipelines where you define the taxonomy. It is simpler and cheaper than running a full chat completion when all you need is a single label + justification. Prefer this over generic LLM APIs when you want a structured JSON response with a guaranteed label field rather than freeform text.

## Known failure modes

- Missing required 'input' field returns a validation error
- Invalid bodyType enum value causes request rejection
- Overly vague or contradictory labels may result in low-confidence or unexpected label selection
- Very long input text may be truncated or cause latency spikes
- Network timeout on the Cloudflare worker if inference is slow
- Payment failure or insufficient USDC balance blocks the request via x402 protocol

## How this service works

Exact EVM address, calldata, Uniswap V2/V3 and impermanent-loss math. Pay per call in USDC on Base via x402.

## Output

A JSON object containing 'label' (the best matching label from those provided) and 'reason' (a one-sentence explanation for why that label was chosen), e.g. {"label":"trade","reason":"Describes a token swap."}

## 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"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "label": "trade",
  "reason": "Describes a token swap."
 }
}
```

## More

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