Resumable Budget-Capped Batch Enrichment With Deterministic resume_token
Running a 50,000-row enrichment job without a hard dollar brake is nerve-wracking — especially when triggered by an autonomous AI agent. Batch-Anything enforces both per-row max_cost_micros and whole-batch max_budget_usd ceilings, pausing gracefully with a signed resume_token and zero duplicate charges upon resume.
Why Unbounded Enrichment Jobs Create Surprise Invoices
Many cloud enrichment and agent APIs rely on post-hoc accounting: by the time a usage counter notices your batch exceeded budget, hundreds of concurrent in-flight requests have already settled and driven your account negative.
Worse, when a batch stops halfway through due to credit exhaustion or a timeout, restarting from row 1 forces you either to write custom checkpoint diffs manually or pay twice for the first half of the CSV.
Pre-Commit Budget Accounting & Exact-Row Checkpointing
Two-Layer Spend Guardrails
Set both per-row max_cost_micros (preventing expensive waterfall fallback jumps on a single row) and whole-batch max_budget_usd (hard total job ceiling).
Graceful Mid-Batch Pause With Durable resume_token
The instant remaining budget cannot cover the next verified row, the executor commits completed rows, preserves full exportability, and emits a deterministic resume_token.
Zero-Duplicate Continuation via POST /v1/batch/{job_id}/resume
Pass the resume_token alongside an updated max_budget_usd to process strictly the remaining unprocessed rows. Loop 3 Gauntlet verified 100% completion and 0 duplicate charges across pause/resume cycles.
Ideal for Human-in-the-Loop & Agent Spend Approvals
Agents can test the first $1.00 of a 25,000-row CSV, inspect yield and dead_letter_count, and resume the full batch only after confirming ROI.
Mid-Batch Budget Control & Recovery Comparison
Competitor pricing figures reflect documented public tiers; Batch-Anything performance metrics reflect real measured Gauntlet telemetry (16/16 checks passing).
| Control Mechanism | Batch-Anything | Typical Cloud Enrichment API | DIY Script |
|---|---|---|---|
| Hard Whole-Batch Dollar Cap | Native max_budget_usd enforced pre-commit | Workspace balance only / post-hoc overage | Must engineer atomic ledger |
| Per-Row Waterfall Cost Cap | Native max_cost_micros | Rarely configurable per call | Custom routing logic |
| Mid-Run Resume Token | Built-in signed resume_token + /resume endpoint | Re-upload remaining slice manually | Custom checkpoint files |
| Duplicate Charge Guarantee | Strictly 0 duplicate charges verified in Gauntlet | Risk of re-billing already enriched rows | Crash-window double spend |
| Partial Output Export | Immediately downloadable even while paused | Often locked until run completes | Depends on flush discipline |
Working REST & Streamable /mcp Code Examples
REST API (POST /v1/batch/run & /v1/batch/submit)
# 1. Run with hard budget cap (pauses cleanly with resume_token)
curl -fsSL -X POST "https://batch.fastmesh.dev/v1/batch/submit" \
-H "Content-Type: application/json" \
-d '{"workflow": "b2b_domain_enrich", "tenant_id": "acme_revops", "rows": [{"domain": "stripe.com", "company_name": "Stripe"}, {"domain": "linear.app", "company_name": "Linear"}, {"domain": "nonexistent-dead-domain-99999.invalid", "company_name": "Dead Row Test"}], "max_budget_usd": 0.01}'
# 2. Resume strictly unprocessed rows (0 duplicate charges)
curl -fsSL -X POST "https://batch.fastmesh.dev/v1/batch/{job_id}/resume" \
-H "Content-Type: application/json" \
-d '{"resume_token": "<token_from_status>", "max_budget_usd": 5.0}'
Native AI Agent Call (POST /mcp · JSON-RPC 2.0)
# Streamable HTTP MCP JSON-RPC 2.0 call (https://batch.fastmesh.dev/mcp)
curl -fsSL -X POST "https://batch.fastmesh.dev/mcp" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "batch_submit_job", "arguments": {"workflow": "b2b_domain_enrich", "tenant_id": "coding_agent_01", "rows": [{"domain": "stripe.com", "company_name": "Stripe"}, {"domain": "linear.app", "company_name": "Linear"}], "max_budget_usd": 1.0}}}'
Full schema: /openapi.json · Agent onboarding: /skill.md · Machine directory: /llms.txt · Treg Hub: batch-anything-waterfall (0% commission) · Causal Bazaar: batch_anything_waterfall_v1
Zero-Empty Guarantee, Privacy & Never-Expiring Packs
$0.00 and isolated in dead_letter_rows with a verifiable receipt_sha256.Zero Customer Table Resale Pledge: Your uploaded CSVs, SQLite tables, prompts, BYOK keys, and batch traces are NEVER resold, licensed, or used to train external models.
Starter Pack
$19 credit (19M micros · 6,333 B2B domains / 12,666 URL checks) · Never expires · 0 seat fees
Get Starter PackGrowth Pack
$90 credit (90M micros · 30,000 B2B domains / 60,000 URL checks) · Never expires · 0 seat fees
Get Growth PackScale Pack
$325 credit (325M micros · 108,333 B2B domains / 216,666 URL checks) · Never expires · 0 seat fees
Get Scale PackFrequently Asked Questions
How do I cap spend on a large Batch-Anything job?
Include max_budget_usd (e.g., 2.50) and optional per-row max_cost_micros in your POST /v1/batch/run, POST /v1/batch/submit, or MCP batch_submit_job request.
How does resuming with resume_token guarantee zero duplicate charges?
Batch-Anything persists per-row completion state in SQLite WAL before issuing resume_token. Calling POST /v1/batch/{job_id}/resume skips every completed row deterministically and processes strictly unprocessed indices.
Can I export the partial rows enriched before a budget pause?
Yes. Even when a job is in paused_budget state, GET /v1/batch/{job_id}/export immediately streams all rows completed so far alongside dead_letter_rows.
Do AI agents support resume_token over MCP?
Yes. Our native MCP server exposes batch_job_status (which returns resume_token) and batch_resume_job so coding agents can enforce strict staged spend policies.