Tag

credits

7 posts tagged "credits".

Editorial Guide

Credit Reserve & Settle: Deterministic Pre-Execution Billing

Traditional post-paid billing models in generative AI expose enterprises to catastrophic financial risk: asynchronous agent swarms or runaway batch jobs can rack up enormous provider bills before invoices arrive. The credit reserve-and-settle pattern enforces deterministic pre-execution financial accounting, reserving necessary funds under database locks before requests egress to providers and settling exact usage post-stream.

Key Engineering Challenges

Negative Balance Incurrence in High-Throughput Fleets

Post-paid systems allow concurrent requests to outpace balance checks, plunging customer accounts into negative balances and creating bad-debt liabilities for platform operators.

Race Conditions Under High Concurrency Inferences

Dozens of parallel requests checking balance simultaneously can all pass balance validation before any of them write deduction records, resulting in significant overspends.

Paying for Refused and Blocked Inferences

Charging customer credits before running guardrails or provider inference penalizes users for prompt injections, upstream provider 500 errors, or connection drops.

Complex Multi-Modality Pricing and Envelope Calculations

Calculating reserves across mixed workloads (text tokens, vision resolutions, audio duration, and video frames) requires sophisticated pre-flight envelope estimation.

Architecture Taxonomy & Core Components

Postgres Advisory Locks

Serializes credit balance checks and holds under row-level security without database deadlocks.

Preflight Phase 4 Reserve

Calculates worst-case token envelope hold only after all security guardrails pass in Phase 3.

Post-Stream Exact Settlement

Releases unused held credits and settles exact token spend at upstream provider list price.

nRouter Two-Tier Credit Reserve & Settle Architecture

nRouter guarantees absolute credit safety through its two-tier reserve-and-settle architecture. During Preflight Phase 4—executing strictly after guardrails pass—the gateway calls an in-transaction Postgres reservation function under advisory locks to place a hold corresponding to the request's maximum output ceiling. Following successful provider response streaming, nRouter accurately calculates exact token consumption and settles the transaction at the provider's list price, releasing any remaining hold back to the organization balance. If an inference fails or is blocked, exactly $0 is settled.

Review our deep-dive on the reserve-and-settle pattern to learn how nRouter prevents negative balances and guarantees $0 spend on blocked requests.

Posts

Latest first

Read an LLM Credit Ledger: Top-Ups, Holds, Settlements
Guides

Read an LLM Credit Ledger: Top-Ups, Holds, Settlements

Your balance is not a stored number, it is the sum of a ledger. Here is how to read the four numbers on the balance card, the entry types behind them, and the two identities that prove your balance is doing what it should.

nRouter team
11 minRead →
Gateway Credits vs Prepaid Tokens: How the Balance Works
Guides

Gateway Credits vs Prepaid Tokens: How the Balance Works

Prepaid tokens are one provider's currency, priced against one rate card. Gateway credits are dollars that fund any model behind one key. Here is how to consolidate, read the balance card, and prove each call settled at real cost.

nRouter team
10 minRead →
Auto Top-Up Without Surprise Bills: Threshold, Amount, Cap
Guides

Auto Top-Up Without Surprise Bills: Threshold, Amount, Cap

Auto top-up keeps your balance from hitting zero mid-traffic, but on its own it removes the only thing that stops a runaway. Here is the three-number configuration — threshold, top-up amount, and a Block-mode budget — that makes it safe.

nRouter team
10 minRead →
Credits, Budgets, Rate Limits, Guardrails: Four Pre-Flight Gates
Guides

Credits, Budgets, Rate Limits, Guardrails: Four Pre-Flight Gates

Every request through an LLM gateway clears four independent gates before a provider ever sees it — credit balance, budget cap, RPM/TPM rate limit, and guardrails. Each has its own status code, its own scope, and its own fix.

nRouter team
11 minRead →
Reserve-and-Settle: Never Overspend a Credit Balance
Engineering

Reserve-and-Settle: Never Overspend a Credit Balance

Checking a balance and then calling a provider is a race, and under the fan-out an LLM gateway is built for it loses. Here is the reserve, settle and release contract as you can observe it — what your balance does on success, on an upstream failure, on a timeout, and when the cost is never knowable.

nRouter team
12 minRead →
Pay as you go or a subscription: which LLM gateway plan is cheaper?
Pricing

Pay as you go or a subscription: which LLM gateway plan is cheaper?

Every nRouter plan pays the same 4% platform fee on credits, so a subscription never lowers the fee. What Starter, Pro and Max buy is a monthly nrouter/auto usage allowance and higher rate limits — worth it only for traffic you are happy to let nRouter route.

nRouter team
13 minRead →
One Authoritative Cost Per LLM Request, Across Providers
Engineering

One Authoritative Cost Per LLM Request, Across Providers

Provider pricing does not normalize on its own — per-token, per-image, per-second, provisioned. Here is how nRouter turns that into one settled cost per request that your app, your ledger and your dashboard all read, and why an unknown cost is reported as absent rather than as zero.

nRouter team
11 minRead →