{"uid":"cap_hs-12FA917wZKrTUH5Lxc","slug":"hex-encoding-of-utf-8-text-b8273b55","name":"Hex Encoding of UTF-8 Text","description":"Hex encoding of UTF-8 text — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/encode-hex?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":"encode-hex","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_K27fiBRZk8KtiRsY8rj34","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":"Encodes a UTF-8 text string into its hexadecimal representation","exampleAgentPrompt":"Can you hex-encode the UTF-8 text 'Hello, World!' for me? I need the raw hexadecimal bytes representation of that string.","exampleUseCases":[{"title":"Encoding calldata for smart contract","prompt":"I need to hex-encode this Solidity function input string 'transfer(address,uint256)' so I can use it as raw calldata in my transaction."},{"title":"Debugging hex payloads in logs","prompt":"Can you convert this log message 'Payment confirmed for order #9921' into its UTF-8 hex encoding so I can compare it against the raw bytes I'm seeing in my contract event?"},{"title":"Preparing hex-encoded metadata","prompt":"Please hex-encode the text 'ipfs://QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco' so I can store it as bytes in my on-chain NFT metadata field."}],"resultDescription":"Returns a JSON object with ok=true, the type field 'encode-hex', the hex-encoded output of the input UTF-8 text, and a payment receipt containing a transaction hash, amount paid in USD, and a unique receipt ID.","failureModes":["Input text exceeds 49152 character limit — request rejected","Malformed JSON body or missing params.text field — validation error","Payment failure or insufficient USDC balance — 402 Payment Required","Network timeout or provider unavailability — 503 Service Unavailable"],"whenToPreferThis":"Use this endpoint when you need a reliable, pay-per-use hex encoding service accessible via HTTP without setting up local libraries — particularly useful in blockchain/Web3 agent pipelines where hex encoding of strings is a frequent preprocessing step and a verifiable on-chain payment receipt is desirable.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T04:03:28.418Z","isFirstParty":false,"canonicalSlug":"hex-encoding-of-utf-8-text-b8273b55"}