Credits & usage

GET /v1/credits

Your current wallet state.

curl https://api.infra.models/v1/credits \
  -H "Authorization: Bearer im_live_..."

Response:

{
  "object": "credit_balance",
  "balance_credits": "25000000",
  "locked_credits": "0",
  "available_credits": "25000000",
  "balance_usd": 25
}

GET /v1/usage

Aggregate usage for the current calendar month (UTC).

{
  "object": "usage",
  "period": { "start": "2026-05-01T00:00:00Z", "end": "2026-05-18T..." },
  "requests": 412,
  "input_tokens": 124000,
  "output_tokens": 38000,
  "total_tokens": 162000,
  "credits_charged": "2480000"
}

How credits are charged

  1. On request: we estimate the cost from input tokens + your max_tokens and reserve estimate × 1.1 from your wallet's available balance.
  2. During the call: locked credits keep you from accidentally over-spending if you fire many concurrent requests.
  3. After the call: we read the provider's actual token usage, charge that amount, and release the reservation.
  4. Every charge writes a row to credit_ledger. The ledger is append-only and we publish reconciliation alerts if the wallet ever drifts from SUM(ledger).

Credit unit

1,000,000 credits = $1 USD. We use integer credits everywhere — no floating-point money math.