# x402 Data API — Text-to-JSON Extraction (Llama 3.2 3B)

> x402 Data API — Text-to-JSON Extraction (Llama 3.2 3B) is a paid API for AI agents from x402-data-api.sigrunner.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-20).

Extracts specified fields from free-form text and returns a strict JSON object with exactly those keys (null when absent), powered by Llama 3.2 3B on Cloudflare Workers AI.

## Facts

- Endpoint: GET https://x402-data-api.sigrunner.workers.dev/ai/extract?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-data-api-text-to-json-extraction-llama-3-2-3b-a26530ce
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BELWrZdUWSurKfjWHul5y

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 x402-data-api-text-to-json-extraction-llama-3-2-3b-a26530ce
```

Example prompt: Extract the invoice_number, vendor, due_date, and total from this text: 'Please remit payment of $1,250.00 to Acme Corp by November 2nd, 2026. Invoice ref: 4417.'

## When to prefer this

Choose this endpoint when you need to turn a short, messy, unstructured block of text (invoices, emails, bios, OCR output) into a typed JSON object with specific named fields, and you want to pay per call with no API key setup. Prefer this over larger LLM calls when the text is under 1500 chars and the task is field extraction rather than generation or reasoning. The strict null-for-absent behavior makes it reliable for downstream data pipelines.

## Known failure modes

- Text exceeds 1500 character limit — truncation or rejection
- Fields parameter missing or empty — API may return an error or empty object
- Ambiguous text causes LLM to hallucinate values rather than return null
- Non-English text may produce unreliable extractions given the small 3B model
- Network or Cloudflare Workers outage returns 5xx
- x402 payment failure or insufficient USDC balance blocks the request
- Model misidentifies which text span corresponds to a requested field name

## How this service works

Text-to-JSON extraction (Llama 3.2 3B): ?text=<up to 1500 chars>&fields=<comma-separated field names> returns a strict JSON object with exactly those keys (null when absent). Use when an agent needs messy text turned into typed structured data.

## Output

A JSON object with exactly the requested field names as keys; each key maps to the extracted string value from the text, or null if the field was not found. The response wraps this in a 'data' envelope, e.g. {"data":{"vendor":"Acme Corp","total":"1250.00","due_date":"2026-11-02","invoice_number":"4417"}}.

## 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",
      "fields"
     ],
     "properties": {
      "text": {
       "type": "string"
      },
      "fields": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "data"
     ],
     "properties": {
      "data": {
       "type": "object",
       "required": [
        "invoice_number",
        "vendor",
        "due_date",
        "total"
       ],
       "properties": {
        "total": {
         "type": "string"
        },
        "vendor": {
         "type": "string"
        },
        "due_date": {
         "type": "string"
        },
        "invoice_number": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "total": "1250.00",
   "vendor": "Acme Corp",
   "due_date": "2026-11-02",
   "invoice_number": "4417"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-data-api-text-to-json-extraction-llama-3-2-3b-a26530ce/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-data-api.sigrunner.workers.dev](https://www.zero.xyz/host/x402-data-api.sigrunner.workers.dev/llms.txt)
