{"uid":"cap_tCKqS-b_vbR033w2AO6Kp","slug":"web2markdown-text-truncate-api-30f4cf0d","name":"Web2Markdown Text Truncate API","description":"Pay-per-call API for AI agents: turn any public web page or PDF into clean, LLM-ready Markdown. $0.002 per call in USDC on Base via x402. No API key, no signup.","url":"https://lin-desk-x402.lindesk.workers.dev/v1/texttools/truncate?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["input"],"properties":{"input":{"type":"string","description":"Input text; max 100 KiB"},"ellipsis":{"enum":["true","false"],"type":"string","description":"Default true"},"max_chars":{"type":"string","pattern":"^-?\\d+$"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"op":{"type":"string"},"meta":{"type":"object","properties":{"chars_in":{"type":"integer"},"chars_out":{"type":"integer"},"elapsed_ms":{"type":"integer"}}},"result":{}}}}}}},"responseSchema":{"type":"json","example":{"op":"truncate","meta":{"chars_in":43,"chars_out":20,"elapsed_ms":0},"result":"The quick brown fox…"}},"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_-JmWdcikaEO1Xp-torFBf","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":"Truncates a text string to a specified character limit, optionally appending an ellipsis, returning character counts and elapsed time.","exampleAgentPrompt":"Truncate this text to 500 characters and add an ellipsis at the end: 'Artificial intelligence is transforming industries worldwide, from healthcare to finance, enabling automation of complex tasks that previously required human expertise...'","exampleUseCases":[{"title":"Clip article excerpt for preview card","prompt":"Shorten this article intro to 200 characters with an ellipsis so I can show it as a preview snippet: 'The global economy is undergoing a profound transformation driven by technological innovation, shifting demographics, and evolving geopolitical dynamics that...'"},{"title":"Trim LLM context to token budget","prompt":"I need to cut this text down to 1000 characters before sending it to the language model — please truncate it and add an ellipsis: 'In the study of cognitive science, researchers have long debated the extent to which human memory functions as a reconstructive rather than reproductive process...'"},{"title":"Enforce display length for UI component","prompt":"Truncate this product description to exactly 150 characters with an ellipsis for the mobile card view: 'Our flagship ergonomic office chair features lumbar support, breathable mesh back, adjustable armrests, seat height, and tilt tension for all-day comfort.'"}],"resultDescription":"A JSON object with the operation name ('truncate'), a meta object containing chars_in (original character count), chars_out (truncated character count), and elapsed_ms (processing time in milliseconds), plus a result field with the truncated string (with optional ellipsis appended).","failureModes":["Missing required 'input' query parameter returns an error","Input text exceeding 100 KiB limit may be rejected","Invalid max_chars value (non-integer string) may cause a validation error","Payment failure via x402 protocol results in 402 response before processing","Network timeout on the Cloudflare Worker edge"],"whenToPreferThis":"Choose this endpoint when you need a fast, stateless, pay-per-call text truncation with precise character counting and optional ellipsis — especially when integrating into AI agent pipelines that need to stay within character budgets without standing up your own string-processing logic or managing API keys.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T00:32:22.006Z","isFirstParty":false,"canonicalSlug":"web2markdown-text-truncate-api-30f4cf0d"}