{"uid":"cap_5XsJTMrNmpgJoM0a3jJAC","slug":"textkit-byte-encoding-detector-ca9cbb86","name":"TextKit Byte Encoding Detector","description":"General-purpose text, Unicode and date utilities for AI agents: homoglyph folding and spoofed-domain detection, Unicode script detection, NFC/NFD normalization, grapheme counting, date description (weekday, ISO week, quarter, leap year), business-day counting, slugify, FNV-1a hashing, Shannon entropy, string format detection (uuid, email, url, ipv4, jwt, iban), byte-encoding detection and human-readable byte sizes. Pay per request in USDC on Base via x402 - no signup, no API key, no KYC.","url":"https://textkit.johnaio281.workers.dev/api/tk/detect-encoding?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"],"type":"string"},"queryParams":{"type":"object","required":["bytes"],"properties":{"bytes":{"type":"array","items":{"type":"integer","maximum":255,"minimum":0},"description":"byte array"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"encoding":"ascii","confidence":1}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_aPLdRttJh0nKHgDYV6ylk","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Detects the character encoding of a byte array (e.g. ASCII, UTF-8, UTF-16) with a confidence score","exampleAgentPrompt":"I have a byte array [72,101,108,108,111,32,87,111,114,108,100] — can you detect what character encoding it is using TextKit?","exampleUseCases":[{"title":"Validate file encoding before parsing","prompt":"Before I parse this file, I need to know what encoding it's in. Here are the first bytes: [239,187,191,72,101,108,108,111] — can you detect the encoding so I know whether to treat it as UTF-8 with BOM or something else?"},{"title":"Debug garbled text from API response","prompt":"I'm getting garbled text back from a third-party API. The raw bytes are [195,169,116,195,169] — can you identify what encoding this is so I can decode it correctly?"},{"title":"Classify unknown binary data encoding","prompt":"I've got some unknown binary data with bytes [255,254,72,0,101,0,108,0,108,0,111,0] and I'm not sure if it's UTF-16 or something else — can you run encoding detection on it?"}],"resultDescription":"A JSON object with an 'encoding' field (string, e.g. 'ascii', 'utf-8', 'utf-16') and a 'confidence' field (number between 0 and 1) indicating how certain the detection is.","failureModes":["Missing 'bytes' query parameter returns an error","Bytes outside the 0-255 range are rejected by schema validation","Empty byte array may return low-confidence or ambiguous result","Ambiguous byte sequences may yield low confidence scores","Payment failure via x402 if insufficient USDC balance on Base"],"whenToPreferThis":"Use this endpoint when you have raw bytes (not a string) and need to programmatically detect the character encoding before decoding or processing text. Ideal for agents handling file uploads, API responses, or binary streams where encoding is unknown. Prefer this over manual heuristics when you need a confidence score alongside the encoding name.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:39:46.816Z","isFirstParty":false,"canonicalSlug":"textkit-byte-encoding-detector-ca9cbb86"}