Agent Billing and 402s for AI Agents
LetsPing lets your agent see when it is out of quota and gives it a safe way to fund more usage. You keep control of pricing and Stripe, the agent just follows the contract.
Free tiers and 402 responses per agent
Each agent has per month limits such as signed_calls_limit_per_month. When a call exceeds this quota, ingest returns HTTP 402 to the agent instead of silently failing. The 402 body includes a machine readable billing block so your agent can decide what to do next.
HTTP/1.1 402 Payment Required
Content-Type: application/json
{
"error": "signed_calls_limit_per_month_exceeded",
"billing": {
"metric": "signed_calls",
"funding_url": "https://letsping.co/api/agents/billing/fund"
}
}Your agent can treat 402 as a signal to either back off, prompt a human, or call the funding endpoint.
Funding usage with POST /api/agents/billing/fund
POST /api/agents/billing/fund lets an agent add credits to an organization's account for a specific metric. Behind the scenes LetsPing charges the Stripe customer and only then increments credits. The agent never sees your Stripe keys.
curl -X POST https://letsping.co/api/agents/billing/fund \
-H "Authorization: Bearer PROJECT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"metric": "signed_calls",
"units": 1000
}'You set the price per unit in configuration. Agents only see the metric and the units field.
What your agent gets from agent billing
- Clear feedback when it is out of quota instead of opaque failures
- A standard place to resolve 402 responses without owning Stripe keys
- A way to respect free tiers while still moving work forward