{"uid":"cap_f7m3O7SqWyck2v4qU44n0","slug":"x402-hash-api-hmac-endpoint-9b15466c","name":"x402 Hash API – HMAC Endpoint","description":"Pay-per-call hashing and encoding for AI agents (USDC on Base)","url":"https://x402-hash-api.vercel.app/api/v1/hmac?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"key":{"type":"string"},"data":{"type":"string"},"encoding":{"type":"string"},"algorithm":{"type":"string"}}},"responseSchema":{"type":"json","example":{"digest":"..."}},"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_5PppasqEbb_RxLgxWUIS7","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 digest of input data using a specified key, algorithm, and output encoding, billed per call in USDC on Base via x402","exampleAgentPrompt":"Compute an HMAC-SHA256 digest of the string 'order:12345:confirmed' using the secret key 'mysecretkey', and return the result as a hex-encoded string.","exampleUseCases":[{"title":"Webhook signature validation","prompt":"I need to verify incoming webhook payloads from our payment provider — compute an HMAC-SHA256 of this payload body 'amount=100&currency=USD&ref=abc' using my secret key 'wh_secret_xyz' and give me the hex digest so I can compare it to the header signature."},{"title":"API request signing for auth","prompt":"Sign this API request string 'GET /users/42 timestamp=1718000000' with HMAC-SHA512 using my secret key 'api_signing_key' and return the result base64-encoded, so I can attach it as an authorization signature."},{"title":"Data integrity tagging for storage","prompt":"Before I store this data blob 'session_data:{userId:99,role:admin}' in the database, compute an HMAC-SHA256 tag using key 'integrity_key_2024' with hex encoding so I can attach it as a tamper-detection checksum."}],"resultDescription":"A JSON object containing a 'digest' field with the HMAC hash value encoded in the requested format (e.g. hex or base64). The digest is computed server-side using the provided key, data, and algorithm.","failureModes":["Missing 'key' or 'data' fields returns a 400 or error response","Unsupported 'algorithm' or 'encoding' value may return an error or unexpected output","Payment failure (insufficient USDC balance or x402 protocol error) prevents the call from completing","Empty or malformed request body results in processing failure","Network or Vercel serverless cold-start latency may occasionally cause timeouts"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to compute a keyed cryptographic hash (HMAC) on-demand without managing a local crypto library, and when pay-per-call micropayment pricing via x402/USDC is acceptable or preferred. It is especially useful for agents that need to sign or verify messages, authenticate API requests, or generate tamper-detection codes as part of an automated workflow. Prefer a local crypto library if latency is critical or if volume is high enough that per-call costs exceed infrastructure costs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T06:34:09.433Z","isFirstParty":false,"canonicalSlug":"x402-hash-api-hmac-endpoint-9b15466c"}