Billing & Credits

Prepaid credits, the 3% top-up fee, usage at provider cost, cache pricing, budget caps, and cost visibility per response.

Xantly billing is prepaid and usage-based. There are no subscriptions, tiers, or seats: you top up a credit balance, and every request draws it down at the exact price the upstream provider charges. Optional budget caps let you bound spend per month.


How pricing works

WhatPrice
Top-upAny amount from $5 to $10,000, plus a 3% platform fee charged upfront (pay $103, receive $100 in credits)
Routed usageExact provider cost, the same per-token price the provider charges, no markup
Cache and memory hitsFlat $0.25 per million tokens served, on every cache layer, instead of the provider price

The 3% top-up fee is the only platform fee on routed usage. It is shown transparently at checkout before you pay. $100 of credits buys exactly $100 of provider usage.


Credit balance

All usage is drawn from your organization's prepaid credit balance:

Auto-recharge

Optionally, set a balance threshold and a recharge amount in the dashboard. When your balance drops below the threshold, Xantly automatically tops up your chosen amount using your saved card, with the same 3% fee applied. Auto-recharge is off unless you enable it, and you can turn it off at any time.


Monthly budget limits

In addition to the credit balance, you can set a monthly spend cap in USD from the dashboard:

Budget typeApplies to
monthly_budget_usdAll requests (general)
voice_monthly_budget_usdVoice API requests (/v1/voice/*)
maker_monthly_budget_usdReliability/maker API requests

If a category budget is not set, the general monthly_budget_usd applies as a fallback. If no budget is set at all, only your credit balance bounds spend. Budget caps are a safety net, not a fee: they simply stop requests once the cap is reached.


402 Payment Required

When your credit balance is exhausted, or a request would exceed a monthly budget cap, the gateway returns 402 Payment Required:

{
  "error": {
    "message": "Credit balance exhausted. Add credits to continue.",
    "type": "billing_error",
    "code": "insufficient_credits",
    "top_up_url": "https://app.xantly.com/dashboard/billing",
    "suggested_amounts": [10, 25, 50, 100]
  }
}
FieldDescription
error.code"insufficient_credits" for an exhausted balance; "budget_cap_reached" for an organization monthly spend cap; "api_key_budget_exceeded" for a per-key cap
error.top_up_urlDashboard URL to add credits
error.suggested_amountsSuggested top-up amounts in USD (you can top up any amount from $5 to $10,000)

Soft-limit warning headers

When you approach a configured monthly budget cap (90% or more used), responses include warning headers:

HeaderValueDescription
x-budget-warninge.g. "94%"Percentage of your budget cap consumed this month
x-budget-remaininge.g. "3000"Remaining headroom before the cap

Use these headers in production to alert your team or trigger a top-up before requests start failing.

response = httpx.post("https://api.xantly.com/v1/chat/completions", ...)

warning = response.headers.get("x-budget-warning")
remaining = response.headers.get("x-budget-remaining")

if warning:
    print(f"Warning: {warning} of budget used, {remaining} remaining")

Cost visibility per response

Every response includes cost fields in xantly_metadata:

FieldDescription
cost_usdActual cost for this request in USD (provider price for routed calls, $0.25/1M for cache hits)
baseline_cost_usdWhat the same request would cost on a fixed frontier-model baseline
savings_usdCost saved vs. that baseline
savings_pctSavings as a percentage of baseline
cost_attribution"xantly" (platform keys) or "byok" (your own API key)

Best practices

  1. Set a monthly budget cap in the dashboard as a safety net against runaway usage.
  2. Enable auto-recharge if uptime matters: your balance refills before requests start failing.
  3. Monitor x-budget-warning headers in production, add alerting at 80% so you can act before the cap.
  4. Enable caching (xantly.enable_cache: true, default): cache hits are billed at a flat $0.25 per million tokens instead of the provider price.
  5. Use BYOK for provider-billed workloads: routing through your own API keys means the provider bills you directly and your Xantly credits are not consumed.

Next steps