{"uid":"cap_XsGI-mJKxacF3nsE-Ji8r","slug":"hex-decode-api-a4e03f8b","name":"Hex Decode API","description":"41 pay-per-call JSON APIs for AI agents. No account or API key: an unpaid POST returns HTTP 402, pay in USDC on Base with x402 v2, retry. Prices from $0.001 per call.","url":"https://x402-micro-pay.com/api/skills/hex-decode?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"as":{"type":"array","items":{"enum":["utf8","bytes32","address","selector","uint256","bytes"],"type":"string"},"default":["utf8","bytes32","address","selector"],"maxItems":8,"minItems":1,"uniqueItems":true},"hex":{"type":"string","pattern":"^(?:0x)?[0-9a-fA-F]+$","maxLength":8194,"minLength":1,"description":"Hex string (0x optional), even length, max 4096 bytes"},"request_id":{"type":"string","pattern":"^[A-Za-z0-9._:-]+$","maxLength":64,"minLength":1,"description":"Optional idempotency key. Echoed back; a credit-pack redemption with the same request_id and body is charged once."}}},"responseSchema":{"type":"json","example":{"ok":true,"data":{"hex":"0x48656c6c6f","utf8":"Hello","address":null,"bytes32":"0x00000000000000000000000000000000000000000000000000000048656c6c6f","selector":"0x48656c6c","address_ok":false,"byte_length":5,"selector_note":"4-byte function selector (local only; no 4byte.directory lookup)","bytes32_utf8_stripped":"Hello"},"next":["address_validate","tx_status"],"skill":"hex_decode","charged":true,"service":"hex_decode","sources":[{"url":"hex-decode","name":"local","fetched_at":"2026-10-26T14:00:00Z"}],"summary":"hex-decode: 5 bytes, utf8","version":"1.0.0","warnings":["left-padded to 32 bytes"],"confidence":1,"data_as_of":"2026-10-26T14:00:00Z","generated_at":"2026-10-26T14:00:00Z"}},"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_EQlb1p3VTRpNnPgHqnuKW","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":"Decodes a hex string into multiple representations: UTF-8 text, bytes32, Ethereum address, 4-byte function selector, and uint256","exampleAgentPrompt":"Decode the hex string 0x48656c6c6f for me — I want to see it as UTF-8 text, as a bytes32 value, and check if it could be an Ethereum address.","exampleUseCases":[{"title":"Decoding blockchain transaction calldata","prompt":"I've got this hex calldata from an Ethereum transaction: 0xa9059cbb000000000000000000000000abcdef1234567890abcdef1234567890abcdef12 — can you decode it and show me the 4-byte function selector and any readable parts?"},{"title":"Inspecting hex-encoded log data","prompt":"This event log has a hex value 0x000000000000000000000000000000000000000000000000000000000000002a — decode it as bytes32 and uint256 so I can see what number it represents."},{"title":"Reading hex-encoded text from on-chain storage","prompt":"I pulled this hex from a smart contract's storage slot: 0x48656c6c6f20576f726c64 — what does it say in plain UTF-8?"}],"resultDescription":"A JSON object containing the decoded representations of the input hex string: utf8 text (if valid), bytes32 (left-padded), Ethereum address (if 20 bytes), 4-byte function selector, byte length, and validity flags for address and other formats. Also includes warnings (e.g. left-padding applied), confidence score, skill name, and suggested next skills.","failureModes":["Invalid hex string (odd length or non-hex characters) returns validation error","Hex string exceeds 4096 bytes (8194 character) maximum length","Empty hex string rejected by minLength:1 constraint","Requesting unsupported decode type in 'as' array returns error","Payment not made returns HTTP 402 requiring x402 USDC payment on Base"],"whenToPreferThis":"Use this endpoint when you need to decode a raw hex string into one or more human-readable or Ethereum-typed representations in a single call, especially when working with blockchain data, smart contract calldata, or hex-encoded storage values. Prefer this over generic hex utilities when you need simultaneous multi-format output (UTF-8, address, bytes32, selector) and are already working within an x402 micropayment agent workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-20T12:42:14.033Z","isFirstParty":false,"canonicalSlug":"hex-decode-api-a4e03f8b"}