# 2s Hash Compute

> 2s Hash Compute is a paid API for AI agents from 2s.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Computes cryptographic hash digests of an input string using one or more configurable hashing algorithms

## Facts

- Endpoint: POST https://2s.io/api/hash/compute
- 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/2s-hash-compute-23d280d5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RBa0dmplcmIpnEhDpf-Ug

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 2s-hash-compute-23d280d5 -d '<json body>'
```

Example prompt: Can you compute the SHA-256 and SHA-512 hashes of the string 'hello world' and give me the results in hex encoding?

## When to prefer this

Use this endpoint when an AI agent needs to compute cryptographic hashes on-demand without managing server infrastructure, libraries, or API keys — especially useful for data integrity checks, fingerprinting, or multi-algorithm comparison in a single call. Prefer over self-hosted solutions when operating in a stateless, pay-per-use agent environment on Base or Solana.

## Known failure modes

- Invalid algorithm name not in the supported enum returns an error
- Input exceeding 524288 characters may be rejected
- Unsupported inputEncoding or outputEncoding values return validation errors
- Malformed base64 or hex input strings may cause decoding errors
- Payment failure via x402 prevents the call from being processed

## How this service works

The (most) everything API: 575+ pay-per-call endpoints for AI agents — ground-truth data, a full AI gateway, and agent infrastructure (storage, queues, watchers). USDC via x402, no signup, no API keys, and upto billing: pay actual usage, not the quote.

## Output

A JSON object containing an array of items, each with the input metadata (encoding and byte count), a map of algorithm names to their computed digest strings, and output encoding used. Also includes a total count and source attribution with provider, URL, and license.

## Example request

```json
{
 "input": "Hello world",
 "algorithm": "sha256",
 "inputEncoding": "utf8",
 "outputEncoding": "hex"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "string",
   "maxLength": 524288
  },
  "algorithm": {
   "enum": [
    "md5",
    "sha1",
    "sha224",
    "sha256",
    "sha384",
    "sha512",
    "sha3-224",
    "sha3-256",
    "sha3-384",
    "sha3-512",
    "blake2b512",
    "blake2s256"
   ],
   "type": "string"
  },
  "algorithms": {
   "type": "array",
   "items": {
    "enum": [
     "md5",
     "sha1",
     "sha224",
     "sha256",
     "sha384",
     "sha512",
     "sha3-224",
     "sha3-256",
     "sha3-384",
     "sha3-512",
     "blake2b512",
     "blake2s256"
    ],
    "type": "string"
   }
  },
  "inputEncoding": {
   "enum": [
    "utf8",
    "hex",
    "base64"
   ],
   "type": "string",
   "default": "utf8"
  },
  "outputEncoding": {
   "enum": [
    "hex",
    "base64"
   ],
   "type": "string",
   "default": "hex"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-hash-compute-23d280d5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
