Would this request fit in the remaining quota, given a snapshot and pending reservations? (snapshot-bound)

$0.005 USDC per call · Agent infrastructure · POST /api/v1/quota-reservation-check · Id quota-reservation-check

Computes available quota from a caller-supplied snapshot (limit, used, reserved) minus the unexpired pending reservations and says whether a requested amount fits. This is a read of the numbers you supply as of snapshotAt: it reserves nothing, so concurrent consumers can still use the quota before you do, and every response says so. A stale snapshot gives unknown, not pass; a window that ended at or before asOf gives unknown even when the request does not fit, because the numbers belong to the previous window. Does not query any provider and is not a rate limiter (use the coordination token-bucket for reservations).

What you get

Avoids starting a job that cannot finish for lack of quota, without claiming a guarantee it cannot give.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/quota-reservation-check. 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/quota-reservation-check \
  -H 'content-type: application/json' \
  -d '{"quota":{"limit":1000,"used":700,"reserved":50},"pending":[{"id":"job-1","amount":100}],"request":{"amount":120},"snapshotAt":"2026-11-04T12:00:00Z","asOf":"2026-11-04T12:00:20Z","maxSnapshotAgeSeconds":60}'

Input

FieldTypeRequiredDescription
quotaobjectyes
pendingarray<object>; max 200 itemsno
requestobjectyes
snapshotAtstring; length 0..40yesRFC 3339 instant the quota numbers were read.
asOfstring; length 0..40yesRFC 3339 instant of the decision (no clock is read).
maxSnapshotAgeSecondsinteger; 0..31536000no

Example request body

{
  "quota": {
    "limit": 1000,
    "used": 700,
    "reserved": 50
  },
  "pending": [
    {
      "id": "job-1",
      "amount": 100
    }
  ],
  "request": {
    "amount": 120
  },
  "snapshotAt": "2026-11-04T12:00:00Z",
  "asOf": "2026-11-04T12:00:20Z",
  "maxSnapshotAgeSeconds": 60
}

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.
availableintegernolimit - used - reserved - held pending; may be negative if oversubscribed.
heldintegernoSum of unexpired pending reservations.
shortfallintegernoHow much the request exceeds available; 0 when it fits.
snapshotBoundbooleannoAlways true: nothing is reserved.
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 execution-safety-kit package.

Machine-readable