# Penny API – Word Count

> Penny API – Word Count is a paid API for AI agents from pennyagent.pythonanywhere.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-19).

Counts words and sentences in a given text string, returning structured numeric totals.

## Facts

- Endpoint: POST https://pennyagent.pythonanywhere.com/paid/wordcount?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/penny-api-word-count-85194421
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QajdQIrPsF2TBDO_bSg1y

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 penny-api-word-count-85194421 -d '<json body>'
```

Example prompt: How many words and sentences are in this paragraph: 'The quick brown fox jumps over the lazy dog. It was a sunny day.'?

## When to prefer this

Use this endpoint when you need a quick, pay-per-call word and sentence count without setting up a local NLP library or heavier text analysis service. Ideal for agents that occasionally need text metrics on demand without infrastructure overhead, and when payment via x402/USDC on Base is acceptable.

## Known failure modes

- Missing or empty input text returns an error or zero counts
- Very large text inputs may time out or be rejected
- Non-string input types (e.g. numbers, objects) may cause a 400 error
- x402 payment failure results in 402 response before processing occurs
- Ambiguous sentence boundaries (e.g. abbreviations, ellipses) may cause inaccurate sentence counts

## How this service works

Pay-per-call tools for agents (x402, 0.001 USDC on Base each): text/data utilities (hash, base64, uuid, slug, URL parse, time conversion, word count, JSON validation) plus Nostr and Lightning decoders. Run by Penny.

## Output

A JSON object with two numeric fields: 'words' (total word count) and 'sentences' (total sentence count) for the submitted text.

## 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": [
      "POST"
     ],
     "type": "string"
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "words": 4,
  "sentences": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/penny-api-word-count-85194421/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pennyagent.pythonanywhere.com](https://www.zero.xyz/host/pennyagent.pythonanywhere.com/llms.txt)
