# Hash Digest API (MD5/SHA/HMAC)

> Hash Digest API (MD5/SHA/HMAC) is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Computes MD5, SHA-1, SHA-256, or SHA-512 hash (plain or HMAC with a key) of a string, returning both hex and base64 encodings.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/hash-digest
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hash-digest-api-md5-sha-hmac-42e80402
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RW3dJZgrx-V4NGQToXq71

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-digest-api-md5-sha-hmac-42e80402 -d '<json body>'
```

Example prompt: Can you compute the SHA-256 HMAC of the string 'order:12345:confirmed' using the secret key 'mysecretkey', and give me both the hex and base64 versions?

## When to prefer this

Use this endpoint when an AI agent needs a quick, reliable hash or HMAC computation without setting up a local crypto library — especially useful in serverless or sandboxed agent environments where native crypto modules are unavailable. Ideal for generating API signatures, checksums, or fingerprints on the fly. Prefer this over general-purpose code execution endpoints when the sole requirement is hashing.

## Known failure modes

- Unsupported algorithm name returns a validation error
- Missing input string returns a 400 bad request
- Invalid or missing HMAC key when HMAC mode is requested
- Very large input strings may be truncated or rejected
- Payment failure via x402 protocol blocks the request

## How this service works

Compute md5/sha1/sha256/sha512 (or HMAC with a key) of a string; hex + base64 output.

## Output

Returns the computed hash digest in both hexadecimal and base64 encodings, along with the algorithm name used (md5, sha1, sha256, or sha512). For HMAC requests, the result reflects keyed hashing with the provided secret.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "algo": {
   "type": "string"
  },
  "text": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hex": "b94d27b9...",
  "algo": "sha256"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hash-digest-api-md5-sha-hmac-42e80402/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
