UUID generator API: random and time-ordered IDs
Every mainstream language generates UUIDs for free (uuid.uuid4() in Python, crypto.randomUUID() in browsers and Node), so a UUID API is mainly for tools and AI agents that can't run code. Our ID and Password Generator API returns up to 100 UUID v4, UUID v7, ULID or nanoid-style IDs per call from a secure random source for $0.002. For database keys, time-ordered UUID v7 or ULID usually index better than random v4.
Try it free ID & Password Generator API — UUID v7, ULID, $0.002 · $0.002 / call
Free in code
# Python
import uuid
uuid.uuid4() # random
uuid.uuid7() # time-ordered, Python 3.14 and later
// JavaScript (browsers and Node 19+)
crypto.randomUUID()
Which ID to use
Random v4 keys land all over a B-tree index, which slows inserts on big tables. Time-ordered v7 and ULID keep new rows together. The trade-off: they reveal when the id was created.
| Type | Looks like | Sorts by time | Best for |
|---|---|---|---|
| UUID v4 | 36 characters, random | No | Public ids that reveal nothing |
| UUID v7 | 36 characters, starts with the time | Yes | Database primary keys |
| ULID | 26 characters, Crockford base32 | Yes | Shorter sortable ids in URLs and logs |
| nanoid-style | Your alphabet and length | No | Short links and invite codes |
Our API
Pick a type and a count from 1 to 100. nanoid takes your own alphabet and a length from 4 to 128. The same endpoint also makes passwords (8 to 128 characters, look-alike characters left out) and word passphrases. Every answer includes the entropy in bits. Values come from crypto.getRandomValues with unbiased sampling and nothing is stored or logged.
curl -i -X POST https://iamai.markets/api/x402/services/NxguF_52ZW3i \
-H "Content-Type: application/json" \
-d '{"type": "uuid7", "count": 3}'
# result: type, count, values [3 UUID v7 strings], entropy_bits: 74
Things people get wrong
- Using Math.random() for ids. It isn't a secure random source; use crypto.randomUUID or crypto.getRandomValues.
- Storing UUIDs as text in big tables. Many databases have a native 16-byte uuid type that is smaller and faster.
- Assuming v4 ids are secret. They're hard to guess, but don't use an id as the only check on who can see a record.
Cost
$0.002 per call whether you ask for 1 id or 100, paid with x402 in USDC on Base. 5 free tries a day on the listing page.
The product
Questions
Can two UUID v4s collide?
In theory, but with 122 random bits the chance is negligible for any real system.
Is UUID v7 a standard?
Yes. RFC 9562 (2024) defines versions 6, 7 and 8 alongside the older ones.
What is a GUID?
Microsoft's name for a UUID. Same 128-bit format.
Related
Updated 2026-12-02
