Distributed unique name & serial service

Unique names & serials, on demand

A lightweight HTTP service for generating atomically incrementing serial numbers and unique human-readable names across distributed systems. Create a resource, share its slug, and let every client pull the next value without conflicts.

What is uniq.rs?

Atomic increments

Every call to a counter is serialised in PostgreSQL — no duplicates, ever.

🌐

Globally shared

Multiple services or hosts can pull from the same counter over plain HTTP.

🔑

Slug-based access

Each counter gets a UUID slug. Share it only with the clients that need it.

💪

Stateless clients

No SDK, no library — a plain curl is all you need.

📝

Word-list names

Generate unique readable names from custom word lists via the Lists API.

🆕

Code names

Produce adjective–noun code names from built-in curated word lists.

API Reference — Serials

POST /serials Create a new counter

Creates a new serial counter initialised at 0. The response is a 307 redirect to the counter's canonical URL, which contains its UUID slug.

$ curl -iX POST https://uniq.rs/serials

HTTP/2 307
location: /serials/4b3c2a1d-…
Extract the slug
$ curl -sX POST https://uniq.rs/serials -o /dev/null \
    -w "%{redirect_url}\n"

https://uniq.rs/serials/4b3c2a1d-8f9e-4a2b-b1c0-123456789abc
POST /serials/{slug} Get next value

Atomically increments the counter identified by {slug} and returns the new value as JSON. Repeated calls always yield strictly increasing, unique integers.

$ curl -sX POST https://uniq.rs/serials/4b3c2a1d-8f9e-4a2b-b1c0-123456789abc

{"value":1}

$ curl -sX POST https://uniq.rs/serials/4b3c2a1d-8f9e-4a2b-b1c0-123456789abc

{"value":2}

API Reference — Lists

Generate unique human-readable names by computing the Cartesian product of one or more input word lists. Each call atomically advances an internal counter, guaranteeing globally unique names even under concurrent load.

POST /lists Create a name list

Creates a new list resource. Provide one or more non-empty string arrays in lists; an optional separator (default "-") is inserted between elements and before the integer cycle suffix. Returns a 307 redirect to the new resource.

$ curl -sX POST https://uniq.rs/lists \
    -H 'Content-Type: application/json' \
    -d '{"lists":[["red","blue"],["fox","dog"]]}' \
    -o /dev/null -w "%{redirect_url}\n"

https://uniq.rs/lists/a3f1c2d4-58cc-4372-a567-0e02b2c3d479
POST /lists/{slug} Get next unique name

Atomically advances the sequence counter and returns the next unique name derived from the Cartesian product of the stored lists. After all base combinations are exhausted an integer cycle suffix is appended.

$ SLUG=a3f1c2d4-58cc-4372-a567-0e02b2c3d479
$ curl -sX POST "https://uniq.rs/lists/$SLUG"
{"name":"red-fox"}
$ curl -sX POST "https://uniq.rs/lists/$SLUG"
{"name":"red-dog"}
$ curl -sX POST "https://uniq.rs/lists/$SLUG"
{"name":"blue-fox"}
$ curl -sX POST "https://uniq.rs/lists/$SLUG"
{"name":"blue-dog"}
# After all 4 combinations: cycle suffix is appended
$ curl -sX POST "https://uniq.rs/lists/$SLUG"
{"name":"red-fox-1"}

API Reference — Codenames

Generate human-readable code names in adjective + noun form using curated built-in word lists. Choose a noun category and the service pairs it with the shared adjective list, shuffling both independently so each resource produces a unique sequence.

Noun categories

animals (25) · islands (20) · celestial (30) · mythology (35) · lakes (20) · poets (30) · musicians (26) · philosophers (32)

POST /codenames Create a codename resource

Creates a new codename resource backed by a shuffled adjective list and a shuffled noun list. The nouns field is required and must be one of the recognised category names. Returns a 307 redirect to the new resource.

$ curl -sX POST https://uniq.rs/codenames \
    -H 'Content-Type: application/json' \
    -d '{"nouns":"animals"}' \
    -o /dev/null -w "%{redirect_url}\n"

https://uniq.rs/codenames/c1f2e3d4-aaaa-bbbb-cccc-0e02b2c3d479
POST /codenames/{slug} Get next code name

Atomically advances the sequence and returns the next unique code name. For animals there are 29 × 25 = 725 unique base names before a cycle suffix is appended.

$ SLUG=c1f2e3d4-aaaa-bbbb-cccc-0e02b2c3d479
$ curl -sX POST "https://uniq.rs/codenames/$SLUG"
{"name":"bold-bear"}
$ curl -sX POST "https://uniq.rs/codenames/$SLUG"
{"name":"bold-boar"}
# … (725 unique base names for animals)
$ curl -sX POST "https://uniq.rs/codenames/$SLUG"
{"name":"bold-bear-1"}

Quick Start — Serials

1 — Create a counter

Run this once to provision a new counter and capture the slug.

$ SLUG=$(curl -sX POST https://uniq.rs/serials -o /dev/null \
    -w "%{redirect_url}" | grep -o '[^/]*$')
$ echo $SLUG
4b3c2a1d-8f9e-4a2b-b1c0-123456789abc

2 — Pull the next serial

Call from any host that has the slug. Values are guaranteed unique.

$ curl -sX POST "https://uniq.rs/serials/$SLUG"
{"value":1}

Quick Start — Codenames

1 — Create a codename resource

Choose a noun category; both adjective and noun lists are shuffled randomly.

$ SLUG=$(curl -sX POST https://uniq.rs/codenames \
    -H 'Content-Type: application/json' \
    -d '{"nouns":"animals"}' \
    -o /dev/null -w "%{redirect_url}" | grep -o '[^/]*$')
$ echo $SLUG
c1f2e3d4-aaaa-bbbb-cccc-0e02b2c3d479

2 — Pull the next code name

Each call yields a unique adjective–noun pair from the shuffled lists.

$ curl -sX POST "https://uniq.rs/codenames/$SLUG"
{"name":"bold-bear"}

Error Codes

404 — Not Found

The provided slug does not match any counter. Check that the UUID is correct.

500 — Internal Server Error

An unexpected condition occurred. Retry with exponential back-off.