Prepaid credits: how usage-based billing works here
thelastapi uses prepaid credits drawn at the exact moment of each billable call, backed by daily safety caps to protect against runaway spend.
On this page 7 sections
Every billable event on thelastapi draws against a prepaid credit balance the moment it is recorded, with no surprise monthly invoices or retroactive charges. You fund an account balance by card, and every AI token, email, web scrape, database day, and company filing subtracts from those credits at its stated unit cost. New accounts start with $2 of trial credit so you can test endpoints, run migrations, and deploy without adding card details first.
This model gives builders complete control over project spend. You never receive a runaway cloud bill at the end of the month, and your running services do not get wiped out if a balance dips below zero. Here is how prepaid billing works across every service in the stack, how safety caps protect you from looping code, and how to configure balances from your terminal or console.
What prepaid credits cover across your app
Instead of paying separate subscriptions for databases, AI gateways, web scraping, and hosting, one key for your whole app meters every tool against a single balance.
When an API call executes, the engine calculates the cost and deducts it from your balance immediately:
- AI models: Metered per prompt and completion token across every lab. Chat completions, embeddings, image generation, audio transcription, and video clips draw from credits as each request finishes.
- Web data and actions: Scrapes, site crawls, web searches, and SEO lookups deduct credit per action run.
- Email: App emails and newsletter broadcasts deduct from credits. Broadcasts hold their estimated fee (recipients multiplied by $0.001) upfront when scheduled, and charge each batch as it sends.
- Phone calls and texts: SMS messages and voice agent calls draw against credits. Two-way AI phone calls hold credits up to your configured
max-minutesceiling (up to 15 minutes) and settle the exact duration once the call ends. - Company filings and domains: Buying a custom domain or submitting a US company formation can be funded directly out of your credit balance.
- Databases: Running serverless Postgres databases are billed by the day against your balance.
Because every service works on its own, you can use just one service from an app hosted anywhere while funding only the tools you need.
Checking your balance and usage
You can monitor balance levels, spending history, and upcoming holds in the console at thelastapi.dev/billing or right from your terminal with the CLI.
Run vibiz billing to see your current credit balance, payment card status, and recharge rules:
vibiz billingThis returns your account status and available balance:
{
"object": "billing",
"mode": "credits",
"balance_cents": 1834,
"status": "active",
"auto_recharge": { "enabled": true, "threshold_cents": 500, "amount_cents": 2500 },
"daily_spend_limit_usd": 5,
"console_url": "https://thelastapi.dev/billing"
}To see daily usage totals and understand exactly where credits went, inspect your billing history:
vibiz billing history --kind usageIf you need granular attribution, the usage command breaks down spend across multiple dimensions:
vibiz usage --period 7d --by model
vibiz usage --period month --by project
vibiz usage --by api_keyWhen building a product with multiple end users, passing an identifier through the SDK (vibiz.user(session.userId)) tags each action with an X-Vibiz-User header. You can then run vibiz usage --by end_user to inspect individual customer consumption. For more details on balance payloads, visit the Billing and credits guide.
Adding credits and setting auto-recharge
You can top up credits manually whenever you want, or automate the process so production systems never pause.
To top up manually, owners can open Billing ▸ Add credits in the console. Presets are available for $10, $25, $50, and $100, or you can specify any amount between $5 and $1,000. You pay on a hosted card checkout page, and receipts are emailed automatically.
You can also generate top-up links directly from the CLI:
vibiz billing top-up 25This command outputs a secure checkout link where a person can enter card details. The same flow is available over HTTP:
curl -X POST https://thelastapi.dev/v1/billing/checkout \
-H "Authorization: Bearer $VIBIZ_API_KEY" \
-H "content-type: application/json" \
-d '{"amount_cents": 2500}'Configuring auto-recharge
Auto-recharge charges your saved card when the balance drops below a set threshold.
| Setting | Minimum | Maximum | Purpose |
|---|---|---|---|
| Threshold | $5.00 | Custom | Balance point that triggers a recharge |
| Recharge Amount | $10.00 | $1,000.00 | Sum charged to the card on each trigger |
Turn auto-recharge on from your terminal using a full-access key:
vibiz billing auto-recharge on --threshold 5 --amount 25If a card charge fails, the owner receives an email notification, and the system attempts the transaction again one hour later. If two consecutive recharge attempts fail, auto-recharge disables itself.
How safety caps prevent runaway bills
To prevent an infinite loop or a misconfigured agent from draining your account, thelastapi enforces strict daily spend ceilings that operate independently of your balance.
- Account Daily Safety Cap: All accounts default to a $5 daily spend limit on AI and actions per UTC day. Calls stop once $5 is spent within a single day. Owners can adjust this ceiling up to $1,000 in Billing or via the CLI:Terminal
vibiz billing limit 50 - Project AI Daily Budget: Each project starts with a default daily AI limit of $1. If one project hits a traffic spike, other projects remain unaffected. Change this with:Terminal
vibiz ai budget 10 --project prj_123
When a request exceeds a safety cap, the platform refuses the call with an HTTP 429 rate_limited status:
{
"error": {
"code": "rate_limited",
"message": "Daily spend limit reached.",
"details": {
"reason": "daily_spend",
"raise_url": "https://thelastapi.dev/billing?edit=daily_spend_limit"
}
}
}Limit alerts notify you before caps are breached. Account owners receive an email at 80% and 100% of any cap, with links pointing directly to the setting required to raise it. This setup gives you the cheapest stack for a side project in 2026 without exposing your card to surprise costs.
What happens when credits run out
When an account credit balance drops to zero or below, the account transitions through distinct operational stages:
active: All paid operations run normally.low: Balance is below $1. The console displays a warning banner, and the owner receives one email.payment_required: Balance reaches $0 or lower. Paid endpoints return an HTTP402 payment_requirederror.past_due: Balance remains at or below $0 for 7 consecutive days. Deploys, new projects, and new resources pause.
Requests are also rejected proactively if a call's worst-case cost (such as an AI call's max_tokens at list price) could pull your account more than $0.50 below zero.
Running infrastructure is never deleted
Critically, existing sites, databases, sign-in flows, and analytics tags are never stopped or deleted because credits ran out. Your deployed website remains online, visitors can still log in, and incoming web analytics continue to record.
Free services keep working even at a $0 balance:
- Calling Google AI models using your own Google API key.
- Making connector calls.
- Read operations and dashboard usage checks.
- Loading environment variables in
@vibiz/app.
Paid calls return clear error instructions:
{
"error": {
"code": "payment_required",
"message": "This account is out of credits. Add credits to keep using paid calls.",
"details": {
"reason": "insufficient_balance",
"balance_cents": 0,
"console_url": "https://thelastapi.dev/billing",
"top_up_url": "https://thelastapi.dev/billing?top_up=1"
}
}
}How agents interact with billing
If you use AI coding tools like Claude Code, Cursor, or Codex, you can grant them access to build your application using a Limited API key.
Limited keys can inspect balances and monitor usage via vibiz billing and vibiz usage. Safety rules ensure agents cannot access stored card numbers, configure auto-recharge, raise safety caps, or execute live refunds.
When an agent needs credits to finish a task, it generates a checkout URL (vibiz billing top-up <amount>) and shares it in the chat. You click the link, complete the card payment in your browser, and the agent resumes working.
Check your current credit balance and daily safety caps with vibiz billing, or review the Billing and credits reference before launching your next application.
Frequently asked questions
Do my running sites or databases get deleted if my credit balance hits zero?
No. Running sites, databases, user authentication, and web analytics are never paused or deleted due to an empty balance; only new paid calls answer with an error until credits are added.
How does auto-recharge protect against repeated card decline fees?
If a card charge fails, auto-recharge sends an email notification and retries once after one hour. If the second attempt fails, auto-recharge disables itself automatically.
What is the difference between my credit balance and the daily safety cap?
Your balance is the total amount of prepaid money available to spend, while the daily safety cap is a ceiling (defaulting to $5 per day) that limits how much AI and action spend can occur in a single UTC day regardless of balance size.
Can an AI agent or Limited key change my billing settings?
No. Limited keys can view credit balances and create checkout links for humans to pay, but changing daily limits, updating auto-recharge rules, or adding payment cards requires owner permissions.