# Hash + HMAC

> Hash + HMAC is a paid API for AI agents from payanagent.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Computes cryptographic hash digests (MD5, SHA-1, SHA-256, SHA-384, SHA-512) or HMACs with an optional key, returning output in hex, base64, or base64url encoding.

## Facts

- Endpoint: POST https://payanagent.com/x402/kh737f5q658r7gq9t3x0fyk1nh8ac3hv
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hash-hmac-c2d39b3c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_rSSBkZ0F202rm7AP8NqAt

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 hash-hmac-c2d39b3c -d '<json body>'
```

Example prompt: Compute the SHA-256 hash of the string 'hello world' and give me the result in hex encoding.

## When to prefer this

Choose this endpoint when you need a simple, deterministic, server-side cryptographic hash or HMAC without setting up local crypto libraries — especially in agent pipelines that already use x402 micropayments and need consistent output encoding options (hex, base64, base64url). Useful when the agent runtime doesn't have native crypto access or when you want a neutral third-party to perform the hash.

## Known failure modes

- Unsupported algorithm value returns a validation error
- Unsupported encoding value returns a validation error
- Missing 'text' field may return an error or empty digest
- Very large text inputs may time out or be rejected
- Payment failure (402) if USDC balance is insufficient

## How this service works

Compute cryptographic digests and HMACs deterministically: MD5, SHA-1, SHA-256, SHA-384, SHA-512, output as hex, base64, or base64url. Add a "key" for HMAC. Built for checksums, content addressing, and signature verification. Inputs are hashed and discarded. POST a JSON body like: {"text":"hello world","algorithm":"sha256","encoding":"hex"}

## Output

Returns the computed hash or HMAC as a string in the requested encoding (hex, base64, or base64url). The input text is not stored or logged. The response is deterministic — identical inputs always yield identical outputs.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "key": {
   "type": "string",
   "description": "If present, compute HMAC-<algorithm> with this key instead of a plain hash."
  },
  "text": {
   "type": "string",
   "description": "The data to hash."
  },
  "encoding": {
   "enum": [
    "hex",
    "base64",
    "base64url"
   ],
   "type": "string",
   "default": "hex"
  },
  "algorithm": {
   "enum": [
    "md5",
    "sha1",
    "sha256",
    "sha384",
    "sha512"
   ],
   "type": "string",
   "default": "sha256"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hash-hmac-c2d39b3c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payanagent.com](https://www.zero.xyz/host/payanagent.com/llms.txt)
