loading…
Search for a command to run...
loading…
MCP server for AI agent billing. Preflight spend checks before agent runs. Post-execution usage billing via two MCP tools: preflight() and record_event().
MCP server for AI agent billing. Preflight spend checks before agent runs. Post-execution usage billing via two MCP tools: preflight() and record_event().
A preflight gate for AI agent runs. Stop runaway loops before they start.
Budget exceeded? GPU quota hit? Free tier exhausted? AgentBill blocks the run before the first token — not after the damage is done.
Works whether you're paying OpenAI per token or running your own GPU.
"The moment you're using Stripe as your safety net, you've already lost the run." — scarlett1908, r/LangChain
Python:
pip install agentbill-sdk
Node.js:
npm install agentbill
from agentbill import AgentBillClient
client = AgentBillClient(api_key="agb_your_key")
check = client.preflight(agent_id="researcher", estimated_units=10)
if not check.approved:
raise Exception(f"Blocked: {check.reason}")
# run your agent here
client.record(agent_id="researcher", units=10)
Get your API key: https://agentbill.fly.dev/register
Preflight. Before the agent runs, AgentBill checks: does this customer have enough budget? If not, block it before any compute is consumed.
Per-request ceiling. Monthly caps do not catch the bad single run. One 3-hour research loop can blow your budget before the cap triggers. AgentBill enforces a ceiling at the invocation level.
Outcome-based metering. You define what counts as a billable event. Not bytes, not seconds. The business-level action the agent performed.
1,000 preflight calls/month. No credit card required.
preflight() + record(). Two calls.| Stripe | AgentBill | |
|---|---|---|
| Preflight block | No | Yes |
| Per-request ceiling | No | Yes |
| Blocks before compute | No | Yes |
| Built for agents | No | Yes |
AgentBill ships an MCP server for native integration with Claude Code, Cursor, Windsurf, and any MCP-compatible agent host.
uvx agentbill-mcp
The MCP server exposes two tools:
preflight(agent_id, customer_id, estimated_units, ceiling) — check budget before running. Blocks if exhausted.record_event(agent_id, units, customer_id, metadata) — bill after work completes.Configure in ~/.claude/settings.json:
{
"mcpServers": {
"agentbill": {
"command": "uvx",
"args": ["agentbill-mcp"],
"env": { "AGENTBILL_API_KEY": "sk_live_..." }
}
}
}
Source: mcp/ | PyPI: agentbill-mcp
| Layer | Technology |
|---|---|
| Backend API | Node.js 20, TypeScript, Fastify |
| Deployment | Fly.io, Docker |
| Billing | Polar |
| Python SDK | agentbill-sdk on PyPI |
| Node.js SDK | agentbill on npm |
| MCP Server | agentbill-mcp on PyPI |
Prerequisites: Node.js 20+, Python 3.10+
git clone https://github.com/marketinglior-pixel/agentbill.git
cd agentbill
npm install
cp .env.example .env # fill in POLAR_API_KEY and friends
npm run dev # API listens on http://localhost:3000
Run the smoke test suite (requires the dev server running):
./test_live.sh
Contributions are welcome. See CONTRIBUTING.md for setup instructions, code style, and how to open a PR.
Looking for something to work on? Check the good first issue label.
If per-request ceilings are what you needed, star this. It helps other developers find it.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"agentbill-mcp": {
"command": "npx",
"args": []
}
}
}Payments, customers, subscriptions
автор: Stripe110+ tools for AI agents spanning social media, finance, gaming, music, AU-specific services, and utilities. Zero-config local tools plus platform connectors. n
автор: malamutemayhemUnified API hub for AI agents with 56+ tools across travel (Amadeus, Sabre), prediction markets (Polymarket), crypto, and weather. Pay-per-call via x402 micropa
автор: whiteknightonhorseDeploy live HTTPS websites in seconds. Instant subdomains ($1 USDC) or custom .xyz domains ($10 USDC) on Base chain. Templates for crypto tokens and AI agent pr
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории finance