{"uid":"cap_tH16HP6ZETVtXJT1GVyuu","slug":"hmac-of-a-message-under-a-key-c20f64cf","name":"HMAC of a message under a key","description":"HMAC of a message under a key — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/hash-hmac?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"hex":{"type":"string","pattern":"^0x[0-9a-fA-F]*$"},"key":{"type":"string"},"text":{"type":"string","maxLength":49152},"algorithm":{"type":"string"}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"hash-hmac","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.002,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_IcE6qpJtn1TgX_egz1MFY","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes an HMAC (keyed-hash message authentication code) for a given message and secret key using a specified algorithm","exampleAgentPrompt":"Compute an HMAC-SHA256 of the text 'order:12345:confirmed' using the secret key 'my-webhook-secret' and give me the resulting digest.","exampleUseCases":[{"title":"Webhook signature verification","prompt":"Calculate the HMAC-SHA256 of the payload 'user_id=42&event=purchase' with the shared secret 'wh_secret_abc123' so I can check it against the signature header from this incoming webhook."},{"title":"API request signing","prompt":"I need to sign my API request body 'GET /api/orders?page=1' using HMAC-SHA512 with the key 'api_private_key_xyz' before sending it to the server."},{"title":"Data integrity tagging","prompt":"Generate an HMAC-MD5 authentication tag for the string 'invoice_id=9981&amount=250.00' using the key 'billing-secret-key' so I can store it alongside the record to detect tampering."}],"resultDescription":"Returns a JSON object with ok:true, the type field set to 'hash-hmac', the computed HMAC digest, and a payment receipt containing the transaction hash, USD amount, and receipt ID.","failureModes":["Missing or invalid key returns an error response","Unsupported algorithm name causes a failure","Text exceeding 49152 characters is rejected","Malformed hex input (not matching 0x[hex] pattern) returns a validation error","Network or payment processing failure returns a non-ok response"],"whenToPreferThis":"Choose this endpoint when you need a simple, pay-per-call HMAC computation without managing your own cryptographic infrastructure — ideal for agents that occasionally need to sign messages, verify webhook payloads, or authenticate data on demand without a persistent server-side HMAC library. Particularly useful when the algorithm is configurable and you need a trusted third-party computation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:35.092Z","isFirstParty":false,"canonicalSlug":"hmac-of-a-message-under-a-key-c20f64cf"}