{"uid":"cap_oTh4T6DoQbm4oi2faKghe","slug":"delx-token-budget-split-40437360","name":"Delx Token Budget Split","description":"Split a model token budget into system, output reserve, and available input — call when reserving system and output tokens from a context window. Use for SRE/ops math agents buy from broad utility catalogs: SLA, error budget, success rate, and health scores with zero upstream cost. Returns deterministic machine-readable JSON for $0.003 USDC via x402 on Base. Execution is first-party, local-only, stateless, and memory-only with no paid upstream, no input retention, and no claim of live chain tip…","url":"https://api.delx.ai/api/v1/x402/token-budget-split","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"total_tokens":{"type":"number","description":"Model context window size in tokens."},"system_tokens":{"type":"number","description":"Tokens already reserved for system/instructions."},"reserved_output_tokens":{"type":"number","description":"Tokens reserved for model output."}}},"responseSchema":{"type":"json","example":{"schema":"delx/util-token-budget-split/v1","feasible":true,"total_tokens":8000,"system_tokens":500,"available_input_tokens":6500,"reserved_output_tokens":1000}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_IdfNUiKpJJQWf10vMABkl","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Splits a model's total context window token budget into system-reserved, output-reserved, and available input token counts","exampleAgentPrompt":"Split a 128,000-token context window for me — I've reserved 2,000 tokens for the system prompt and 4,096 tokens for model output; how many tokens are left for user input?","exampleUseCases":[{"title":"Prompt engineer token headroom check","prompt":"I'm building a prompt for a 32,768-token model. My system instructions take up 1,500 tokens and I want to reserve 2,048 tokens for the output — how many tokens do I have left for the actual user message?"},{"title":"LLM agent context window planning","prompt":"My AI agent uses a 128k context window. I need 4,000 tokens for the system prompt and 8,192 for the response. Can you tell me exactly how many tokens are available for the conversation history and input?"},{"title":"Ops agent dynamic budget allocation","prompt":"Before I send a batch of documents to the model, calculate my token budget: the context window is 16,384 tokens, system prompt uses 800 tokens, and I'm reserving 1,024 tokens for output. What's the max input size I can use?"}],"resultDescription":"A deterministic JSON object showing the breakdown of the token budget: the system token allocation, the reserved output token count, and the remaining available input tokens calculated as total minus system minus reserved output.","failureModes":["Missing required fields (total_tokens, system_tokens, or reserved_output_tokens) result in a validation error","If system_tokens plus reserved_output_tokens exceeds total_tokens, the available input tokens will be zero or negative — the API may return an error or a zero/negative value","Payment failure or insufficient USDC balance via x402 protocol results in a 402 response before computation","Non-numeric or malformed token values result in schema validation errors"],"whenToPreferThis":"Use this endpoint when you need a fast, deterministic, zero-dependency computation to partition a model's context window into its three standard buckets (system, output reserve, available input). Prefer it over manual math in agent code when you want a machine-readable JSON result that can be passed directly to downstream prompt-construction logic. It is especially useful in SRE/ops agents and prompt-engineering pipelines where consistent token budget accounting is needed across many calls at near-zero cost.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:55:10.235Z","isFirstParty":false}