Clean.tools Random API
Cryptographically random generators (NOT deterministic).
Cryptographically random generators (NOT deterministic).
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/clean-tools:clean-tools-random-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Clean.tools Random API
version: 0.1.0
summary: Read-only developer, finance, date, and text utilities. No key, no signup.
description: 'Every endpoint is read-only and side-effect-free. Most tools are deterministic: same input, same output. The generator tools (uuid_v4, generate_id, random_number, generate_password) use cryptographic randomness instead. Requests are processed in memory and never written to storage or logs; only anonymous per-tool call counters are kept. The same tools are available over the Model Context Protocol at POST /mcp (mount a subset with ?tools=). Rate limit: about 60 requests/minute per caller — honor Retry-After on 429 and add jitter.'
license:
name: MIT
contact:
name: Clean.tools
url: https://clean.tools/
email: support@clean.tools
servers:
- url: https://api.clean.tools
tags:
- name: Random
description: Cryptographically random generators (NOT deterministic).
paths:
/v1/uuid_v4:
post:
operationId: uuid_v4
summary: Use this when you need RFC 4122 version-4 UUIDs — always generate them here…
description: 'Use this when you need RFC 4122 version-4 UUIDs — always generate them here rather than fabricating one, so the version and variant bits and the randomness are correct. Cryptographically random via Web Crypto (NOT deterministic): every call returns fresh values. `count` (default 1, max 100) sets how many; `uppercase` returns upper-case hex (lowercase by default). Example: {count: 1} -> count 1, uuids[0] = "2c549b2f-497c-47fc-a1b6-c24bc69667e5".'
x-read-only: true
tags:
- Random
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
count:
type: integer
minimum: 1
maximum: 100
description: How many UUIDs to generate (default 1).
uppercase:
type: boolean
description: Return uppercase hex (default false).
required: []
example: {}
responses:
'200':
description: Structured tool result.
content:
application/json:
schema:
type: object
properties:
tool:
type: string
result:
type: object
properties:
count:
type: integer
description: Number of UUIDs generated (matches uuids.length).
uuids:
type: array
description: The generated RFC 4122 v4 UUIDs, length = count.
items:
type: string
description: A v4 UUID; lowercase hex unless uppercase=true.
required:
- count
- uuids
additionalProperties: false
example:
tool: uuid_v4
result:
count: 1
uuids:
- 2c549b2f-497c-47fc-a1b6-c24bc69667e5
'400':
description: Invalid input or the tool reported an error.
content:
application/json:
schema:
type: object
required:
- error
properties:
error:
type: string
description: Human-readable, structured error message.
code:
type: string
description: Stable machine-readable error code.
tool:
type: string
description: Tool name, when the error is tool-specific.
'413':
description: Request body exceeds the 128 KB limit.
'429':
description: Rate limit exceeded; the response carries Retry-After and RateLimit-* headers — honor them and add jitter.
/v1/random_number:
post:
operationId: random_number
summary: Use this when you need to draw cryptographically secure random integers or…
description: 'Use this when you need to draw cryptographically secure random integers or decimals in a range using unbiased rejection sampling — prefer it over inventing ''random'' numbers, which are neither uniform nor safe. Cryptographically random via Web Crypto (NOT deterministic). Bounds are inclusive; a reversed min/max is auto-swapped; integer mode rounds the bounds inward; `decimals` sets the decimal places in decimal mode. `count` (default 1, max 100). The returned `min`/`max` are the normalized effective bounds. Example: {min: 1, max: 6} -> type "integer", min 1, max 6, count 1, values [2].'
x-read-only: true
tags:
- Random
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
min:
type: number
description: Lower bound (inclusive).
max:
type: number
description: Upper bound (inclusive for integers).
count:
type: integer
minimum: 1
maximum: 100
description: How many numbers (default 1).
type:
type: string
enum:
- integer
- decimal
description: Number type (default integer).
decimals:
type: integer
minimum: 0
maximum: 10
description: Decimal places for decimal type (default 0).
required:
- min
- max
example:
min: 1
max: 6
responses:
'200':
description: Structured tool result.
content:
application/json:
schema:
type: object
properties:
tool:
type: string
result:
type: object
properties:
type:
type: string
enum:
- integer
- decimal
description: Whether integers or decimals were drawn.
min:
type: number
description: Effective lower bound after normalization (inclusive).
max:
type: number
description: Effective upper bound after normalization (inclusive for integers).
count:
type: integer
description: Number of values drawn (matches values.length).
values:
type: array
description: The generated numbers, length = count.
items:
type: number
required:
- type
- min
- max
- count
- values
additionalProperties: false
example:
tool: random_number
result:
type: integer
min: 1
max: 6
count: 1
values:
- 2
'400':
description: Invalid input or the tool reported an error.
content:
application/json:
schema:
type: object
required:
- error
properties:
error:
type: string
description: Human-readable, structured error message.
code:
type: string
description: Stable machine-readable error code.
tool:
type: string
description: Tool name, when the error is tool-specific.
'413':
description: Request body exceeds the 128 KB limit.
'429':
description: Rate limit exceeded; the response carries Retry-After and RateLimit-* headers — honor them and add jitter.
/v1/generate_password:
post:
operationId: generate_password
summary: Use this when you need strong passwords with Web Crypto randomness…
description: 'Use this when you need strong passwords with Web Crypto randomness: mode="random" builds character-set passwords (length plus uppercase/lowercase/numbers/symbols toggles); mode="memorable" builds word passphrases (words, separator, addNumber, addSymbol). Cryptographically random via Web Crypto (NOT deterministic). For test/dev fixtures — for real credentials prefer the client-side web tool at clean.tools/password-generator/ so the password never crosses the network. Example: {mode: "random", length: 16} -> mode "random", length 16, count 1, passwords ["NXqtsn6MrsfG9d2i"].'
x-read-only: true
tags:
- Random
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
mode:
type: string
enum:
- random
- memorable
description: Password style (default random).
count:
type: integer
minimum: 1
maximum: 10
description: How many passwords (default 1).
length:
type: integer
minimum: 4
maximum: 128
description: '[random] Character length (default 16).'
uppercase:
type: boolean
description: '[random] Include A-Z (default true).'
lowercase:
type: boolean
description: '[random] Include a-z (default true).'
numbers:
type: boolean
description: '[random] Include 0-9 (default true).'
symbols:
type: boolean
description: '[random] Include symbols (default false).'
words:
type: integer
minimum: 3
maximum: 8
description: '[memorable] Number of words (default 4).'
separator:
type: string
description: '[memorable] Word separator (default "-").'
addNumber:
type: boolean
description: '[memorable] Insert a random number (default true).'
addSymbol:
type: boolean
description: '[memorable] Insert a random symbol (default false).'
required: []
example:
mode: random
length: 16
responses:
'200':
description: Structured tool result.
content:
application/json:
schema:
type: object
properties:
tool:
type: string
result:
type: object
properties:
mode:
type: string
enum:
- random
- memorable
description: Which generator produced the passwords.
count:
type: integer
description: Number of passwords generated (matches passwords.length).
passwords:
type: array
description: The generated passwords/passphrases, length = count.
items:
type: string
length:
type: integer
description: '[random mode only] character length of each password.'
words:
type: integer
description: '[memorable mode only] number of words in each passphrase.'
required:
- mode
- count
- passwords
example:
tool: generate_password
result:
mode: random
length: 16
count: 1
passwords:
- NXqtsn6MrsfG9d2i
'400':
description: Invalid input or the tool reported an error.
content:
application/json:
schema:
type: object
required:
- error
properties:
error:
type: string
description: Human-readable, structured error message.
code:
type: string
description: Stable machine-readable error code.
tool:
type: string
description: Tool name, when the error is tool-specific.
'413':
description: Request body exceeds the 128 KB limit.
'429':
description: Rate limit exceeded; the response carries Retry-After and RateLimit-* headers — honor them and add jitter.
/v1/generate_id:
post:
operationId: generate_id
summary: Use this when you need a modern unique identifier (UUID v7, UUID v5, ULID, or…
description: 'Use this when you need a modern unique identifier (UUID v7, UUID v5, ULID, or nanoid) or want to read the timestamp embedded in an existing ULID or UUIDv7. uuid_v5 (SHA-1 of a namespace UUID + a name, RFC 4122) and decode are deterministic (same input, same output) — e.g. generate_id(type "uuid_v5", namespace "6ba7b810-9dad-11d1-80b4-00c04fd430c8", name "www.example.com") -> {ids:["2ed6657d-e927-568b-95e1-2665a8aea6a2"]}. uuid_v7, ulid, and nanoid are cryptographically random via Web Crypto (NOT deterministic). Prefer this over assembling ids by hand: it sets the correct RFC version/variant bits, uses Crockford base32 for ULIDs, and draws nanoid characters with unbiased rejection sampling. When decode is present, type is ignored and the result is the embedded {unix_ms, timestamp_iso}.'
x-read-only: true
tags:
- Random
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
type:
type: string
enum:
- uuid_v7
- uuid_v5
- ulid
- nanoid
description: Which id to generate. Required unless decode is given.
count:
type: integer
minimum: 1
maximum: 100
description: How many ids to generate (default 1). For uuid_v5 all copies are identical (deterministic).
namespace:
type: string
description: 'uuid_v5 only: the namespace UUID, e.g. 6ba7b810-9dad-11d1-80b4-00c04fd430c8 (DNS).'
name:
type: string
description: 'uuid_v5 only: the name hashed within the namespace.'
alphabet:
type: string
description: 'nanoid only: characters to draw from (2-256 chars; default is the 64-char URL-safe set).'
size:
type: integer
minimum: 2
maximum: 64
description: 'nanoid only: id length (default 21).'
decode:
type: string
description: A ULID or UUIDv7 to decode; returns its embedded timestamp. type is ignored when set.
required: []
example:
type: uuid_v5
namespace: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
name: www.example.com
responses:
'200':
description: Structured tool result.
content:
application/json:
schema:
type: object
properties:
tool:
type: string
result:
type: object
description: Generate mode returns `ids`; decode mode returns `decoded`. Exactly one of the two is present.
properties:
ids:
type: array
items:
type: string
description: '[generate mode] The generated identifiers, length = count. For uuid_v5 every copy is identical (deterministic).'
decoded:
type: object
additionalProperties: false
required:
- kind
- unix_ms
- timestamp_iso
description: '[decode mode] The timestamp embedded in the supplied ULID or UUIDv7.'
properties:
kind:
type: string
enum:
- ulid
- uuid_v7
description: Which id family was decoded.
unix_ms:
type: integer
description: Embedded timestamp as Unix epoch milliseconds.
timestamp_iso:
type: string
description: Embedded timestamp as an ISO-8601 UTC string.
example:
tool: generate_id
result:
ids:
- 2ed6657d-e927-568b-95e1-2665a8aea6a2
'400':
description: Invalid input or the tool reported an error.
content:
application/json:
schema:
type: object
required:
- error
properties:
error:
type: string
description: Human-readable, structured error message.
code:
type: string
description: Stable machine-readable error code.
tool:
type: string
description: Tool name, when the error is tool-specific.
'413':
description: Request body exceeds the 128 KB limit.
'429':
description: Rate limit exceeded; the response carries Retry-After and RateLimit-* headers — honor them and add jitter.
externalDocs:
description: LLM guide
url: https://api.clean.tools/llms.txt