# HMAC of a message under a key

> HMAC of a message under a key is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-29).

Computes an HMAC (keyed-hash message authentication code) for a given message and secret key using a specified algorithm

## Facts

- Endpoint: POST https://twin.unykorn.org/hash-hmac?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hmac-of-a-message-under-a-key-c20f64cf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tH16HP6ZETVtXJT1GVyuu

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability hmac-of-a-message-under-a-key-c20f64cf -d '<json body>'
```

Example prompt: Compute an HMAC-SHA256 of the text 'order:12345:confirmed' using the secret key 'my-webhook-secret' and give me the resulting digest.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

HMAC of a message under a key — Genesis402 / UnyKorn Operator Network

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "hash-hmac",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.25,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hmac-of-a-message-under-a-key-c20f64cf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
