{"uid":"cap_atWwJMUwtbLPb03ZUihpV","slug":"maha-strategies-context-budget-ladder-e1e397b9","name":"Maha Strategies Context Budget Ladder","description":"Choose a context budget before an agent run. Compare five extractive compilation budgets with token estimates and source coverage. Price basis: five compiler runs, the comparison table and the receipt digest. Uses caller-supplied documents; no answer generation, factual verification or guaranteed token-billing savings.","url":"https://www.mahastrategies.com/api/v1/context/budget-ladder","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["clientRequestId","task","tokenBudgets","documents"],"properties":{"task":{"type":"string","maxLength":1200,"minLength":8},"scoring":{"enum":["bm25","keyword"],"type":"string"},"documents":{"type":"array","maxItems":8,"minItems":1},"budgetMode":{"enum":["guaranteed","estimated"],"type":"string"},"provenance":{"enum":["full","compact","none"],"type":"string"},"tokenBudgets":{"type":"array","maxItems":5,"minItems":1},"clientRequestId":{"type":"string","maxLength":120,"minLength":8}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["version","offerId","clientRequestId","inputDigest","economicBasis","runs","comparison","boundaries","sourceTextStored","compiledContextStored","receiptDigest"],"properties":{"runs":{"type":"array","maxItems":5,"minItems":1},"offerId":{"type":"string","const":"context-budget-ladder"},"version":{"type":"string","const":"0.1"},"boundaries":{"type":"array"},"comparison":{"type":"array","maxItems":5,"minItems":1},"inputDigest":{"type":"string"},"economicBasis":{"type":"object"},"receiptDigest":{"type":"string"},"clientRequestId":{"type":"string"},"sourceTextStored":{"type":"boolean","const":false},"compiledContextStored":{"type":"boolean","const":false}},"additionalProperties":false}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.012","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.012/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.012","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.012","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_-PghX5dgFCmau19y1TiR8","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.012","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compiles the same set of documents at five ascending token budgets and returns five extractive context packs with a comparison table, stable hashes, and a receipt digest.","exampleAgentPrompt":"Take these three research PDFs I uploaded and compile them at five ascending token budgets — say 500, 1000, 2000, 4000, and 8000 tokens — using BM25 scoring with full provenance, so I can compare how much content survives at each level. Use request ID 'proj-alpha-20240601' and task description 'summarize key findings on climate adaptation strategies'.","exampleUseCases":[{"title":"RAG compression tier selection","prompt":"I have five articles I want to use as RAG context, but I'm not sure what token budget to use. Can you compile them at 500, 1000, 2000, 4000, and 8000 tokens using keyword scoring so I can see the comparison table and pick the right tier? Task is 'extract main arguments on urban planning policy', request ID 'rag-urban-001'."},{"title":"Document retention audit for legal review","prompt":"I need to audit how much of these four legal briefs gets retained as I compress them — run a budget ladder at 800, 1600, 3200, 6400, and 12800 tokens with full provenance and guaranteed budget mode, task description 'identify key contractual obligations', client request ID 'legal-audit-2024'."},{"title":"Comparing summaries at different lengths","prompt":"I want to see extractive summaries of these two whitepapers at five progressively larger token budgets — 256, 512, 1024, 2048, and 4096 — using BM25 scoring, so I can show stakeholders the tradeoff between brevity and completeness. Task is 'summarize AI governance recommendations', request ID 'whitepaper-compare-07'."}],"resultDescription":"Returns five extractive context packs (one per token budget), each with source-linked content. Also returns a compact comparison table across all five runs, token boundary markers, a stable input digest, a receipt digest for auditability, and economic basis metadata. Neither the source text nor the compiled contexts are stored server-side.","failureModes":["Missing required fields (clientRequestId, task, tokenBudgets, documents) returns a 400 validation error","More than 8 documents or more than 5 token budgets in the arrays causes a schema validation failure","Token budgets not supplied in ascending order may produce unexpected comparison results","Documents that are too large or malformed may cause extraction errors","Payment failure via x402 protocol results in a 402 response and no compilation is performed","Non-unique or too-short clientRequestId (under 8 chars) returns a validation error"],"whenToPreferThis":"Choose this endpoint when you need to systematically compare how document content changes across multiple token budgets in a single deterministic call, rather than calling a single-budget compiler multiple times. It is ideal for calibrating RAG pipelines, auditing compression fidelity, or presenting stakeholders with a side-by-side retention comparison. Prefer this over the single-budget endpoint when the optimal token budget is unknown and you want a structured comparison table returned atomically with stable hashes for reproducibility.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:36:45.038Z","isFirstParty":false}