{"uid":"cap_-Jx4ODyrHJW7c604pm2u9","slug":"writerslogic-quota-reservation-check-4105d8ee","name":"WritersLogic Quota Reservation Check","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/quota-reservation-check?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"asOf":{"type":"string","maxLength":40,"description":"RFC 3339 instant of the decision (no clock is read)."},"quota":{"type":"object","required":["limit","used"],"properties":{"used":{"type":"integer","maximum":9007199254740991,"minimum":0},"limit":{"type":"integer","maximum":9007199254740991,"minimum":0},"reserved":{"type":"integer","maximum":9007199254740991,"minimum":0,"description":"Amount already reserved and counted outside `pending`."},"windowEndsAt":{"type":"string","maxLength":40,"description":"RFC 3339 end of the quota window the snapshot belongs to."}},"additionalProperties":false},"pending":{"type":"array","items":{"type":"object","required":["id","amount"],"properties":{"id":{"type":"string","maxLength":200,"minLength":1},"amount":{"type":"integer","maximum":9007199254740991,"minimum":0},"expiresAt":{"type":"string","maxLength":40,"description":"RFC 3339; a reservation expiring at or before asOf no longer holds quota. Omit for a hold that does not expire."}},"additionalProperties":false},"maxItems":200},"request":{"type":"object","required":["amount"],"properties":{"amount":{"type":"integer","maximum":9007199254740991,"minimum":0}},"additionalProperties":false},"snapshotAt":{"type":"string","maxLength":40,"description":"RFC 3339 instant the quota numbers were read."},"maxSnapshotAgeSeconds":{"type":"integer","maximum":31536000,"minimum":0}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ojf06vWtsv5c7VEY9CPF-","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes available quota from a caller-supplied snapshot and determines whether a requested amount fits, without actually reserving any quota","exampleAgentPrompt":"My quota window ends at 2024-12-01T00:00:00Z, the limit is 10000, I've used 7200, reserved 500, and I have two pending reservations — ID 'res-1' for 300 expiring at 2024-11-30T12:00:00Z and ID 'res-2' for 400 with no expiry — can a new request for 400 units fit as of right now (2024-11-30T10:00:00Z), assuming the snapshot was taken at 2024-11-30T09:55:00Z and can be at most 600 seconds old?","exampleUseCases":[{"title":"Pre-dispatch token budget check","prompt":"Before I send this batch job, I need to know if 1500 tokens fit within my remaining quota — the limit is 20000, I've used 16000, reserved 1000, and I have one pending reservation 'hold-7' for 800 that expires at 2024-11-30T18:00:00Z. The snapshot was taken at 2024-11-30T17:50:00Z and I'm deciding as of 2024-11-30T17:55:00Z with a max snapshot age of 300 seconds and the window ends at 2024-11-30T23:59:59Z."},{"title":"Stale snapshot staleness guard","prompt":"I have a quota snapshot from 2 minutes ago — limit 5000, used 3800, no reserved, no pending — and I want to request 500 units as of now (2024-11-30T15:00:00Z). The window ends at 2024-11-30T16:00:00Z. Can you check if the snapshot is fresh enough (max age 60 seconds) and whether 500 units would fit?"},{"title":"Expired window detection","prompt":"My quota window ended at 2024-11-30T14:00:00Z but I'm evaluating this as of 2024-11-30T14:05:00Z — limit was 1000, used 400, no pending reservations. I want to know if requesting 200 units gives a pass, fail, or unknown result given the window has closed."}],"resultDescription":"Returns a decision (pass, fail, or unknown) indicating whether the requested amount fits within available quota, along with the computed available quota (limit minus used, reserved, and unexpired pending reservations), the reason for the result (e.g. stale snapshot, expired window, insufficient quota), and an explicit notice that nothing is reserved by this call so concurrent consumers may still consume quota before the caller acts.","failureModes":["Snapshot older than maxSnapshotAgeSeconds returns 'unknown' rather than pass or fail","Window that ended at or before asOf returns 'unknown' even if quota numerically fits","Missing required quota.limit or quota.used fields causes a validation error","Invalid RFC 3339 timestamps in asOf, snapshotAt, windowEndsAt, or pending expiresAt cause rejection","Pending array exceeding 200 items is rejected","Integer values exceeding Number.MAX_SAFE_INTEGER are rejected","Race conditions: a 'pass' result does not guarantee quota is available when the caller later acts, as this endpoint performs no actual reservation"],"whenToPreferThis":"Use this endpoint when you need a lightweight, stateless check of whether a requested quota amount fits within a caller-supplied snapshot — particularly in distributed or multi-agent systems where you hold your own quota state and want to validate headroom before attempting a real reservation elsewhere. It is ideal for pre-flight checks before expensive operations, staleness guards on cached quota snapshots, and expired-window detection. Do not use it as an actual rate limiter or reservation system — use a token-bucket coordination service for that. Prefer this over building your own quota arithmetic when you need consistent handling of pending reservation expiry, snapshot age validation, and window boundary edge cases.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T12:37:05.045Z","isFirstParty":false,"canonicalSlug":"writerslogic-quota-reservation-check-4105d8ee"}