{"uid":"cap_LX6gMFLrhhsOdn4yCUnFH","slug":"pennyrail-text-normalize-whitespace-collapse-whitespace-1df3288f","name":"PennyRail Text Normalize Whitespace / Collapse Whitespace","description":"Machine-readable settlement service","url":"https://pennyrail.vercel.app/api/p/nano/text.normalize-whitespace--collapse-whitespace","method":"POST","headers":{},"bodySchema":{"type":"object","required":["input"],"properties":{"input":{"type":"string"}}},"responseSchema":{"type":"object","additionalProperties":true},"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_zpRUDy8pOc5Ix_iK24XCz","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":"Normalizes and collapses whitespace in a given text string, replacing multiple consecutive whitespace characters with a single space and trimming leading/trailing whitespace.","exampleAgentPrompt":"Can you clean up the whitespace in this text for me — collapse all the multiple spaces and tabs into single spaces and trim any leading or trailing spaces: 'Hello,   world!  This   is   a   test.  '?","exampleUseCases":[{"title":"Clean copy-pasted article text","prompt":"I just pasted some text from a PDF and it has tons of extra spaces and line breaks everywhere — can you normalize all the whitespace so it reads cleanly as a single properly-spaced string? Here's the text: 'The  quick   brown\t\tfox   jumped   over the   lazy   dog.'"},{"title":"Sanitize user form input before storage","prompt":"A user submitted a bio field in our app with a bunch of extra spaces and tabs in it — can you collapse all that whitespace down to single spaces and trim the ends before we save it? The text is: '  Software   engineer  based in   New York.  Loves   coffee. '"},{"title":"Normalize text before keyword matching","prompt":"Before I run keyword detection on this snippet, can you normalize all the whitespace — collapse consecutive spaces and tabs into one space and remove any leading or trailing whitespace? The snippet is: '\t\tMachine  learning   and   AI   are   transforming  industries.\t'"}],"resultDescription":"Returns a JSON object containing the whitespace-normalized version of the input string, with all consecutive whitespace characters (spaces, tabs, newlines) collapsed to a single space and leading/trailing whitespace removed.","failureModes":["Missing 'input' field returns a validation error","Non-string input type may cause a processing error","Very large strings may time out or be rejected","Payment failure (402) if USDC balance is insufficient or x402 header is missing"],"whenToPreferThis":"Use this endpoint when you need a simple, reliable, pay-per-call text whitespace normalization operation without setting up your own string processing logic. It is ideal for preprocessing pipelines, sanitizing user input before storage or search, or cleaning text scraped from documents and web pages where irregular spacing is common.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T07:21:55.133Z","isFirstParty":false}