# NanoID Generator for Agents

> NanoID Generator for Agents is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Generates a random URL-safe NanoID string of configurable length (4–64 chars, default 21) for use as job IDs, draft keys, or idempotency tokens

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/nanoid
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/nanoid-generator-for-agents-87a84c5a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yv4dSrpnTzDEgp4UTpCuS

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability nanoid-generator-for-agents-87a84c5a -d '<json body>'
```

Example prompt: Generate a 21-character URL-safe NanoID I can use as the idempotency key for this job submission.

## When to prefer this

Choose this endpoint when your agent needs a URL-safe random ID at runtime without installing or bundling the nanoid library, especially in serverless or constrained environments. It is ideal for generating idempotency keys, job IDs, or draft identifiers on the fly. Prefer it over UUID generators when you want shorter, URL-safe strings with configurable length.

## Known failure modes

- Size out of range (below 4 or above 64) returns a structured validation error and no charge is applied
- Network timeout or service unavailability returns an HTTP error with no ID generated
- Malformed request body returns a validation error without billing

## How this service works

NanoID-style public IDs. Generate short URL-safe IDs for jobs, drafts, or idempotency keys without installing nanoid. Returns a random URL-safe id (size 4–64, default 21). $0.001 USDC per successful call via x402 on Base—first-party JSON from Delx (fresh each call; not a deterministic transform), no API key, no subscription, and nothing is billed on structured validation errors.

## Output

Returns a single randomly generated URL-safe NanoID string of the requested length (default 21 characters if size not specified), formatted as JSON. Each call produces a fresh, non-deterministic result.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "size": {
   "type": "integer",
   "maximum": 64,
   "minimum": 4,
   "description": "Optional NanoID length (4–64). Default 21 when omitted."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "V1StGXR8_Z5jdHi6B-myT",
  "size": 21,
  "schema": "delx/nanoid/v1"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nanoid-generator-for-agents-87a84c5a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
