{"uid":"cap_0BwQAavlKO6mlaCU-GRgx","slug":"bounty-engineer-agent-run-cost-audit-aa87fa77","name":"Bounty Engineer Agent Run Cost Audit","description":"Machine-buyable infrastructure for autonomous agents: API cost routing, margin optimization, funding-rate data, webpage extraction, result verification, spend controls, retry planning, state, tender search and GitHub bounty intelligence.","url":"https://bounty-engineer-x402-prod.onrender.com/v1/agent-run-cost-audit?utm_source=zero.xyz","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":["events"],"properties":{"events":{"type":"array","items":{"type":"object","required":["run_id","tool","cost_usd"],"properties":{"tool":{"type":"string"},"run_id":{"type":"string"},"status":{"type":"string"},"cost_usd":{"type":"number","minimum":0},"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"idempotency_key":{"type":"string"}}},"maxItems":250,"minItems":1},"policy":{"type":"object","properties":{"max_run_usd":{"type":"number","minimum":0}}}}},"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":["ok","mode"],"properties":{"ok":{"type":"boolean","const":true},"mode":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"ok":true,"mode":"agent-run-cost-audit","budget_usd":0.06,"event_count":2,"limitations":["Amounts, statuses and token counts are caller-supplied, not settlement-verified.","Possible duplicate charges are not independently proven waste, refunds or savings.","No invented token pricing or inferred buyer intent; no API calls are performed."],"input_sha256":"5af9246f61ffec6e14ee186d7c4f9f4898317d6710cdd6343ce834dd520761c8","failed_events":0,"repeat_groups":[{"tool":"web_extract","calls":2,"run_id":"research-1","successful":2,"idempotency_key_hash":"106e9867be80f5c8","potential_duplicate_charges_usd":0.04}],"expensive_tools":[{"tool":"web_extract","calls":2,"billed_usd":0.08,"failed_calls":0,"input_tokens":0,"output_tokens":0}],"recommendations":["Review same-run repeated idempotency keys; consider caching or idempotent deduplication.","Enforce a hard per-run budget before future buyer-authorized calls."],"charged_downstream":false,"over_caller_budget":true,"observed_billed_usd":0.08,"observed_budget_overage_usd":0.02,"repeat_idempotency_key_events":1,"potential_duplicate_charges_usd":0.04}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.035","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.035/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.035","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.035","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_szegSrMMjlTqvS4-zAEo8","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.035","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Audits a batch of agent tool-call events to identify budget overages, duplicate charges, and expensive tools, then returns optimization recommendations.","exampleAgentPrompt":"Can you audit the tool calls from my last agent run — I had 2 web_extract calls in run 'research-1' each costing $0.04, and my budget cap was $0.06 — flag any duplicates and tell me if I went over budget?","exampleUseCases":[{"title":"Detecting duplicate web extraction charges","prompt":"I think my agent called the same web extraction tool twice in run 'scrape-job-7' with the same idempotency key, each billed at $0.05. Can you audit those events and tell me if there are duplicate charges I should investigate?"},{"title":"Enforcing per-run budget compliance","prompt":"My agent run 'data-pipeline-3' logged 5 tool calls totaling $0.12, but my max allowed spend was $0.08. Audit these events and tell me which tools pushed me over budget and what I should do differently."},{"title":"Identifying most expensive tools in a session","prompt":"Here are 10 tool-call events from my agent session 'analysis-run-42' — can you analyze them and rank which tools are costing me the most so I know where to optimize?"}],"resultDescription":"Returns a structured audit report including: total observed billed USD, budget overage amount, count of failed events, groups of repeated idempotency keys flagged as potential duplicates (with duplicate charge estimate), a ranked list of expensive tools, whether the caller's budget was exceeded, a SHA-256 hash of the input for integrity, and a list of actionable recommendations. Also includes a limitations disclaimer noting amounts are caller-supplied and not settlement-verified.","failureModes":["Missing required 'events' array in body returns validation error","Empty events array (minItems:1 violated) returns schema error","cost_usd field with negative value rejected by minimum:0 constraint","Exceeding 250 events (maxItems) returns rejection","Malformed run_id or tool fields may result in incomplete grouping","Payment not included or insufficient USDC causes x402 payment required response"],"whenToPreferThis":"Use this endpoint when you need to post-process a batch of agent tool-call telemetry events to detect budget overruns, duplicate billing, and expensive tool patterns within a single agent run. Prefer it over manual log inspection when you have structured cost events with idempotency keys and want algorithmic duplicate detection plus recommendations. Not a substitute for verified settlement data — it works on caller-supplied cost figures.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T12:37:51.122Z","isFirstParty":false,"canonicalSlug":"bounty-engineer-agent-run-cost-audit-aa87fa77"}