# PennyRail Text Normalize Whitespace / Collapse Whitespace

> PennyRail Text Normalize Whitespace / Collapse Whitespace is a paid API for AI agents from pennyrail.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Normalizes and collapses whitespace in a given text string, replacing multiple consecutive whitespace characters with a single space and trimming leading/trailing whitespace.

## Facts

- Endpoint: POST https://pennyrail.vercel.app/api/p/nano/text.normalize-whitespace--collapse-whitespace
- 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/pennyrail-text-normalize-whitespace-collapse-whitespace-1df3288f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LX6gMFLrhhsOdn4yCUnFH

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 pennyrail-text-normalize-whitespace-collapse-whitespace-1df3288f -d '<json body>'
```

Example prompt: Can you clean up the whitespace in this text for me — collapse all the multiple spaces and tabs into single spaces and trim any leading or trailing spaces: 'Hello,   world!  This   is   a   test.  '?

## When to prefer this

Use this endpoint when you need a simple, reliable, pay-per-call text whitespace normalization operation without setting up your own string processing logic. It is ideal for preprocessing pipelines, sanitizing user input before storage or search, or cleaning text scraped from documents and web pages where irregular spacing is common.

## Known failure modes

- Missing 'input' field returns a validation error
- Non-string input type may cause a processing error
- Very large strings may time out or be rejected
- Payment failure (402) if USDC balance is insufficient or x402 header is missing

## How this service works

Machine-readable settlement service

## Output

Returns a JSON object containing the whitespace-normalized version of the input string, with all consecutive whitespace characters (spaces, tabs, newlines) collapsed to a single space and leading/trailing whitespace removed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pennyrail-text-normalize-whitespace-collapse-whitespace-1df3288f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pennyrail.vercel.app](https://www.zero.xyz/host/pennyrail.vercel.app/llms.txt)
