# UUID Lab 🔢 — UUID v4/v7, Nanoid, Short ID & ULID Generator (`perryay/uuid-lab`) Actor

Pure-Python ID generator producing UUID v4, UUID v7 (time-ordered), nanoid (customizable length/alphabet), short base62 IDs, and Crockford Base32 ULIDs. Supports batch mode for generating multiple different ID types in a single run. Zero external dependencies.

- **URL**: https://apify.com/perryay/uuid-lab.md
- **Developed by:** [Perry AY](https://apify.com/perryay) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.008 / actor start

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## UUID Lab — Generate UUID v4, UUID v7, Nanoid, Short ID, ULID, and Base62 IDs

### What does it do?

**UUID Lab** is a pure-Python ID generator that produces six types of universally unique identifiers — UUID v4 (random), UUID v7 (time-ordered), nanoid (customizable alphabet/length), short base62 IDs, Crockford Base32 ULIDs, and plain UUIDs — in batches of 1 to 100 at a time. Stop copy-pasting from online generators or writing throwaway scripts every time you need a batch of IDs for database seeding, URL shorteners, distributed tracing, or API key generation.

### Who is it for?

| Persona | What they use it for |
|---|---|
| Backend Developer | Generating primary keys for database tables, API resource identifiers, and event stream IDs |
| DevOps Engineer | Producing unique IDs for deployment trace correlation, log correlation, and container instance labels |
| Data Scientist | Creating unique identifiers for experiment runs, dataset rows, model versions, and A/B test variants |
| Frontend Developer | Generating client-side IDs for optimistic UI updates, React list keys, and local storage records |
| System Architect | Evaluating different ID formats — UUID v7 sortability, ULID density, nanoid URL safety — for distributed system design |
| Security Engineer | Producing cryptographically random session tokens, API keys, and one-time use nonces |
| Product Manager | Creating human-readable coupon codes and invite links with nanoid's customizable alphabet |

### Why use this?

- **Six ID types in one tool** — UUID v4, UUID v7 (time-sortable), nanoid (configurable alphabet and length), short base62 IDs, Crockford Base32 ULIDs, and raw hex UUIDs. Pick the right format for your use case without installing six separate packages.
- **Batch generation up to 100 IDs per run** — Need 50 database keys for a seed script or 100 session tokens for a load test? One run gives you all of them in a clean JSON array. No loops, no concatenation, no scripting.
- **Customizable nanoids** — Nanoids support a configurable alphabet (use only uppercase, only digits, hex-only, or your own custom set) and adjustable length (1–64). Perfect for URL shorteners, coupon codes, invite links, and human-friendly identifiers.
- **Time-ordered UUID v7** — UUID v7 embeds a millisecond-precision Unix timestamp in the first 48 bits, making IDs sortable by creation time. Ideal for database indexes that need insert-order clustering without a separate `created_at` column.
- **Cryptographically secure randomness** — UUID Lab uses Python's `secrets` module and `os.urandom` under the hood. Every ID is generated with a CSPRNG, suitable for security-sensitive use cases like API keys, session tokens, and authentication nonces.
- **Deterministic and reproducible** — No external state, no network calls, no database queries. Every run produces consistent, spec-compliant IDs you can trust in production systems.

### Input Parameters

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `mode` | string | yes | `uuid4` | ID type to generate. One of: `uuid4`, `uuid7`, `nanoid`, `shortid`, `ulid`, `uuid` |
| `count` | integer | no | `1` | Number of IDs to generate. Range: 1–100 |
| `alphabet` | string | no | `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-` | Custom character set for nanoid mode only. Ignored for all other modes. |
| `length` | integer | no | `21` | Length of each generated ID in nanoid mode only. Ignored for all other modes. Range: 1–64 |

#### Mode reference

| Mode | ID Format | Example | Best For |
|---|---|---|---|
| `uuid4` | Random UUID (36 chars, 5 groups, hex) | `f47ac10b-58cc-4372-a567-0e02b2c3d479` | General-purpose unique identifiers, database PKs |
| `uuid7` | Time-ordered UUID (36 chars) | `018f3a6b-7c8d-7345-b123-9abc0def1234` | Sortable primary keys, time-series data, event streams |
| `nanoid` | Configurable alphabet and length | `V1StGXR8_Z5jdHi6B-myT` | URL shorteners, public IDs, coupon codes, invite links |
| `shortid` | Base62 short ID (6–12 chars) | `3Kc8aV` | Compact references, short URLs, tiny IDs |
| `ulid` | Crockford Base32 ULID (26 chars) | `01ARZ3NDEKTSV4RRFFQ69G5FAV` | Sortable IDs, distributed systems, Kafka keys |
| `uuid` | Plain hex UUID (32 chars, no hyphens) | `f47ac10b58cc4372a5670e02b2c3d479` | Systems that prefer compact hex without hyphens |

### Example Input

```json
{
  "mode": "nanoid",
  "count": 10,
  "alphabet": "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
  "length": 8
}
````

#### Other mode examples

```json
{
  "mode": "uuid7",
  "count": 5
}
```

```json
{
  "mode": "ulid",
  "count": 20
}
```

```json
{
  "mode": "shortid",
  "count": 1
}
```

### Output Structure

| Field | Type | Description |
|---|---|---|
| `mode` | string | The ID generation mode that was used |
| `count` | integer | Number of IDs generated |
| `ids` | array of strings | The generated IDs in string format |
| `metadata` | object | Additional information about the generated IDs (format description, length, and for uuid7: generation timestamp) |

### Example Output

```json
{
  "mode": "nanoid",
  "count": 10,
  "ids": [
    "A3K8X9BZ",
    "M7Q2R5VN",
    "J9P4W1CL",
    "E6Y0T8DF",
    "H2N5S7GU",
    "C1V9L3XI",
    "F8M0B4WK",
    "D7P6H2QE",
    "K4R1Y9TS",
    "Z3W5L8NO"
  ],
  "metadata": {
    "format": "nanoid",
    "alphabet": "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
    "length": 8,
    "collisionProbability": "negligible",
    "generatedAt": "2026-07-19T12:00:00Z"
  }
}
```

#### UUID v7 output example

```json
{
  "mode": "uuid7",
  "count": 3,
  "ids": [
    "018f3a6b-7c8d-7000-b123-9abc0def1234",
    "018f3a6b-7c8d-7001-b123-9abc0def1235",
    "018f3a6b-7c8d-7002-b123-9abc0def1236"
  ],
  "metadata": {
    "format": "UUID v7 (time-ordered)",
    "timestamp": "2026-07-19T12:00:00.123Z",
    "length": 36,
    "sortable": true
  }
}
```

### API Usage

#### cURL

```bash
## Generate 5 UUID v7 IDs
curl -X POST "https://api.apify.com/v2/acts/perryay~uuid-lab/runs" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "mode": "uuid7",
    "count": 5
  }'

## Generate 20 nanoids with hex-only alphabet (for coupon codes)
curl -X POST "https://api.apify.com/v2/acts/perryay~uuid-lab/runs" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "mode": "nanoid",
    "count": 20,
    "alphabet": "0123456789ABCDEF",
    "length": 12
  }'

## Generate a single ULID
curl -X POST "https://api.apify.com/v2/acts/perryay~uuid-lab/runs" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "mode": "ulid",
    "count": 1
  }'

## Generate 100 short IDs
curl -X POST "https://api.apify.com/v2/acts/perryay~uuid-lab/runs" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "mode": "shortid",
    "count": 100
  }'
```

#### Python

```python
import requests

API_TOKEN = "YOUR_API_TOKEN"
ACTOR_URL = "https://api.apify.com/v2/acts/perryay~uuid-lab/runs"

## Generate 10 short IDs for URL references
response = requests.post(
    ACTOR_URL,
    headers={"Content-Type": "application/json",
             "Authorization": f"Bearer {API_TOKEN}"},
    json={"mode": "shortid", "count": 10}
)

result = response.json()
for i, id_value in enumerate(result["ids"]):
    print(f"ID {i + 1}: {id_value}")

## Generate human-friendly coupon codes
response = requests.post(
    ACTOR_URL,
    headers={"Content-Type": "application/json",
             "Authorization": f"Bearer {API_TOKEN}"},
    json={
        "mode": "nanoid",
        "count": 50,
        "alphabet": "ABCDEFGHJKLMNPQRSTUVWXYZ23456789",  # No I/1/O/0 ambiguity
        "length": 10
    }
)

coupons = response.json()["ids"]
print(f"Generated {len(coupons)} coupon codes")
for code in coupons[:5]:
    print(f"  SAVE-{code}")  # e.g., SAVE-X7KP2RMT9A

## Generate UUID v4 keys for database seeding
response = requests.post(
    ACTOR_URL,
    headers={"Content-Type": "application/json",
             "Authorization": f"Bearer {API_TOKEN}"},
    json={"mode": "uuid4", "count": 25}
)

uuids = response.json()["ids"]
with open("/tmp/seed_uuids.txt", "w") as f:
    for uid in uuids:
        f.write(f"{uid}\n")
print(f"Wrote {len(uuids)} UUIDs to seed file")
```

### Use Cases

1. **Database Primary Key Generation** — Seed your database tables with UUID v7 keys that sort chronologically. UUID v7's time-ordered structure means fewer B-tree page splits in PostgreSQL and MySQL compared to random UUID v4. Run a single batch to generate all the IDs you need for your seed script.

2. **URL Shortener Tokens** — Use nanoid mode with a URL-safe alphabet (`A-Za-z0-9_-`) and length 8–10 to generate compact, collision-resistant tokens. At length 8 with the full 64-character alphabet, you get 64⁸ ≈ 2.8 × 10¹⁴ possible combinations — trillions of unique short URLs.

3. **Coupon & Promo Codes** — Generate human-friendly coupon codes using nanoid with an uppercase-only alphabet that excludes ambiguous characters (I/1, O/0). Keep them short enough to type at checkout (8–12 characters) but long enough to resist brute-force guessing.

4. **Distributed Tracing IDs** — Use ULID or UUID v7 for distributed trace correlation IDs across microservices. The embedded timestamp lets you sort traces chronologically without parsing a separate timestamp field. The 26-character ULID format is more compact than standard UUIDs and sorts lexicographically.

5. **API Key Generation** — Batch-generate 100 cryptographically random API keys using shortid or nanoid with a long length (32+) and full alphabet. Export the list directly into your key management system, database seed file, or provisioning script.

6. **Event Stream Partition Keys** — Use time-ordered UUID v7 or ULID as partition keys for Kafka, Kinesis, or Pulsar event streams. Sortable IDs mean consumers can process events in chronological order without extracting timestamps, and the random suffix ensures even distribution across partitions.

7. **Client-Side Optimistic IDs** — Generate UUID v4 IDs on the client side before submitting data to the server. This enables optimistic UI updates — render the new record immediately with its known ID, then reconcile when the server responds. No need to wait for a server-generated ID.

### FAQ

**Q: What is the difference between UUID v4 and UUID v7?**
A: UUID v4 is fully random — all 122 bits are random with 6 version/variant bits. UUID v7 embeds a Unix millisecond timestamp in the first 48 bits, followed by version and random bits. Use v7 when you want your database primary keys to cluster chronologically (better index performance); use v4 when you want purely random IDs with no temporal correlation.

**Q: Are the generated IDs cryptographically random?**
A: Yes. UUID Lab uses Python's `secrets` module and `os.urandom` under the hood, which are cryptographically secure random number generators suitable for security-sensitive use cases like API keys, session tokens, authentication nonces, and password reset tokens.

**Q: What is the collision probability for nanoid?**
A: With the default 64-character alphabet and length 21, the total ID space is 64²¹ ≈ 1.3 × 10³⁸ — far larger than the UUID 128-bit space. With a shorter length like 8, you get 64⁸ ≈ 2.8 × 10¹⁴ possibilities, which gives a 50% collision probability only after about 10⁷ IDs (birthday problem). For most non-security applications, this is more than sufficient.

**Q: Can I generate ULIDs that are sortable like UUID v7?**
A: Yes. ULIDs (Crockford Base32, 26 characters) also embed a Unix millisecond timestamp in the first 10 characters (48 bits) and are lexicographically sortable. ULIDs are a popular alternative to UUID v7 in systems that prefer the more compact and URL-safe Base32 encoding.

**Q: What does "shortid" mode produce?**
A: Short IDs are base62 encoded (0–9, a–z, A–Z) random values, typically 6–12 characters long depending on the entropy needed. Use them when you need compact, URL-safe identifiers that are easy to copy, share, and display in constrained UI spaces.

**Q: How should I choose the right ID mode for my project?**
A: Start with UUID v4 for general-purpose use. Switch to UUID v7 or ULID if you need sortable primary keys (time-series data, event logs, insert-ordered tables). Use nanoid with a custom alphabet for human-facing IDs (coupons, invite links). Use shortid when space is at a premium (URL shorteners, tiny URLs). Use plain `uuid` format when hyphens would break your storage or parsing logic.

**Q: Can I generate IDs that look like YouTube or TikTok video IDs?**
A: Yes — use nanoid mode with the default URL-safe alphabet (`A-Za-z0-9_-`) and length 11 for YouTube-style IDs, or length 8–10 for TikTok-style IDs. These are compact, URL-safe, and collision-resistant.

**Q: Is there a limit on how many IDs I can generate per request?**
A: The `count` parameter supports 1 to 100 at a time. For larger batches, make multiple requests. Since each request is stateless and takes milliseconds, you can generate thousands of IDs in seconds by iterating.

### Related Tools

- [JSON Studio](https://apify.com/perryay/json-studio) — Format, validate, diff, and transform JSON documents
- [QR Craft](https://apify.com/perryay/qr-craft) — Generate high-quality QR codes in PNG or SVG format
- [Meta Mate](https://apify.com/perryay/meta-mate) — Extract Open Graph, Twitter Cards, and JSON-LD metadata from URLs
- [Domain Intel](https://apify.com/perryay/domain-intel) — WHOIS lookups, DNS enumeration, and SSL certificate validation

### Comparison: Which ID type should you choose?

| Use Case | Recommended Mode | Why |
|---|---|---|
| Database primary key (any) | `uuid4` | Random, universally unique, no temporal correlation |
| Database primary key (time-series) | `uuid7` or `ulid` | Time-ordered = better B-tree index performance |
| Public URL / shareable link | `nanoid` (length 8–11) | Compact, URL-safe, configurable alphabet |
| Coupon / promo code | `nanoid` (uppercase, no ambiguous chars) | Human-friendly, easy to type, collision-resistant |
| API key / secret token | `nanoid` (length 32+, full alphabet) | High entropy, cryptographically random |
| Distributed tracing | `ulid` or `uuid7` | Sortable, compact, embeds timestamp |
| Short URL token | `shortid` | Minimum characters, base62 encoding |
| Hex-only storage (no hyphens) | `uuid` | Clean 32-char hex, database-friendly |

### SEO Keywords

UUID generator, UUID v4, UUID v7, ULID generator, nanoid generator, short ID generator, base62 ID, unique ID generator, batch UUID generation, time-ordered UUID, random ID generator, API key generator, distributed system IDs, database primary key generator, Crockford Base32, URL shortener ID, coupon code generator, cryptographically random ID, UUID batch, ID generation API

# Actor input Schema

## `mode` (type: `string`):

Type of ID to generate

## `count` (type: `integer`):

Number of IDs to generate (1–10,000)

## `length` (type: `integer`):

Character length (for nanoid and shortid modes only; 1–256)

## `alphabet` (type: `string`):

Custom character set (for nanoid mode only; min 2 characters). Defaults to URL-safe A-Za-z0-9\_-

## `outputFormat` (type: `string`):

Format for ID output

## `batch` (type: `array`):

Generate multiple different ID types in a single run. Each item specifies a mode, count, length, and optional alphabet.

## Actor input object example

```json
{
  "mode": "uuid4",
  "count": 1,
  "length": 21,
  "alphabet": "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
  "outputFormat": "json",
  "batch": [
    {
      "mode": "uuid7",
      "count": 3
    },
    {
      "mode": "nanoid",
      "count": 5,
      "length": 12
    },
    {
      "mode": "ulid",
      "count": 2
    }
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

ID generation results in the default dataset

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "batch": [
        {
            "mode": "uuid7",
            "count": 3
        },
        {
            "mode": "nanoid",
            "count": 5,
            "length": 12
        },
        {
            "mode": "ulid",
            "count": 2
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("perryay/uuid-lab").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "batch": [
        {
            "mode": "uuid7",
            "count": 3,
        },
        {
            "mode": "nanoid",
            "count": 5,
            "length": 12,
        },
        {
            "mode": "ulid",
            "count": 2,
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("perryay/uuid-lab").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "batch": [
    {
      "mode": "uuid7",
      "count": 3
    },
    {
      "mode": "nanoid",
      "count": 5,
      "length": 12
    },
    {
      "mode": "ulid",
      "count": 2
    }
  ]
}' |
apify call perryay/uuid-lab --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=perryay/uuid-lab",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "UUID Lab 🔢 — UUID v4/v7, Nanoid, Short ID & ULID Generator",
        "description": "Pure-Python ID generator producing UUID v4, UUID v7 (time-ordered), nanoid (customizable length/alphabet), short base62 IDs, and Crockford Base32 ULIDs. Supports batch mode for generating multiple different ID types in a single run. Zero external dependencies.",
        "version": "1.0",
        "x-build-id": "PxEMLYJ91dtWm4Bee"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/perryay~uuid-lab/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-perryay-uuid-lab",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/perryay~uuid-lab/runs": {
            "post": {
                "operationId": "runs-sync-perryay-uuid-lab",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/perryay~uuid-lab/run-sync": {
            "post": {
                "operationId": "run-sync-perryay-uuid-lab",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "ID Mode",
                        "enum": [
                            "uuid4",
                            "uuid7",
                            "nanoid",
                            "shortid",
                            "ulid"
                        ],
                        "type": "string",
                        "description": "Type of ID to generate",
                        "default": "uuid4"
                    },
                    "count": {
                        "title": "Count",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Number of IDs to generate (1–10,000)",
                        "default": 1
                    },
                    "length": {
                        "title": "ID Length",
                        "minimum": 1,
                        "maximum": 256,
                        "type": "integer",
                        "description": "Character length (for nanoid and shortid modes only; 1–256)",
                        "default": 21
                    },
                    "alphabet": {
                        "title": "Alphabet",
                        "type": "string",
                        "description": "Custom character set (for nanoid mode only; min 2 characters). Defaults to URL-safe A-Za-z0-9_-",
                        "default": "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
                    },
                    "outputFormat": {
                        "title": "Output Format",
                        "enum": [
                            "json",
                            "csv",
                            "plain"
                        ],
                        "type": "string",
                        "description": "Format for ID output",
                        "default": "json"
                    },
                    "batch": {
                        "title": "Batch Mode",
                        "type": "array",
                        "description": "Generate multiple different ID types in a single run. Each item specifies a mode, count, length, and optional alphabet."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
