# Delx Commerce — Trim & Collapse Whitespace

> Delx Commerce — Trim & Collapse Whitespace is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Trims leading/trailing whitespace and collapses internal whitespace runs in a text string, returning the cleaned result.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/trim-collapse?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-trim-collapse-whitespace-2ee05572
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4R70waOJF0ICFyCv8u6rH

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-commerce-trim-collapse-whitespace-2ee05572 -d '<json body>'
```

Example prompt: Clean up this text by trimming any leading or trailing spaces and collapsing all the extra spaces in the middle into single spaces: '  hello   delx   world  '

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call text normalization step without setting up any account or subscription — ideal for agents that occasionally need to clean whitespace from strings as part of a pipeline, especially when cost predictability and no-signup simplicity matter.

## Known failure modes

- Missing or empty text field — likely returns an error or unchanged result
- Non-string input type — may cause validation failure
- Payment failure via x402 — 402 response if USDC payment is not provided or insufficient

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object with the cleaned text string (result), character counts before (original_chars) and after (chars) cleaning, a boolean indicating whether any changes were made (changed), and a schema identifier (schema: delx/util-trim-collapse/v1).

## 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-commerce-trim-collapse-whitespace-2ee05572/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
