# AgentTools Cryptographic Random Generator

> AgentTools Cryptographic Random Generator is a paid API for AI agents from agenttools-hub.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-02).

Generates cryptographically secure random values: passwords with configurable character sets, hex keys of arbitrary byte length, and uniformly distributed random integers using rejection sampling.

## Facts

- Endpoint: GET https://agenttools-hub.vercel.app/api/v1/crypto/random-generator?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttools-cryptographic-random-generator-686e406d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1zxNo2auSgaYVhlIoa5Af

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 agenttools-cryptographic-random-generator-686e406d
```

Example prompt: Generate a cryptographically secure random password that's 20 characters long, including uppercase letters, digits, and symbols — no Math.random, I need it safe for production secrets.

## When to prefer this

Use this endpoint when you need cryptographically secure random values (CSPRNG) for secrets, keys, or unbiased integers — not when pseudo-random values from Math.random are acceptable. Prefer this over language built-ins when operating in an agent context without direct access to a secure runtime, or when you need configurable password charset rules or rejection-sampled integers without implementing the logic yourself.

## Known failure modes

- Missing required 'mode' parameter returns a 400 error
- Invalid mode value (not 'password', 'hex', or 'int') causes a validation failure
- For 'int' mode, min or max not provided or min >= max results in an error
- Negative or zero length for password/hex mode may cause a rejection
- Payment not provided or insufficient (x402) results in a 402 Payment Required response

## How this service works

Generate cryptographically secure randomness: passwords with charset rules, hex keys of any byte length, and uniform random integers (rejection sampling, no modulo bias). Never use Math.random for secrets. Use this when an agent needs to cSPRNG passwords, hex keys and uniform integers.

## Output

Returns a generated value based on the selected mode: a password string respecting the specified character set flags and length, a hex-encoded string of the requested byte length, or an integer uniformly sampled between the provided min and max. The response is JSON containing the generated random value and relevant metadata.

## 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": {
      "max": {
       "type": "number",
       "description": "Int maximum"
      },
      "min": {
       "type": "number",
       "description": "Int minimum"
      },
      "mode": {
       "enum": [
        "password",
        "hex",
        "int"
       ],
       "type": "string",
       "description": "Mode"
      },
      "upper": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "description": "Include A–Z"
      },
      "digits": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "description": "Include 0–9"
      },
      "length": {
       "type": "number",
       "description": "Length (password/hex)"
      },
      "symbols": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "description": "Include symbols"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agenttools-cryptographic-random-generator-686e406d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agenttools-hub.vercel.app](https://www.zero.xyz/host/agenttools-hub.vercel.app/llms.txt)
