add_credits returns a Stripe checkout_url right in the conversation.
Browsing is free — connect and ask questions without a balance. Your first paid action can unlock $0.50 starter balance with a quick phone verify, and NinjaChat subscribers get $1.00 of MCP allowance every month. The allowance is granted lazily — the first time a charge would otherwise fail, or when
get_account_balance is called — to accounts on a paid plan (a mobile plan must still be active).Prices
Model prices are the providers’ own rates, passed through unchanged. NinjaChat’s margin is a single 8% service fee added when you fund credits — $25 of credit costs $27 at checkout — never a markup hidden inside a model’s price.
Multiply by
n for multi-output calls.
Every video model has its own duration curve. Per-second models (
seedance-lite, seedance-pro, seedance-2, runway-gen4.5) bill each second up to their cap; bucketed models (Veo, Kling) bill the nearest supported length — 7 seconds on veo-3.1-fast costs the 6-second price, 8 seconds on kling-video the 10-second price. Any duration from 4 to 15 is accepted, but seconds past a model’s cap are billed at the cap. estimate_cost is free and returns the exact price before anything runs — pass duration for video.
Money is safe by design
Hard budgets
max_spend_cents (1–2000) on any call, total_budget_cents (5–100) on bakeoffs — tools return budget_too_low instead of exceeding them, before any money moves.Automatic refunds
Image and bakeoff failures refund inline. A video job that fails after being charged is refunded when polled — and a server-side sweeper checks every minute even if nobody polls. You never pay for output you didn’t get.
Safe retries
Pass an
idempotency_key — the same key + body never double-bills.Monthly limit
Set an account cap in Developers → Billing — the OAuth consent screen also sets one the first time an agent connects. It’s reserved before deduction — an over-limit call never touches your balance.
What a charge actually does
Every billed call runs the same sequence: idempotency claim →max_spend_cents gate → account monthly-limit reserve → per-key budget reserve → deduct → generate → settle against the model that actually ran → store the response for replay. If generation fails, the refund lands before the error tells you that you weren’t charged, and every reservation is released in reverse order.
- Settlement is exact.
automay reroute to another model when a provider fails; the charge is adjusted to that model’s price, andcost.charged_centsin the response is what you actually paid. - Two spend caps.
spend_limit_exceededis the account cap from Developers → Billing.key_budget_exceededis a per-key monthly budget (Developers → Keys → Manage) that applies to API-key callers and covers everything the key does, REST and MCP alike. Both errors return the limit and this month’s spend; neither touches your balance. - Empty balance.
insufficient_creditsreturnsbalance_cents,estimated_cost_centsandtop_up_url. The fix isadd_credits, then retry.
Idempotency
- Keys are scoped to your account and bound to a hash of the billable inputs (prompt, model, count, aspect ratio, references, duration…). They live for 1 hour.
- Same key, same body → the stored response is replayed, images re-rendered inline, nothing charged.
- Same key, different body →
idempotency_conflict. Use a fresh key for new content. - Same key while the first attempt is still running →
generation_pendingwithretry_after_seconds: 10. - A failed generation releases the key, so a retry with the same key runs (and is charged) once more.
- If the idempotency store is unreachable the call fails closed with
idempotency_unavailable— no work is started, nothing is charged; retry in a few seconds with the same key.
Refunds
Video jobs carry the exact settled charge, so an async refund always returns what was actually paid.
get_generation_status on a refunded job keeps reporting the failure — a refunded job never later serves a video.
Topping up
add_creditsmints a Stripe Checkout link for a $25 (default), $100 or $250 pack — the agent pastescheckout_url, the user pays, the agent retries. The Billing page is the fallback and also takes custom whole-dollar amounts.- Auto-reload is opt-in and only ever switched on from the Billing page — buying a pack never enables it. Once on, it defaults to adding $100 when the balance falls below $10 (both adjustable).
- Every purchase carries the 8% service fee:
add_creditswithamount_usd: 25charges $27 and credits $25.
Rate limits
Counted per API key — or, for OAuth clients, per client + user — so one busy agent can’t starve another. Per minute unless noted:
Limited calls return
rate_limited with retry_after_seconds — agents wait and retry.