# X Pay Word Count API

> X Pay Word Count API is a paid API for AI agents from www.api-xpay.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-02).

Counts words, lines, and characters in submitted text, billed per-request via USDC on Base using x402.

## Facts

- Endpoint: POST https://www.api-xpay.com/x402/wordcount?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x-pay-word-count-api-7cd7bf17
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2DisVQCu0BV0M1q3uwTys

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 x-pay-word-count-api-7cd7bf17 -d '<json body>'
```

Example prompt: Count the words, lines, and characters in this text for me: 'The quick brown fox jumps over the lazy dog. It was a bright cold day.'

## When to prefer this

Choose this endpoint when you need a quick, pay-per-use word/character/line count without managing any API keys or subscriptions — ideal for agents that only occasionally need text statistics and want micropayment-based access via USDC on Base.

## Known failure modes

- Missing or malformed 'input' body returns a validation error
- Payment not provided or insufficient USDC balance results in a 402 Payment Required response
- Invalid bodyType enum value causes request rejection
- Empty body may return zero counts or an error depending on server handling
- Network issues with Base blockchain may delay payment confirmation

## How this service works

Pay-per-request utility APIs powered by x402 using USDC on Base.

## Output

Returns a JSON object with word count, line count, total character count, character count excluding spaces, the payment asset (USDC), the network (Base), and a success boolean.

## 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": {
     "type": "object"
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "asset": "USDC",
  "lines": 1,
  "words": 2,
  "network": "base",
  "success": true,
  "characters": 11,
  "charactersNoSpaces": 10
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x-pay-word-count-api-7cd7bf17/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.api-xpay.com](https://www.zero.xyz/host/www.api-xpay.com/llms.txt)
