FIFO Token Bucket Dispatch Planner
Plan FIFO not-before times from supplied continuous-refill token buckets, with exact rational balance evidence and an explicitly partial horizon prefix; no requests are sent.
workflow-assurance · Operation ID: quota-dispatch-plan
Choose this operation when
- Plan FIFO API job dispatch against supplied token bucket capacity and refill assumptions
- Return exact not-before millisecond times and rational before/after quota balances
Outside this profile
- Live quota discovery, provider conformance, request sending, retry permission or guaranteed server acceptance
- Persistent quota reservations or synchronization across workers
- Renewable resources held for execution durations or optimal job reordering
Exact release references
Static JSON contract · Markdown reference · Fixed example response
Complete input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"horizonMs": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000000
},
"buckets": {
"maxItems": 8,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"capacity": {
"type": "integer",
"minimum": 1,
"maximum": 1000000000
},
"initialTokens": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000
},
"refillTokens": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000
},
"refillPeriodMs": {
"type": "integer",
"minimum": 1,
"maximum": 1000000000
}
},
"required": [
"id",
"capacity",
"initialTokens",
"refillTokens",
"refillPeriodMs"
],
"additionalProperties": false
}
},
"jobs": {
"maxItems": 200,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"releaseMs": {
"default": 0,
"type": "integer",
"minimum": 0,
"maximum": 1000000000000
},
"costs": {
"default": {},
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"additionalProperties": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000
}
}
},
"required": [
"id"
],
"additionalProperties": false
}
}
},
"required": [
"horizonMs",
"buckets",
"jobs"
],
"additionalProperties": false
}
Complete output-envelope schema
{
"type": "object",
"required": [
"operation",
"version",
"result",
"provenance"
],
"properties": {
"operation": {
"const": "quota-dispatch-plan",
"type": "string"
},
"version": {
"const": "0.29.0",
"type": "string"
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"advisoryOnly": {
"type": "boolean",
"const": true
},
"externalRequests": {
"type": "number",
"const": 0
},
"execution": {
"type": "boolean",
"const": false
},
"availabilityVerified": {
"type": "boolean",
"const": false
},
"status": {
"type": "string",
"enum": [
"planned",
"partial",
"blocked"
]
},
"horizonMs": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000000
},
"jobs": {
"maxItems": 200,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"notBeforeMs": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000000
},
"buckets": {
"maxItems": 8,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"before": {
"type": "object",
"properties": {
"numerator": {
"type": "string",
"maxLength": 19,
"pattern": "^(?:0|[1-9]\\d*)$"
},
"denominator": {
"type": "string",
"maxLength": 10,
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"numerator",
"denominator"
],
"additionalProperties": false
},
"after": {
"type": "object",
"properties": {
"numerator": {
"type": "string",
"maxLength": 19,
"pattern": "^(?:0|[1-9]\\d*)$"
},
"denominator": {
"type": "string",
"maxLength": 10,
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"numerator",
"denominator"
],
"additionalProperties": false
}
},
"required": [
"id",
"before",
"after"
],
"additionalProperties": false
}
}
},
"required": [
"id",
"notBeforeMs",
"buckets"
],
"additionalProperties": false
}
},
"unplannedIds": {
"maxItems": 200,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 100
}
},
"nextNotBeforeMs": {
"anyOf": [
{
"type": "string",
"maxLength": 19,
"pattern": "^(?:0|[1-9]\\d*)$"
},
{
"type": "null"
}
]
},
"blockedJobId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 100
},
{
"type": "null"
}
]
},
"blockedReason": {
"anyOf": [
{
"type": "string",
"const": "zero-refill-exhausted"
},
{
"type": "null"
}
]
},
"finalState": {
"type": "object",
"properties": {
"atMs": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000000
},
"buckets": {
"maxItems": 8,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"tokens": {
"type": "object",
"properties": {
"numerator": {
"type": "string",
"maxLength": 19,
"pattern": "^(?:0|[1-9]\\d*)$"
},
"denominator": {
"type": "string",
"maxLength": 10,
"pattern": "^[1-9]\\d*$"
}
},
"required": [
"numerator",
"denominator"
],
"additionalProperties": false
}
},
"required": [
"id",
"tokens"
],
"additionalProperties": false
}
}
},
"required": [
"atMs",
"buckets"
],
"additionalProperties": false
}
},
"required": [
"advisoryOnly",
"externalRequests",
"execution",
"availabilityVerified",
"status",
"horizonMs",
"jobs",
"unplannedIds",
"nextNotBeforeMs",
"blockedJobId",
"blockedReason",
"finalState"
],
"additionalProperties": false
},
"provenance": {
"type": "object",
"required": [
"inputSha256",
"outputSha256",
"deterministic",
"externalRequests"
],
"properties": {
"inputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"outputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"deterministic": {
"const": true
},
"externalRequests": {
"const": 0
}
}
}
},
"additionalProperties": false
}
Fixed example
One accepted fixed example, not a custom-input trial. No operation runs when this static page is requested.
Example input
{
"horizonMs": 5000,
"buckets": [
{
"id": "api",
"capacity": 4,
"initialTokens": 4,
"refillTokens": 1,
"refillPeriodMs": 1000
}
],
"jobs": [
{
"id": "a",
"releaseMs": 0,
"costs": {
"api": 3
}
},
{
"id": "b",
"releaseMs": 0,
"costs": {
"api": 3
}
},
{
"id": "c",
"releaseMs": 0,
"costs": {
"api": 1
}
}
]
}
Example response
{
"operation": "quota-dispatch-plan",
"version": "0.29.0",
"result": {
"advisoryOnly": true,
"externalRequests": 0,
"execution": false,
"availabilityVerified": false,
"status": "planned",
"horizonMs": 5000,
"jobs": [
{
"id": "a",
"notBeforeMs": 0,
"buckets": [
{
"id": "api",
"before": {
"numerator": "4",
"denominator": "1"
},
"after": {
"numerator": "1",
"denominator": "1"
}
}
]
},
{
"id": "b",
"notBeforeMs": 2000,
"buckets": [
{
"id": "api",
"before": {
"numerator": "3",
"denominator": "1"
},
"after": {
"numerator": "0",
"denominator": "1"
}
}
]
},
{
"id": "c",
"notBeforeMs": 3000,
"buckets": [
{
"id": "api",
"before": {
"numerator": "1",
"denominator": "1"
},
"after": {
"numerator": "0",
"denominator": "1"
}
}
]
}
],
"unplannedIds": [],
"nextNotBeforeMs": null,
"blockedJobId": null,
"blockedReason": null,
"finalState": {
"atMs": 3000,
"buckets": [
{
"id": "api",
"tokens": {
"numerator": "0",
"denominator": "1"
}
}
]
}
},
"provenance": {
"inputSha256": "38b1cb2bd534f97f7e12eaaedc096de9e2f396892167f446d070db83ef6e6a9a",
"outputSha256": "e31439c612a93e1f88c98ad92992588a1e636b8ec4122bd8f3245d61086b264b",
"deterministic": true,
"externalRequests": 0
}
}
Bounds and precision
JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.
{
"global": {
"requestBytes": 131072,
"responseBytes": 524288,
"jsonDepth": 32,
"jsonNodes": 20000,
"requestsPerMinute": 60,
"paidAttemptsPerMinute": 20,
"idempotencyHours": 24
},
"operation": {
"inputBytes": 100000,
"outputBytes": 400000,
"jsonNodes": 12000,
"depth": 20,
"tasks": 64,
"resources": 8,
"dependencyEdges": 256,
"resourceUnits": 1000000000,
"duration": 1000000000,
"release": 1000000000000,
"scheduleTime": 1064000000000,
"usageSegments": 128,
"buckets": 8,
"jobs": 200,
"tokenUnits": 1000000000,
"refillPeriodMs": 1000000000,
"horizonMs": 1000000000000
}
}
Complete schemas, descriptions and cross-field validation may impose additional limits.
Proposed price and protocol definitions
{
"unit": "one successful operation call",
"proposedNominalUsd": "0.005",
"sixDecimalTokenBaseUnits": "5000",
"subscription": false,
"includesPayerWalletOrNetworkFees": false,
"liveQuoteVerified": false,
"condition": "Actual SDK challenge is authoritative only within the caller's explicit authorization; configured six-decimal token peg is an operator assertion, not a conversion guarantee."
}
Protocol definitions: x402, mpp. MPP uses Tempo charge. Paid MCP execution is unsupported. All runtime readiness is not evaluated in this build.
API path templates, not endpoints on this documentation host
{
"x402": "/v1/x402/quota-dispatch-plan",
"mpp": "/v1/mpp/quota-dispatch-plan"
}
Required headers
{
"Content-Type": "application/json",
"Idempotency-Key": "random 16–128 character operation identifier"
}
Actual SDK challenge amount, asset, network, recipient and wallet costs must pass independent authorization. Preserve identical key, body, protocol and credential on retries; on PAYMENT_UNCERTAIN stop and reconcile.
Execution profile and provider conditions
{
"deterministic": true,
"externalRequests": 0,
"maxExternalRequests": 0,
"resultSnapshotPersisted": false,
"fixedExampleIsIllustrativeSnapshot": false,
"requiresPayment": true,
"supportsMcpExecution": false
}
Deterministic supplied-input operation with no external requests or stored request/result bodies. Payment infrastructure retains payment metadata and hashes.
Failure handling
- HTTP 400: Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch Correct the request before payment
- HTTP 402: Payment challenge or rejected payment Use official protocol SDK; inspect payment outcome before another payment
- HTTP 409: Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay
- HTTP 413: Input or generated output too large Reduce input; no payment attempted for validation failure
- HTTP 415: Unsupported media type or compression Send uncompressed application/json
- HTTP 422: Schema or service-specific semantic validation failure Correct input using returned error code; no payment attempted
- HTTP 429: Request/payment-attempt rate exceeded Wait for rate limit window; preserve existing payment identity
- HTTP 503: Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation
Declared requirements
Before any paid call, refresh the live operation contract and POST the complete bounded budgeted plan to the separate API's /preflight. Unknown requirements block selection; compatible preflight is not permission to spend.