{"uid":"cap_4R70waOJF0ICFyCv8u6rH","slug":"delx-commerce-trim-collapse-whitespace-2ee05572","name":"Delx Commerce — Trim & Collapse Whitespace","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/trim-collapse?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Input field: text."}}},"responseSchema":{"type":"json","example":{"ok":true,"chars":16,"result":"hello delx world","schema":"delx/util-trim-collapse/v1","changed":true,"original_chars":22}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_k6khOi44bTMby1ZmCVWz4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Trims leading/trailing whitespace and collapses internal whitespace runs in a text string, returning the cleaned result.","exampleAgentPrompt":"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  '","exampleUseCases":[{"title":"Normalize user-submitted form input","prompt":"Before I save this user's bio to the database, clean it up — trim the edges and collapse any double or triple spaces into single ones: '  John   Smith   loves   coding  '"},{"title":"Clean scraped web content","prompt":"This text I scraped has a ton of extra whitespace all over it. Can you trim it and collapse the internal spacing so it reads cleanly? Here's the string: '  Breaking   News :   Markets   up   today  '"},{"title":"Preprocess text for token efficiency","prompt":"I need to strip unnecessary whitespace from this string before I send it to the language model — trim the ends and squash any runs of spaces down to one: '   the   quick  brown   fox  '"}],"resultDescription":"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).","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:53:49.522Z","isFirstParty":false,"canonicalSlug":"delx-commerce-trim-collapse-whitespace-2ee05572"}