# agent402.tools Text Counter

> agent402.tools Text Counter is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Counts characters, words, lines, and optionally occurrences of a specified substring in a given text.

## Facts

- Endpoint: POST https://agent402.tools/api/count
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-text-counter-1d68afda
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GQ2HwV90OnjI78luPO0y-

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 agent402-tools-text-counter-1d68afda -d '<json body>'
```

Example prompt: Can you count the characters, words, and lines in this text, and also tell me how many times the word 'cloud' appears: 'The cloud is a powerful tool. Many companies rely on the cloud for storage. The cloud continues to grow.'

## When to prefer this

Use this endpoint when you need a quick, reliable computation of basic text statistics — character count, word count, line count — and optionally a substring frequency count, without needing NLP, sentiment, or semantic analysis. Ideal for content editors, writing assistants, or any agent verifying text length or keyword density.

## Known failure modes

- Missing 'text' field in request body returns a validation error
- Empty string input may return zero counts for all metrics
- Very large text inputs may time out or exceed payload limits
- Malformed JSON body returns a 400 error

## How this service works

Count characters, words, lines, and (optionally) occurrences of a substring in text.

## Output

Returns a breakdown of the text including total character count, word count, line count, and if a 'find' substring was provided, the number of times that substring appears in the text.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "find": {
   "type": "string",
   "description": "Optional substring to count"
  },
  "text": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lines": 1,
  "words": 6,
  "characters": 22,
  "occurrences": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-text-counter-1d68afda/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
