A lot of teams using Claude Code's experimental Code Mode are running into the same architectural friction: once an agent switches from serial MCP tool calls to writing parallel JavaScript fetch() scripts, an MCP-only tool setup stops helping.
If your script needs to fan out a multi-engine web search, extract clean markdown from 10 URLs with Promise.all(), transcribe a 15-minute call, and summarize the output, you are right back to:
- Managing 4–5 separate vendor API keys and monthly subscriptions (
$19–$99/mogates before you even run a batch). - Handling silent Cloudflare/WAF HTTP
200 OKchallenge pages that burn scraping credits while returning empty boilerplate. - Hoping a parallel
Promise.all()burst doesn't blow through your budget because there is no shared dollar cap across providers.
We built Helve to work natively over both Streamable HTTP MCP (https://helve.dev/mcp) and plain REST fetch() (https://helve.dev/v1/tools/call) behind one sk_live_ key, one prepaid USD balance ($0/mo subscription, $0.50 free starter credit, non-expiring $10/$25/$100 packs), and 313 live tools across 255 providers (291 public $0.00 tools + 22 metered commercial tools).
One Key for Both Code Mode (fetch) and MCP
In a Code Mode script, you don't need an SDK or five different auth headers—just POST https://helve.dev/v1/tools/call with your HELVE_API_KEY:
async function callHelve(tool_id, argumentsObj) {
const res = await fetch("https://helve.dev/v1/tools/call", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.HELVE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ tool_id, arguments: argumentsObj }),
});
if (res.status === 402) {
// Agent-native 402 JSON includes topup_url, balance_usd, packs_usd
const err = await res.json();
throw new Error(`Spend/balance cap reached: ${JSON.stringify(err)}`);
}
return res.json();
}
// Fan out a multi-engine consensus search, then extract the top URLs
const search = await callHelve("helve.web_search", {
query: "AI agent payment protocols 2026 comparison",
provider: "fusion",
max_results: 8,
});
const topUrls = search.data.results.slice(0, 3).map((r) => r.url);
const extracted = await callHelve("helve.web_extract", {
urls: topUrls,
max_chars: 8000,
});
And if the same agent (or Claude Code / Cursor) wants to discover tools dynamically over MCP, the exact same key and balance work on https://helve.dev/mcp via search_tools + call_tool.
Concrete Cent-Priced Skill Recipes (SKILL.md Included)
Instead of guessing opaque "credit" conversions, every Helve response returns exact usage.cost_usd. We packaged three high-frequency paid workflows as live recipes—each with a machine-readable SKILL.md you can drop straight into an agent:
| Workflow | Tools Used | Typical Cost |
$0.50 Starter Credit |
Live Recipe & SKILL.md
|
|---|---|---|---|---|
| Deep Research Brief |
helve.web_search (fusion, ~$0.014) + helve.web_extract (top 3 URLs, ~$0.006) + cohere.chat ($0.000) |
~$0.02 / brief |
~25 briefs | helve.dev/skills/deep-research |
| Batch Crawl & Extract (10 URLs) |
helve.web_extract (provider: "auto", multi-provider fallback) |
~$0.05 / 10 URLs |
~100 pages | helve.dev/skills/batch-crawl |
| Audio Brief (15-min recording) |
POST /v1/transcriptions (~$0.075) + openrouter.chat (gpt-4o-mini, ~$0.005) |
~$0.08 / 15 min |
~6 briefs | helve.dev/skills/audio-brief |
Every $10 prepaid pack (no monthly subscription, credits never expire) buys roughly 500 deep-research briefs, 2,000 extracted pages, or 125 15-minute audio briefs—plus unlimited access to 291 $0.00 public/dev/finance tools (SEC EDGAR, GitHub, arXiv, PubMed, CoinGecko, Shodan InternetDB, NVD CVE).
Three Guardrails Built for Parallel Agent Scripts
Running parallel fetch() batches exposes three failure modes that rarely show up in single-call demos:
-
Atomic pre-flight
spend_limit_usdholds: Before forwarding to an upstream provider, Helve reserves an estimated hold atomically in Postgres (WHERE spend_limit_usd IS NULL OR spent_usd + hold <= spend_limit_usd), settles to exactusage.cost_usdonce the provider responds, and releases the hold ($0.00) on failure. ParallelPromise.all()bursts cannot silently race past a key's dollar cap. -
Empty / WAF-blocked HTTP 200-OK guard (
$0.00billed): When a target site returns a Cloudflare/CAPTCHA challenge with HTTP200 OK,helve.web_extractdetects the blocked/empty body, automatically falls back across healthy extract providers (exa->tavily->parallel->firecrawl), and charges$0.00for blocked or failed attempts. -
Agent-native HTTP
402JSON: Whether you hit a key'sspend_limit_usdor exhaust your balance, both REST and MCP return structured HTTP402JSON (topup_url,balance_usd,packs_usd) so the script halts cleanly instead of retrying into a timeout loop.
If you are comparing agent tool gateways for Code Mode or MCP, we also keep live side-by-side breakdowns up to date at helve.dev/compare/firecrawl and helve.dev/compare/treg.
Curious how others are wiring paid APIs into Claude Code's Code Mode scripts—are you calling REST directly from generated JS, bridging back into MCP, or running a local proxy for key scoping?
Top comments (0)