# fittings Cryptographically Secure Random Bytes Generator

> fittings Cryptographically Secure Random Bytes Generator is a paid API for AI agents from fittings.sh, paid per call via x402, $0.003103/call, status unknown (last checked 2026-09-14).

Generates cryptographically secure random bytes using the Web Crypto API (CSPRNG), returned as hex, base64, or UUID string.

## Facts

- Endpoint: GET https://fittings.sh/v1/crypto/random-bytes
- Price: $0.003103/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fittings-cryptographically-secure-random-bytes-generator-18cfaebe
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XwUZnmfmBmIOAaOJH-H55

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 fittings-cryptographically-secure-random-bytes-generator-18cfaebe
```

Example prompt: Generate 32 cryptographically secure random bytes and return them as a hex string.

## When to prefer this

Choose this endpoint when you need verifiably cryptographically secure random data (CSPRNG quality) rather than pseudo-random numbers from Math.random. Ideal for generating tokens, nonces, salts, session IDs, or UUIDs in server-side agent workflows where a trusted external entropy source is required and local crypto APIs are unavailable or untrusted.

## Known failure modes

- bytes parameter out of range (must be 1-1024) — returns error
- invalid encoding value (must be hex, base64, or uuid) — returns error
- uuid encoding ignores the bytes parameter as UUIDs have a fixed 16-byte structure
- network timeout on the fittings.sh host

## How this service works

Generate CSPRNG bytes from the Web Crypto API, returned as hex, base64 or a UUID. Never Math.random.

## Output

A string of cryptographically secure random bytes in the requested encoding: hex (lowercase hexadecimal), base64, or UUID (RFC 4122 v4 format). The output is produced by the Web Crypto API CSPRNG, never Math.random.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "bytes": {
       "type": "number",
       "description": "1-1024"
      },
      "encoding": {
       "type": "string",
       "description": "hex | base64 | uuid"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fittings-cryptographically-secure-random-bytes-generator-18cfaebe/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fittings.sh](https://www.zero.xyz/host/fittings.sh/llms.txt)
