Monotonic id blocks: the next invoice or ticket numbers for a fleet of agents

$0.005 USDC per call · Agent infrastructure · POST /api/v1/id-block · Id id-block

Hands out strictly increasing integer blocks from a named sequence (1-1000 ids per call) so parallel agents never issue the same invoice, ticket or order number. Numbers are never reused. Not gapless: a block an agent reserves and never uses stays a gap, and if your call's payment fails after the block is written the same requestId returns that same block on retry. Legally gapless series must be assigned by your system of record.

What you get

A duplicated invoice number is an audit finding; one $0.005 call reserves up to 1000 numbers.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/id-block. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/id-block \
  -H 'content-type: application/json' \
  -d '{"op":"next","sequence":"invoice:2026","count":10,"requestId":"billing-run-2026-11-04"}'

Input

FieldTypeRequiredDescription
opstring; one of "next", "peek"yes
sequencestringyesSequence name, e.g. invoice:2026.
countinteger; 1..1000noIds to reserve; default 1.
startinteger; 0..9007199254740990noFirst id of a new sequence; ignored once it exists. Default 1.
tenantIdstringnoRequired for API-key callers (namespaced as key:<tenantId>; keep it unguessable). Ignored when a wallet paid: the payer address is the tenant.
requestIdstringnoCaller-chosen id for this mutation. A retry with the same id and same input returns the stored response (24 h) instead of applying twice; the same id with different input is rejected. Send one on every mutation you may retry: without it a retry is applied again (fleet-memory record appends a duplicate; a repeated spend-ledger commit or release answers NO_HOLD because the first call already took effect).

Example request body

{
  "op": "next",
  "sequence": "invoice:2026",
  "count": 10,
  "requestId": "billing-run-2026-11-04"
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
opstringno
firstone ofnoFirst id of your block (null for peek).
lastone ofno
nextAvailableintegerno
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the agent-coordination-kit package.

Machine-readable