{"uid":"cap_e6BddBneABuFCCttIOBoc","slug":"delx-trim-collapse-d011eedc","name":"Delx Trim Collapse","description":"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…","url":"https://api.delx.ai/api/v1/x402/trim-collapse","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_dd7sxe6CCtZTyAKnUw3tU","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 to single spaces in a given text string","exampleAgentPrompt":"Can you trim and collapse all the whitespace in this string for me: '  hello   world   this  is   a   test  '?","exampleUseCases":[{"title":"Normalize agent-generated output before hashing","prompt":"Before I fingerprint this agent response, can you trim and collapse all the whitespace in it so the hash is consistent: '  agent output   with  irregular   spacing  '?"},{"title":"Clean user input before database storage","prompt":"This form input came in with messy spacing — can you trim the ends and collapse the internal spaces into single spaces? The text is: '   John   Doe   from   New   York  '."},{"title":"Sanitize LLM output for display","prompt":"The LLM returned a string with a bunch of extra spaces — can you normalize it by trimming and collapsing the whitespace so it looks clean? Here it is: '  Welcome   to   the   platform !  '."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:02:16.546Z","isFirstParty":false}