# ONE Engine Text Clean & Normalize Whitespace

> ONE Engine Text Clean & Normalize Whitespace is a paid API for AI agents from one-search.one-engine.workers.dev, paid per call via x402, $0.0011/call, status unknown (last checked 2026-10-02).

Cleans and normalizes whitespace in text strings using either compact or preserve-lines mode for downstream agent processing

## Facts

- Endpoint: POST https://one-search.one-engine.workers.dev/v1/text/clean?utm_source=zero.xyz
- Price: $0.0011/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/one-engine-text-clean-normalize-whitespace-9fb39d4e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WpS_BYIPKkyFZGwekjMoy

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 one-engine-text-clean-normalize-whitespace-9fb39d4e -d '<json body>'
```

Example prompt: Clean up this text for me — collapse all the extra spaces and tabs into single spaces using compact mode: 'Hello   world,   this   is   a   test   string   with   weird   spacing.'

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call utility to normalize whitespace in text before downstream processing — especially in agent pipelines where clean, consistent spacing matters for tokenization, storage, or display. Prefer over custom regex solutions when you want a hosted, reliable microservice. Use compact mode for dense single-block output (e.g. LLM prompts, search indexing) and preserve_lines when paragraph structure matters (e.g. article formatting, user content).

## Known failure modes

- Missing 'text' field returns a validation error
- Invalid 'mode' enum value returns a 400 bad request
- Empty text string may return an empty result or validation error
- Payment failure via x402 returns a 402 response requiring USDC on Base
- Extremely large text inputs may be rejected or time out

## How this service works

Clean and normalize whitespace in text for downstream agent processing

## Output

Returns the cleaned text string with whitespace normalized according to the specified mode: compact mode collapses all consecutive whitespace (spaces, tabs, newlines) into single spaces, while preserve_lines mode collapses inline whitespace but retains paragraph/line boundaries.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "enum": [
    "compact",
    "preserve_lines"
   ],
   "type": "string",
   "description": "compact collapses whitespace; preserve_lines keeps paragraph boundaries"
  },
  "text": {
   "type": "string",
   "description": "Text to clean"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/one-engine-text-clean-normalize-whitespace-9fb39d4e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from one-search.one-engine.workers.dev](https://www.zero.xyz/host/one-search.one-engine.workers.dev/llms.txt)
