Usage and limits
Sixb records model usage across generation, conversations, AI workflow steps, embeddings, decisions, transcription, reranking, and web search. View consumption in your app and set monthly limits for your project or specific users and groups.
View usage
Open Settings › Usage from your app's user menu to see what models were called and what they cost over the last 24 hours, 7, 30 or 90 days. Spend shows:
| Part | What it shows |
|---|---|
| Summary | Spend and its change from the period before, tokens and how much was read from cache, model calls, conversations and runs, and the project's monthly cost limit |
| Chart | Cost, tokens or calls per day, stacked by model |
| Breakdown | Spend by model, source (agent chats, each workflow, actions), person or kind of model, with its change and trend |
| Conversations and runs | Every conversation, workflow run and action run that called a model. Open one for its turns or steps, then a call to see how it was priced |
Clicking a day, a model or a breakdown row filters the whole page to it. The filters are kept in the address, so a filtered page can be shared. A conversation's title and turns show only to people who can open it; everyone who can see usage sees its totals.
Seeing usage requires can.observe(agent.usage) in a role; adding
and changing limits on the Limits tab requires can.manage(agent.usage).
Usage and cost depend on what the provider reports and the available pricing. Missing values remain unknown rather than being counted as zero.
Keep the workers running so accounting can recover
from temporary storage failures. sixb dev and automatic sixb worker-group selection
include the required worker. If you select worker types explicitly, include agent, even
for projects that only use decision, embedding, or audio models. Accounting recovery does not require a sandbox.
Set a monthly limit
In Settings › Usage › Limits, choose Add limit:
- Choose the project, user, service account, or group the limit applies to.
- Select Cost or Tokens and enter the monthly amount.
- Choose Add limit to save it.
Limits reset at the start of each UTC calendar month. Editing a limit does not reset consumption. Every applicable limit must allow a call before it starts. Once a limit is reached, further calls are blocked.
Token limits count calls billed by tokens: generation, embeddings, and decisions. Transcription, reranking, web search, image generation, and speech are billed by audio duration, search, image, or character, so only cost limits apply to them.
Limits control whether calls can start. They are not hard caps on a provider's bill, because a
call's actual usage can exceed its estimate. Use
maxOutputTokens to bound the output of an individual call.
Through the Vercel AI Gateway, a call is estimated at its model's catalog price, whatever provider
options it sets, then counted at what the Gateway billed: a service tier, a thinking budget or a
provider tool such as web search shows up there. With fallback models (gateway.models), the
estimate is the dearest of them, and a fallback the catalog does not price blocks the call while a
cost limit applies.
Embeddings
Vector indexing and semantic search use the same
usage accounting and limits. A completed model call can count toward usage even if its result
cannot be saved. Calling a provider's embed() method directly bypasses these controls.
Automatic projection indexing uses the project's budget. If the budget is exhausted, embedding generation waits while projections continue updating objects.
Audio transcription
Calls to sixb.models.audio.transcribe() appear in AI usage with their cost and audio duration,
when available.
Vercel Gateway transcription is currently blocked when a cost limit applies, because Sixb cannot estimate its cost before the call.
Image and speech generation
Calls to sixb.models.image.generate() and sixb.models.audio.speak() appear in AI usage with
their cost.
A cost limit lets a call start only when Sixb can estimate its cost first:
| Model priced | Under a cost limit |
|---|---|
| Per image (most image models, Gemini image models) | Runs. Sixb reserves the price of every image requested. |
| Per character (most speech models) | Runs. Sixb reserves the price of the text. |
| By tokens (GPT Image, Gemini speech) | Blocked: the output's size is unknown before the call. |
A call with reference images is also blocked under a cost limit when its model is priced by tokens. A model whose provider has no published price can only run without a cost limit.
Reranking
Queries using .rerank() add one accounted model call for their candidates. Direct provider
rerank() calls bypass Sixb's usage and limit controls.
Gateway rerankers report a cost without token usage. Reranking counts toward cost limits only; a model without catalog pricing cannot run while a cost limit applies.
Web search
Each search is one accounted call, shown as Web search in AI usage with the cost its provider reports. Under a cost limit, a search runs only when its model can price it beforehand, usually by the number of results asked for; otherwise it is blocked. A search that fails before its provider replies still counts its reserved amount toward cost limits, since it may have been billed.
Permissions
Grant access to view usage and manage limits through a role:
import { agent, can, defineRole } from "@sixb/core"
import { financeAdmins } from "../groups/finance-admins"
export const aiUsageOperators = defineRole("ai-usage.operators", {
grantedTo: [financeAdmins],
grants: [can.observe(agent.usage), can.manage(agent.usage)],
})
can.observe(agent.usage) allows viewing usage and limits. can.manage(agent.usage) allows
creating and changing limits. Permission to use the agent does not include either grant.