NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

Cuid Generator API

GET

Create sortable, collision-resistant IDs for distributed data.

Cuid Generator creates collision-resistant unique identifiers (CUIDs) on demand for distributed applications. Pass an optional count to receive an array of unique ID strings, with paid plans adding structural format and sortability details.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/cuidgenerator
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "cuids": [
      "cmj95ed27000000145v116use",
      "cmj95ed2700010014uuounuyc",
      "cmj95ed27000200147pwbz35y",
      "cmj95ed27000300142h9ivqrz",
      "cmj95ed27000400149ingh73n",
      "cmj95ed2700050014mg9alsah",
      "cmj95ed27000600149utx0fy3",
      "cmj95ed270007001467kspfhp",
      "cmj95ed2700080014n7ykgwxf",
      "cmj95ed2700090014rrnfehcn"
    ],
    "count": 10,
    "format": "c + timestamp + counter + fingerprint + random",
    "collision_resistant": true,
    "sortable": true
  }
}

About the Cuid Generator API

Cuid Generator creates CUIDs, collision-resistant unique identifiers designed for distributed applications where several servers create IDs at the same time. Ask for one ID or a batch of up to 100 and get them back as an array of strings, each starting with the letter c and safe to use in URLs, file names and database keys.

A CUID starts with a timestamp for sorting, so IDs generated later generally sort after earlier ones, which keeps database indexes and logs in rough creation order. Teams use them as primary keys, client-side record IDs before a sync, and request or job identifiers, and as a shorter alternative to a UUID when they want a sortable id.

The Free plan returns the IDs and the count. Paid plans add a description of the CUID component layout and flags stating that the IDs are collision resistant and sortable, which helps when the response is logged or shown to someone checking which unique identifier format a system uses.

How it works

Each ID follows the original CUID layout, built from five parts concatenated in order: the letter c; the current time in milliseconds written in base 36; a four-character base-36 counter; a four-character fingerprint; and two four-character random blocks.

The counter increments for every ID the serving instance creates and wraps back to zero after 36^4 values, so IDs made in the same millisecond on the same instance still differ. The fingerprint is derived from the server process ID and the length of its hostname, which separates IDs made by different instances at the same moment. The random blocks come from the JavaScript runtime's standard random number generator, which is not a cryptographic source: treat CUIDs as unique identifiers, not as secrets or unguessable tokens. Use a password or token generator for those.

Because the timestamp comes first and is the same length for any current date, IDs sort roughly by creation time. Ordering within the same millisecond is reliable only for IDs from the same instance, since separate instances keep separate counters.

count sets how many IDs are returned, from 1 to 100, defaulting to 1, and cuids holds them in generation order. format, collision_resistant and sortable are fixed descriptive values that are the same on every response; they are null on the Free plan.

What people use it for

Distributed Databases
Generate safe unique keys across distributed database systems and shards
Horizontal Scaling
Create identifiers that work reliably across horizontally scaled applications
Event Sourcing
Generate sortable event identifiers for event sourcing and CQRS patterns
Multi-tenant Systems
Create unique identifiers across multiple tenants and isolated environments

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Cuid Generator

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Cuid Generator API.

Read the docs →
How many CUID generation requests does the Free plan cover?
The Free plan covers 200 requests each month. Because each call costs 1 credit, your 200 monthly free credits cover 200 calls. If you need more volume, the Starter plan covers up to 200,000 calls per month, which works out to about $0.15 per 1,000 calls.
Are format details and sortability flags included on the Free plan?
The Free plan provides limited access to metadata. Basic responses return the generated identifier strings and the count, while metadata fields describing component format, collision resistance guarantees, and sortability require a paid plan.
Can I generate multiple CUIDs in a single call?
Yes. You can use the count parameter to specify the exact number of identifiers you need in one request. The endpoint returns the generated CUIDs in a single response array.
What components ensure the generated CUIDs do not collide?
Each identifier combines four separate components: a timestamp for sorting, a counter for same-millisecond generation, a process fingerprint for distributed systems, and random data for collision resistance.
Are the generated CUIDs sortable in distributed databases?
Yes. Because each identifier includes a timestamp component, CUIDs are naturally sortable. This makes them optimized for sequential lookup performance, event sourcing, and horizontal scaling across distributed systems.

Ready to build with Cuid Generator? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs