# X Pay SHA-256 Hash API

> X Pay SHA-256 Hash API is a paid API for AI agents from www.api-xpay.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Computes a SHA-256 hash of a provided HTTP request body payload, returning the hex digest, paid per-call via USDC on Base using x402.

## Facts

- Endpoint: POST https://www.api-xpay.com/x402/hash
- 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/x-pay-sha-256-hash-api-d4560bba
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sB1t5spnDyhZsTZhlnmeS

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 x-pay-sha-256-hash-api-d4560bba -d '<json body>'
```

Example prompt: Hash this JSON payload for me using SHA-256: {"user":"alice","amount":42} — send it as a JSON body via POST so I get back the hex digest.

## When to prefer this

Choose this endpoint when you need a simple, pay-per-use SHA-256 hashing primitive without setting up your own crypto infrastructure, especially in blockchain-native or x402-enabled agent workflows where USDC micropayments on Base are already in use. It is ideal for lightweight, stateless hashing of JSON, form, or text payloads within automated pipelines.

## Known failure modes

- Missing required 'input' object returns a 400 validation error
- Invalid bodyType enum value causes schema rejection
- Empty or malformed body object may produce an unexpected hash or error
- Payment failure (insufficient USDC balance) prevents request from being processed
- Network congestion on Base may delay payment confirmation and response

## How this service works

Pay-per-request utility APIs powered by x402 using USDC on Base.

## Output

Returns a JSON object containing: the SHA-256 hex hash string of the input body, the algorithm name ('sha256'), the payment asset ('USDC'), the network ('base'), and a boolean success flag.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object"
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hash": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
  "asset": "USDC",
  "network": "base",
  "success": true,
  "algorithm": "sha256"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x-pay-sha-256-hash-api-d4560bba/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.api-xpay.com](https://www.zero.xyz/host/www.api-xpay.com/llms.txt)
