
Multi-Tenant Architecture: 3 Models & 8 Best Practices
Learn how multi-tenant architecture works, compare database isolation models, and explore six components & eight best practices for shared infrastructure.
Understand AI credits from pricing to production. Explore credit wallets, ledgers, atomic deductions, grant expiration, and real-time usage controls.
A database counter can tell you how many AI credits remain, but it can't tell you which promotional grant expires tomorrow, whether another agent has reserved the balance, or how much to refund after a failed generation.
This is important when credits become the currency for an AI product. Every request changes the available balance, and each deduction must follow the customer's pricing rules without charging twice or allowing unapproved spending.
This guide covers how AI credits are priced, how a ledger tracks each grant, and how to enforce balances while requests run.
AI credits are usage units that customers spend to access AI features such as text generation, image creation, and agent workflows. Each action has a credit cost, which the product deducts from the customer's available balance.
For example, a plan includes 2,000 AI credits per month. Here's how different actions could affect that balance:
Illustrative rates. Actual credit costs vary by product.
Customers use one credit balance across multiple AI features, even when those features have different processing costs. Engineering teams define the credit rate for each action and track deductions against the shared wallet.
An AI action's credit cost depends on how the product maps consumption to its internal pricing rules.
Common approaches include:
For example, a product might charge 1 credit for a basic text generation and 10 credits for a premium reasoning model. The customer spends the same currency, while the product applies different rates behind the scenes.
Our token-based pricing guide explains how token consumption becomes a billable usage unit.
AI products use credits to charge for consumption across features with different processing costs. This gives customers a common unit for tracking usage while allowing the product to price individual operations differently.
Consider two customers on the same subscription.
One uses an AI assistant for short summaries, and the other runs autonomous agents that process large documents, call external tools, and generate reports throughout the day.
Their subscriptions may be identical, but their compute costs can differ considerably.
Credits help AI products address three challenges:
The trade-off is additional infrastructure. Once several features share a balance, every deduction needs to be accurate, including when requests overlap or fail.
AI credits cost different amounts depending on the provider, subscription plan, and AI feature being used. Each vendor sets its own credit rates, with some including credits in monthly subscriptions and others selling additional credit packs.
To estimate the cost of credits included in a subscription, use this formula:
Implied cost per credit = Monthly subscription price ÷ Included credits
For example, a $20 monthly plan with 4,000 credits works out to $0.005 per credit. This is an estimated rate, since the subscription may include other features and benefits.
Adobe Firefly publishes monthly subscription prices alongside generative credit allowances, so we can compare implied rates.
Prices are subject to change without notice. Always visit the official company websites for the most up-to-date pricing information.
Other providers structure credits differently:
For AI product teams, the cost of a credit should reflect the compute it represents. A lightweight text request and a complex agent workflow may consume very different resources, even when customers pay using the same credit wallet.
When setting your own rates, account for model costs, expected usage, and margins. Our credit pricing guide covers how to value credits and manage consumption across AI features.
Adobe, Microsoft, Google, and Miro show how AI credits work across different pricing models. Each handles consumption, limits, and credit allocation differently, with useful lessons for engineering teams building their own systems.
Adobe combines monthly generative credits with unlimited access to eligible standard AI features.
Credits cover premium operations such as certain video, audio, and partner-model generations. The system needs to distinguish between actions included in the subscription and those that deduct credits.
What engineers can learn:
Microsoft uses two types of consumption controls: monthly AI credits for AI features across Microsoft 365 and Windows apps, and separate limits on how many times specific features can be used.
For example, some features, such as Vision, are capped by how many times they can be used in a set period, while others draw from the monthly AI credit allotment. If a customer reaches a feature limit or uses all of their AI credits, that feature may be unavailable until the allowance resets.
That means the application needs to know which control applies to each feature, the shared credit allowance or a feature-specific limit, before approving an operation.
Google combines included usage allowances with optional credit purchases for supported AI features, including Google Flow and Antigravity.
Customers can purchase additional credits when they need more capacity, and those purchases may have their own expiration dates.
The engineering challenge is managing multiple credit grants:
Miro introduced AI credits alongside its existing seat-based subscriptions. Monthly allocations depended on seat counts, while separate pools supported trials, production usage, and beta features.
The challenge was applying different credit rules across customers without rebuilding pricing logic each time.
We helped Miro launch its hybrid AI credit model in six weeks using Stigg, with automated allocation and runtime enforcement.
The results included:
These examples highlight an important design choice, which is that credit systems need rules for how usage is priced, which balances apply, and when consumption is allowed. Those rules determine the ledger and enforcement infrastructure each AI product needs.
AI credit depletion policies determine whether customers can continue using a product after exhausting their allowance. Depending on their plan, the application may block new requests, allow approved overages, offer credit top-ups, or restore the allowance at the next billing cycle.
For example, an AI developer tool might block trial accounts when their credits run out but permit enterprise customers to continue under an approved overage agreement.
The difficult part is enforcing the correct rule while requests are running.
If an agent consumes more credits than expected, the application needs a clear policy for handling the final amount. Blocking future requests will not recover compute already consumed.
Our guide to AI usage control explains the runtime checks behind allowances, budgets, and spending limits.
AI credits can roll over or expire based on the provider's policy and credit grant type. Monthly allowances often reset, while purchased and promotional credits may have separate expiration dates.
Adobe Firefly's subscription credits reset monthly without rolling over, while Google says purchased AI credits may expire after a period set out when you buy them..
The technical challenge starts when customers hold multiple grants. Say an account has 500 promotional credits expiring tomorrow and 1,000 purchased credits expiring next month.
Under an earliest-expiry-first policy, the next request should consume promotional credits first. The system must track each grant, enforce spending order, and handle concurrent deductions without double-counting.
A single balance counter cannot enforce these rules. Grant-level tracking determines which credits are spent, expired, or still available. Explore our prepaid credits guide for more on expiration policies, credit packs, and top-ups.
AI credits can be bundled into subscriptions, allocated by plan or seat count, purchased upfront, or billed after consumption.
Each model comes with different rules for issuing credits, tracking balances, and controlling spending:
The appeal of subscription credits is predictability. Customers pay, for example, $29/month, receive 1,000 credits, and know what their plan covers.
Renewals introduce a few technical decisions. Do unused credits expire? What happens to requests running when the billing cycle ends?
Recurring grants need clear renewal and expiration rules, with runtime checks that prevent expired allowances from funding new workloads.
Moving from a $29 plan with 1,000 credits to a $99 plan with 10,000 gets tricky when someone upgrades halfway through the month.
Giving them another 10,000 credits could be generous. Prorating the difference might make more sense, depending on the contract.
The platform must adjust grants and entitlements at the plan's effective time, preserve consumption history, and prevent duplicate allowances.
Twenty seats at 500 credits each gives an AI collaboration team 10,000 credits to share. Now five employees launch agents that draw from the same balance.
Without concurrency controls, multiple requests can pass the balance check and overspend the account. Atomic deductions protect the shared pool, and per-user budgets can also prevent one employee's agents from consuming the team's entire allowance.
Prepaid credits suit customers whose AI workloads come in bursts. A developer might purchase $50 in credits for testing, then add another $100 before running a large batch.
Each purchase creates a separate grant, potentially with its own expiration date.
Which credits should the next request consume? Grant-level tracking and spending priorities determine the deduction order, while purchase events update the available balance.
What if a customer's workload exceeds the credits included in their plan, but stopping the job would cause more trouble than the extra charge?
An AI API could include 2,000 credits and bill another 1,500 as overage when consumption reaches 3,500.
Approved overages require request-time eligibility checks, spending caps, and billable usage records. Contract rates determine the final invoice amount.
A product can combine these approaches by offering subscription credits alongside prepaid top-ups and approved overages. The runtime must apply the correct spending policy across every credit source.
An AI credit system combines wallets, grants, consumption rates, a ledger, and request-time enforcement. Each component has a separate responsibility, but they must agree on the customer's available balance.
Consider an AI image-generation request. The product checks feature access, calculates the credit cost, and confirms spending eligibility before execution. Once generation finishes, it records actual usage and settles any reserved credits.
The available balance must account for completed usage, active reservations, and grant rules, especially when multiple agents launch requests at the same time.
An AI credit ledger tracks every credit grant, deduction, expiration, refund, and adjustment. It gives teams a reliable record of where credits came from, how they were spent, and why a customer's balance changed.
Each credit grant needs several key details:
A customer gets 1,000 credits from their subscription and buys another 500. Their dashboard shows 1,500 credits, but the ledger tracks both amounts separately because subscription credits may expire before purchased credits.
Burn order determines which credits get spent first. A product might consume the earliest-expiring grant before touching purchased credits, which helps customers use credits before they expire.
Every deduction must follow the same policy, even when multiple agents spend credits at once. An append-only ledger preserves the transaction history so it’s possible to trace consumption, correct balances through new entries, and reconcile credit activity with billing records.
AI credit systems risk overspending when multiple agents draw from the same balance at once.
An account has 100 credits left, and two agents each request 80 credits and check the balance before either deduction completes. Both proceed, authorizing 160 credits against an available 100.
Atomic reservations prevent double-spending by securing credits before execution. Other failures need their own safeguards.
After execution, settlement records the final cost and releases unused reserved credits. If consumption exceeds the estimate, the system applies the configured overage policy.
Real-time AI credit enforcement determines whether a customer can afford an AI operation before it runs. The system checks entitlements, reserves credits when needed, and settles the final cost once usage is known.
Here's how the process works in production.
Every request starts with an account, a feature, and a set of usage rules. The system checks whether the customer can access the selected model, how many credits remain, and whether a hard or soft limit applies.
A customer might have access to a premium reasoning model but lack enough credits to run another expensive request.
AI costs aren't always known upfront. A request estimated at 20 credits might end up costing 14 or 25.
The application can reserve 20 credits before execution by using atomic operations to prevent concurrent requests from claiming the same balance. Requests without sufficient credits follow the account's depletion policy.
Once approved, the model or agent runs while the application captures token counts, model usage, and other billable activity.
The rating logic converts that usage into credits using the applicable rate version. A 20-credit estimate might become a final charge of 14 credits.
The system deducts the 14 credits and releases the remaining six. If consumption exceeds the reservation, the configured spending policy determines how to handle the difference.
Failed requests and retries need special handling. Reservation releases follow the product's billing rules, while idempotency keys prevent duplicate charges.
Each completed operation produces a usage record and ledger entry. Customers can track their remaining credits, while finance teams can reconcile consumption with billing.
Multi-step AI agents make request-time checks especially important. An agent might have enough credits to start a task but exhaust its allowance after several model calls. Each billable step needs its own spending decision before more compute is consumed.
Paid AI credits can create deferred revenue obligations when customers purchase credits before using the service. Revenue recognition depends on contract terms, consumption, and applicable accounting standards.
Finance needs accurate records from the credit ledger to track these obligations.
A customer purchases 10,000 credits for $100, giving each credit an implied value of $0.01. After consuming 4,000 credits, the ledger should show which grant funded the usage and what remains.
Finance uses those records to assess revenue recognition and outstanding obligations. Spending 40% of the credits doesn't always mean recognizing 40% of the revenue. Contract terms, performance obligations, and expiration policies can affect the calculation.
Grant-level tracking gives finance the transaction history needed to apply the correct accounting treatment.
A credit balance seems easy enough to build. Store the number, deduct credits after each request, and block usage when the balance reaches zero.
Then a customer buys a top-up while three AI agents are running. One request fails, another exceeds its estimated cost, and the customer's monthly credits expire at midnight.
Now your team needs to handle:
Each new pricing rule brings more edge cases to test, and the maintenance work can grow faster than the original implementation.
The decision comes down to what your team wants to own. If your credit rules rarely change, building may be reasonable. If engineers are spending their time fixing balance discrepancies and updating entitlement logic, buying deserves serious consideration.
An AI agent doesn't wait for your billing system to catch up. It can launch multiple model calls, consume hundreds of AI credits, and exhaust a customer's allowance while usage events are still being processed.
Stigg puts credit enforcement where those costs happen: inside the application request path. Your team can authorize spending, deduct credits across shared wallets, and stop requests that exceed the customer's allowance.
Here's what your team can manage with Stigg:
Your engineers can focus on building AI features while Stigg handles who can spend credits, which grants get consumed, and when usage must stop.
Want to see how those decisions work inside an AI request? Stigg's documentation walks through credit management and runtime enforcement.
AI credit prices vary by provider and the type of generation. Adobe Firefly Standard costs $9.99/month for 2,000 credits, equivalent to about $0.005 per included credit. The number of credits consumed depends on the AI feature used.
Your AI credit allowance depends on the plan. Adobe Firefly Standard includes 2,000 monthly credits, while Pro includes 4,000. Other platforms may offer larger allowances, shared credit pools, or prepaid packs.
Running out of AI credits can stop new requests, trigger a top-up option, or allow approved overages. The product’s depletion policy determines whether usage continues or pauses until credits renew.
AI credits often expire at the end of their billing period, though some providers allow rollover. Adobe Firefly’s monthly credits reset each billing cycle and don’t roll over, while Google says purchased AI credits may expire after a period set when you buy them.
The main difference between AI credits and usage-based pricing is how consumption is measured and charged.
AI credits assign a common unit to different AI operations, while direct usage-based pricing charges for tokens, API calls, or compute time. A usage-based model can also charge customers through credits.
AI credits aren’t money, but they usually stand in for money a customer has already paid. A product sells or bundles credits at a set price, so each credit carries an implied value.
For example, 10,000 credits bought for $100 works out to $0.01 per credit. Paid credits bought before use can create deferred revenue obligations for the product, and unused credits may expire under the provider’s rollover rules.