# x402 Hash API – HMAC Endpoint

> x402 Hash API – HMAC Endpoint is a paid API for AI agents from x402-hash-api.vercel.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-01).

Computes an HMAC digest of input data using a specified key, algorithm, and output encoding, billed per call in USDC on Base via x402

## Facts

- Endpoint: POST https://x402-hash-api.vercel.app/api/v1/hmac?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-hash-api-hmac-endpoint-9b15466c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_f7m3O7SqWyck2v4qU44n0

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 x402-hash-api-hmac-endpoint-9b15466c -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Pay-per-call hashing and encoding for AI agents (USDC on Base)

## Output

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.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "key": {
   "type": "string"
  },
  "data": {
   "type": "string"
  },
  "encoding": {
   "type": "string"
  },
  "algorithm": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "digest": "..."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-hash-api-hmac-endpoint-9b15466c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-hash-api.vercel.app](https://www.zero.xyz/host/x402-hash-api.vercel.app/llms.txt)
