# Agent Extraction API — Text Classification

> Agent Extraction API — Text Classification is a paid API for AI agents from freetier-agent-api.pages.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-02).

Classifies input text into user-defined labels (2–20) with confidence scores and short reasoning, using a small Llama 3.1 8B model

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/classify?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-extraction-api-text-classification-c9aec744
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2Ip7WjfK98t9Yt2GXShyz

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 agent-extraction-api-text-classification-c9aec744
```

Example prompt: Classify this customer message into one of these labels — billing, shipping, technical, or general — and tell me how confident you are: 'I was charged twice for my last order and need a refund as soon as possible.'

## When to prefer this

Choose this endpoint when you need fast, cheap, zero-setup text classification against your own custom label taxonomy without fine-tuning a model. It is ideal for support ticket routing, content moderation, feedback tagging, or any scenario where you define 2–20 labels at call time and want a confidence score plus a human-readable reason. Prefer it over heavyweight NLP APIs when latency and cost matter and labels change per request.

## Known failure modes

- Text exceeds 6,000 character limit — request rejected or truncated
- Fewer than 2 or more than 20 labels provided — invalid request
- Labels not comma-separated correctly — parsing error
- Payment not attached or insufficient — x402 payment required response
- Model hallucination: label returned that was not in the provided list (should not happen by design but possible with edge-case prompts)
- Network timeout if Cloudflare Workers AI is slow to respond

## How this service works

Invoice-to-JSON, on-chain tools (transaction explainer + payment check, wallet profile, contract ABI, ERC-20 token risk), company contacts and web-to-RAG for AI agents. Pay per call with x402 (USDC on Base). No signup, no API key.

## Output

A JSON object containing the winning label string, a labels array (single or multiple for multi-label mode), a confidence float (0–1), and a short plain-English reason string explaining the classification decision.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text",
      "labels"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "text to classify"
      },
      "multi": {
       "type": "string",
       "description": "true for multi-label"
      },
      "labels": {
       "type": "string",
       "description": "comma-separated labels (2-20)"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "label": "billing",
  "labels": [
   "billing"
  ],
  "reason": "Duplicate charge and refund request.",
  "confidence": 0.95
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-extraction-api-text-classification-c9aec744/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from freetier-agent-api.pages.dev](https://www.zero.xyz/host/freetier-agent-api.pages.dev/llms.txt)
