x402AgentTools

๐Ÿ†”UUID Generator / Validator

Generate cryptographically random UUIDv4s or time-sortable UUIDv7s from a real CSPRNG, and validate any UUID's format, version and variant bits.

Worked examples

Generate v4

GET /api/v1/dev/uuid?op=generate&version=v4

Result: 8235bcc1-704d-495c-9343-69754c603130

Generate v7 (sortable)

GET /api/v1/dev/uuid?op=generate&version=v7

Result: 01a12cf9-ecec-7083-b533-49b701140faa

Validate a UUID

GET /api/v1/dev/uuid?op=validate&value=123e4567-e89b-42d3-a456-426614174000

Result: โœ“ Valid UUID (version 4, RFC 9562/4122)

Machine API (x402)

$0.002 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol โ€” no accounts, no API keys.

GET /api/v1/dev/uuid?op=generate&version=v4 HTTP/1.1
Host: localhost:3000

โ†’ 402 (payment required, instructions in headers)
โ†’ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "dev/uuid",
  "input": {"op":"generate","version":"v4"},
  "result": { "value": null, "answer": "f5a19abc-95e1-4e7e-b332-9f3ce26cd725" }
}

Agent docs: /llms.txt ยท OpenAPI spec ยท integration guide

About this tool

Identifiers from a real CSPRNG: v4 for pure randomness, v7 when IDs should sort by creation time (databases, distributed logs). Validation checks structure, version nibble and RFC variant bits โ€” not just a regex.

Frequently asked questions

v4 or v7?

v4 when randomness should leak nothing; v7 when IDs double as sort keys โ€” it embeds the millisecond timestamp, making B-tree inserts sequential.

Are generated UUIDs unique?

v4 has 122 random bits โ€” collision odds are negligible for any realistic volume. v7 uniqueness rests on the timestamp plus 74 random bits.

Related tools