x402-job-budgets

x402-job-budgets is a skill for Claude Code, Codex from domondi1/inferrail. It costs 90 tokens per session (742 once invoked), scanned A, original, Apache-2.0.

A payment budget for AI jobs that use x402, a system for paying for online APIs with cryptocurrency. It gives the whole job a spending limit and can reserve smaller limits for sub-agents, which are helper agents working on parts of the job.

In plain words
What is it for?
Use it when agents or sub-agents pay for APIs, data, or other agents through x402, including when several paid requests run at the same time.
Why use it?
It stops one job or helper agent from spending more than its assigned amount. Payments that exceed the available limit are refused before they are signed or sent.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; positional $N argument.

Good fit Use it when agents or sub-agents pay for APIs, data, or other agents through x402, including when several paid requests run at the same time.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/domondi1/inferrail/agent_economy
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add domondi1/inferrail --skill agent_economy
Clone the repo
git clone --depth 1 https://github.com/domondi1/inferrail

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for x402-job-budgets

README.md
[![agentmods](https://agentmods.dev/badge/skills/domondi1/inferrail/agent_economy/github.svg)](https://agentmods.dev/skills/domondi1/inferrail/agent_economy)
Your own site
<a href="https://agentmods.dev/skills/domondi1/inferrail/agent_economy"><img src="https://agentmods.dev/badge/skills/domondi1/inferrail/agent_economy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for x402-job-budgets

Your own site · 80×15
<a href="https://agentmods.dev/skills/domondi1/inferrail/agent_economy"><img src="https://agentmods.dev/badge/skills/domondi1/inferrail/agent_economy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 742 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00090 $0.00742
Opus 5.5 $0.00036 $0.00297
Sonnet 5.5 $0.00018 $0.00148
Haiku 4.5 $0.00009 $0.00074

Measured 4d ago against content hash db09f8762829, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

x402-job-budgets scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 11 executable files (agent.py, authority.py, demo.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

examples/agent_economy/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Job budgets for agents that pay (x402)

Use this when the work you are doing, or the sub-agents you start, will pay over x402 and you need to stay inside a budget that belongs to the job, not to the whole wallet.

What it gives you:

  • One budget for the job. Every payment draws from it.
  • A bounded share for each sub-agent, carved out of the job's budget. A sub-agent can't spend a sibling's share, even when they run at the same time.
  • Refusal before signing when a payment doesn't fit. Nothing is sent and you get the remaining amount in the error.
  • Revoking one sub-agent stops its new payments; its unspent share returns to the job.

Status: experimental reference code, in memory, one process. The demo uses a simulated chain; there is no mainnet support. Keep the payer key in the process that runs this, and give sub-agents budget refs, not the client.

TypeScript (existing @x402/core or @x402/fetch client)

Copy typescript/hierarchical-budget-provider.ts and typescript/x402-job-budget.ts into the project, then:

import { HierarchicalBudgetProvider } from "./hierarchical-budget-provider.ts";
import { withJobBudgets } from "./x402-job-budget.ts";

const provider = new HierarchicalBudgetProvider();
const budgets = withJobBudgets(client, provider);   // client: your x402Client
const paidFetch = wrapFetchWithPayment(fetch, client);

provider.open("job-42", 5_000_000n);                 // $5.00 USDC (6 decimals)
const child = provider.delegate("job-42", "researcher", 1_000_000n);
if (!child.ok) throw new Error(`not enough budget: ${child.remainingAtomic} left`);

await budgets.run(child.childRef, () => researcher(paidFetch));

Check what's left before planning more paid calls:

provider.status("job-42");   // { limit, consumed, reserved, delegated, remaining, revoked }
provider.remaining(child.childRef);

When a payment is refused, the error message contains insufficient_budget, revoked, or no job budget is active. Don't retry the same payment; report the remaining budget, pick a cheaper option, or ask whoever owns the job for more.

Read the full file on GitHub · 73 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 73 lines · 90 tokens per session scan A db09f8762829

Subscribe to this mod's changes

x402-job-budgets is a skill published in the GitHub repository domondi1/inferrail (1 stars, last pushed today), licensed Apache-2.0. It adds 90 tokens to every session and 742 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-08.