{"uid":"cap_klXtwzSLh-wYJpFje380t","slug":"text-statistics-counter-bytes-characters-words-lines-bbeb3a3e","name":"Text Statistics Counter (Bytes, Characters, Words, Lines)","description":"Byte, character, word and line counts for a string — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/text-stats?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"text":{"type":"string","maxLength":49152}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"text-stats","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.001,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"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_yFvkdMFEiVAC8Bx79iyzD","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":"Counts bytes, characters, words, and lines in a given string and returns all four metrics in a single response.","exampleAgentPrompt":"Can you count the bytes, characters, words, and lines in this text for me: 'The quick brown fox jumps over the lazy dog. It was a bright cold day in April.'","exampleUseCases":[{"title":"Validate content within character limits","prompt":"I need to check how many characters and bytes are in this bio before I submit it: 'Experienced software engineer with 10 years building distributed systems at scale, passionate about open source and developer tooling.'"},{"title":"Word count check for writing submission","prompt":"Can you tell me exactly how many words are in this paragraph I wrote? 'Artificial intelligence is reshaping the way we interact with technology. From natural language processing to computer vision, the applications are vast and growing every day.'"},{"title":"Measure multiline log snippet metrics","prompt":"How many lines, words, and bytes are in this log excerpt? 'ERROR: Connection timeout\nWARN: Retrying...\nINFO: Connection established\nDEBUG: Payload received'"}],"resultDescription":"Returns a JSON object with ok:true, type:'text-stats', and the four computed metrics (byte count, character count, word count, line count) for the submitted string, along with a payment receipt containing the transaction hash, amount in USD, and a receipt ID.","failureModes":["Text exceeds 49,152 character limit — request rejected","Empty or missing text field — may return zero counts or validation error","Non-UTF-8 byte sequences may cause unexpected byte vs character count discrepancies","Payment failure on the x402 micropayment layer — call not processed","Network timeout on the UnyKorn operator node"],"whenToPreferThis":"Use this endpoint when you need a fast, deterministic, multi-dimensional text measurement (bytes, characters, words, and lines simultaneously) without running local string processing. Ideal for agents that need to validate content against size constraints, prepare text for downstream APIs with strict limits, or audit document metrics in a single call. Prefer this over client-side counting when consistency across encodings matters or when the agent environment lacks reliable string utilities.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:14.198Z","isFirstParty":false,"canonicalSlug":"text-statistics-counter-bytes-characters-words-lines-bbeb3a3e"}