# 24K Labs Hash Digest API

> 24K Labs Hash Digest API 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 (or HMAC variant with a secret key) of a string, returning both hex and base64 encodings.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/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/24k-labs-hash-digest-api-86c01fbf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RaKoVAEN5DjPfMdDhcANv

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 24k-labs-hash-digest-api-86c01fbf -d '<json body>'
```

Example prompt: Can you compute the SHA-256 hash of the string 'hello world' and give me both the hex and base64 versions?

## When to prefer this

Choose this endpoint when you need a quick, hosted hash or HMAC computation without running local crypto libraries — especially useful in agent pipelines, serverless environments, or when you need both hex and base64 output in one call. Prefer it over self-hosted solutions when you want pay-per-use pricing and no infrastructure setup. It covers MD5, SHA-1, SHA-256, and SHA-512 in one unified API.

## Known failure modes

- Missing or empty input string returns a 400 validation error
- Unsupported algorithm name returns an error listing valid options
- Invalid or malformed HMAC key may return a 400 or processing error
- Very large input strings may be rejected or time out
- Incorrect Content-Type header causes request parsing failure

## How this service works

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

## Output

Returns a JSON object containing the hex-encoded digest, the base64-encoded digest, and the algorithm used, for the requested hash function (MD5, SHA-1, SHA-256, or SHA-512) optionally keyed with an HMAC 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/24k-labs-hash-digest-api-86c01fbf/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)
