random

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.

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}.

post/v1/generate_id

Request

  • Base URL: https://api.clean.tools
  • URL: https://api.clean.tools/v1/generate_id
  • Auth: none declared

Request body

type'uuid_v7' | 'uuid_v5' | 'ulid' | 'nanoid'

Which id to generate. Required unless decode is given.

countinteger

How many ids to generate (default 1). For uuid_v5 all copies are identical (deterministic).

namespacestring

uuid_v5 only: the namespace UUID, e.g. 6ba7b810-9dad-11d1-80b4-00c04fd430c8 (DNS).

namestring

uuid_v5 only: the name hashed within the namespace.

alphabetstring

nanoid only: characters to draw from (2-256 chars; default is the 64-char URL-safe set).

sizeinteger

nanoid only: id length (default 21).

decodestring

A ULID or UUIDv7 to decode; returns its embedded timestamp. type is ignored when set.

Response

Structured tool result.

toolstring

Changes

No recorded changes to this operation across all 1 revision of this API.