# Delx Trim Collapse

> Delx Trim Collapse is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Trims leading/trailing whitespace and collapses internal whitespace runs to single spaces in a given text string

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/trim-collapse
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-trim-collapse-d011eedc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_e6BddBneABuFCCttIOBoc

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 delx-trim-collapse-d011eedc -d '<json body>'
```

Example prompt: Can you trim and collapse all the whitespace in this string for me: '  hello   world   this  is   a   test  '?

## When to prefer this

Choose this endpoint when you need a deterministic, stateless, zero-retention utility to normalize whitespace in strings — especially as a preflight step before hashing, comparison, storage, or display. Prefer it over regex-based client-side approaches when you need a reliable, machine-readable JSON result in an agentic pipeline without implementing the logic yourself.

## Known failure modes

- Missing or empty 'text' field returns an error response
- Non-string input type may cause a validation error
- Payment failure via x402 results in a 402 response before processing
- Extremely long strings may hit request size limits

## How this service works

Trim ends and collapse internal whitespace runs to single spaces — first-party local utility for agent preflight and proven micro-utils expansion. Returns deterministic machine-readable JSON for $0.001 USDC via x402 on Base. Execution is first-party, local-only, stateless, and memory-only with no paid upstream, no input retention, no web search, no live RPC, and no mediagen. Results are advisory; the caller owns authorization, budgets, and production controls. Sibling of Delx routes that alread…

## Output

A deterministic JSON object containing the whitespace-normalized version of the input text, with leading/trailing whitespace removed and all internal whitespace runs collapsed to single spaces.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Input field: text."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "chars": 16,
  "result": "hello delx world",
  "schema": "delx/util-trim-collapse/v1",
  "changed": true,
  "original_chars": 22
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-trim-collapse-d011eedc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
