# x402 Hash API – SHA-256

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

Computes a SHA-256 cryptographic hash of a provided string payload, returning the hex digest, with payment via USDC on Base per call

## Facts

- Endpoint: POST https://x402-hash-api.vercel.app/api/v1/sha256?utm_source=zero.xyz
- Price: $0.001/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-sha-256-89272dd1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_82jnxl0JYdh1YgupflbCV

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-sha-256-89272dd1 -d '<json body>'
```

Example prompt: Hash the string 'hello world' using SHA-256 with UTF-8 encoding and give me the digest.

## When to prefer this

Choose this endpoint when an AI agent needs a pay-per-call SHA-256 hashing capability without setting up server-side infrastructure, especially in x402-compatible micropayment workflows on Base. Prefer it over local hashing libraries when operating in sandboxed agent environments lacking native crypto access, or when auditability of an external hash computation is desired.

## Known failure modes

- Missing 'data' field in request body returns a 400 error
- Invalid encoding value (not utf8, hex, or base64) may return a 400 or behave unexpectedly
- Payment failure or insufficient USDC balance returns a 402 Payment Required response
- Malformed base64 or hex input may produce an error or incorrect hash
- Service unavailability on Vercel infrastructure returns a 503 or timeout

## How this service works

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

## Output

A JSON object containing the 'digest' field (the SHA-256 hash as a hex string) and the 'algorithm' field confirming 'sha256'. The response is deterministic for the same input and encoding.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "type": "string",
   "description": "payload to hash"
  },
  "encoding": {
   "type": "string",
   "description": "utf8 | hex | base64"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-hash-api-sha-256-89272dd1/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)
