Endpoint
Authentication
| Header | Required | Value |
|---|---|---|
X-API-Key | Yes | Your API key (bun_...) |
Content-Type | Yes | application/json |
Overview
Generate cryptographically random unique identifiers in four formats: UUID v4, UUID v7 (time-ordered), NanoID, and ULID. Request up to 100 IDs in a single call to batch-seed databases, test fixtures, or distributed systems.Use cases
- Generate primary keys for database records
- Create time-sortable IDs with UUID v7 or ULID
- Produce short, URL-safe IDs with NanoID
- Bulk-seed test data with unique identifiers
Details
Supported types:v4 (random UUID), v7 (time-ordered UUID per RFC 9562), nanoid (21-character URL-safe string), ulid (26-character sortable identifier). The count parameter defaults to 1 and is capped at 100.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
type | string | No | ID format: v4, v7, nanoid, or ulid (default: v4) |
count | number | No | Number of IDs to generate (default: 1, max: 100) |
size | number | No | Length of each NanoID (default: 21, only used when type is nanoid) |
alphabet | string | No | Custom character set for NanoID (only used when type is nanoid) |
Example
Response
200 OK
| Field | Type | Description |
|---|---|---|
type | string | The requested ID type |
count | number | The number of IDs generated |
ids | string[] | Array of generated identifiers |
id | string | The first generated identifier (convenience shortcut for ids[0]) |

