Skip to content

Billing and credits

How Daimon meters model use, prices it and stops a turn when credit runs out, for deployments that serve several servers or workspaces on one provider key.

Every model call is priced in USD and debited from the tenant that caused it. By default a turn cannot start unless that tenant has credit left. Metering and the balance gate work with no configuration. Stripe top-ups need setup (see Turn it on). Channel budgets stay off until an admin sets one.

Choose a funding mode

Every tenant is prepaid: a turn needs a positive balance. An operator_funded tenant may run at zero or negative balance, at your cost.

daimon tenants funding-mode discord <guild-id> operator_funded
daimon tenants funding-mode slack <team-id> prepaid
daimon tenants list --json

Usage and debits still apply, so the balance can go negative. Each admission at a depleted balance logs billing.operator_funded_balance_alert with tenant_id and balance_usd; route it to your alerting. Switching back to prepaid restores the gate and adds no credit.

What is metered

The unit is one model call, not one turn. A turn fans out into many calls, and each is priced and debited as it happens. Calls made while no stream was attached, or after an interrupt or a turn ceiling, are billed when the turn ends. A call is never debited twice.

Tool calls to a model, such as media or classification, are debited too.

Pricing

Prices are USD per million tokens, in four dimensions: input, output, cache write and cache read. The table holds the provider's list price.

Model Input Output Cache write Cache read
Opus 5.5 $4 $20 $5 $0.20
Opus 5.5 fast $8 $40 $10 $0.40
Sonnet 5.5 $2 $10 $2.50 $0.10
Haiku 5.5, prompt up to 100,000 tokens $0.10 $0.50 $0.125 $0.01
Haiku 5.5, longer prompt $0.50 $2.50 $0.625 $0.05

The prompt counts input, cache reads and cache writes. All cache writes are priced as five-minute writes.

Each web search costs its provider's list price: $0.01 on Anthropic and OpenAI, $0.014 on Gemini. Gemini's first 5,000 a month are free, shared across the deployment's Gemini project.

DAIMON_BILLING__MARKUP multiplies the cost before it is debited (configuration.md). It applies to the ledger and to a finished turn's summary line. Usage panels and get_turn_cost show provider cost, before markup.

Warning: An Anthropic model with no pricing row runs free: the debit is zero and Daimon logs billing.unpriced_model. OpenAI, Gemini and self-hosted turns on an unpriced model are refused instead. Token rates exclude container and storage charges, such as an OpenAI workspace's hosted container fee.

The gates

Three gates run before a turn, in this order: balance, channel budget, allowance.

  1. Balance. A prepaid tenant needs a strictly positive balance. This holds without Stripe, so a spent trial credit blocks the tenant.
  2. Channel budget. The channel's spend in its window must be under its budget, unless that budget only alerts.
  3. Allowance. A person's spend must be under the allowance that governs them, if one does. Long jobs add a separate per-job limit.

GPT and Gemini turns pass two more checks as they start, counted from today's (UTC) usage at list price. Each tenant has a daily cap per model (DAIMON_BILLING__OPENAI_DAILY_MODEL_CAP_USD, DAIMON_BILLING__GEMINI_DAILY_MODEL_CAP_USD, $20 each). The install has a daily ceiling per provider across tenants (DAIMON_PROVIDER_DAILY_CEILING_USD__OPENAI, DAIMON_PROVIDER_DAILY_CEILING_USD__GEMINI, $200 each). Both reset at midnight UTC. A row's spend_limit_usd_cents stops a running reply once passed: 50 cents on built-in rows.

A denial aborts the turn with a plain notice, such as "Your team's Daimon credit has run out." The turn never falls back to a cheaper model. MCP tools that start a turn, routine runs and wakes pass the same gates. Unprompted thread participation skips silently when one refuses. A watch wake checks all three again before each model call, approval card and report it sends.

A finished turn ends with one summary line: agent, time, debit and money left, for example Ada 12s $0.042 used $41.20 left. The money left is the channel budget's remainder, else the prepaid balance.

An admin can hide that line under Cost footer in /settings (settings on Teams), or by asking Daimon. Failure notices still show, and billing is unchanged.

The web app also hides it.

Overdraft bound

The gates run once, before the turn, and debits land per model call, so one long turn can take a balance negative. Every turn admitted while the balance was positive runs to completion, so a chat tenant can overdraw by up to its concurrent-turn cap times one turn's cost. The cap is the adapter's max_concurrent_turns_per_tenant (default 3), or the tenant's override from daimon tenants turn-cap. A turn over the cap queues and runs the balance gate again once it holds a slot.

MCP start_turn sessions are worse: their spend reaches the ledger only when a read or the sweep settles it, and they have no concurrency cap.

Exempt usage

A caller with no platform user, such as an operator, the CLI or an internal token, runs with no balance check, no allowance check and no debit. The session is stamped billing-exempt when created, so its creator's posture covers every turn on it. An exempt caller on a billed session, such as daimon run --session on a chat thread, is debited to the tenant. daimon sessions create makes a session that is never settled.

To see the spend the operator absorbs, total the usage_sweep.exempt_skipped log lines by distinct managed_session_id, taking the latest line of each.

Channel budgets

An admin caps what one channel spends with the MCP tool set_channel_budget or the CLI. With no budget there is no limit, and nothing is set by default.

daimon channels budget set <platform> <workspace-id> <channel-id> <usd>

Budgets work on Discord, Slack and Teams channels, not Teams 1:1 chats, with or without Stripe.

  • Spend is the channel's debits in the window, markup included. A thread counts toward its channel.
  • Window is monthly (the UTC month), total (since starts_at, or ever) or fixed (from starts_at to ends_at).
  • The gate trips once spend reaches the limit, so a limit of 0 stops the channel. A turn in progress finishes past it. An --on-limit alert budget only posts an alert at each multiple of the limit.
  • The notice. The first chat turn refused in a window DMs the server admins. Raising the budget re-arms it. DAIMON_BUDGET_NOTICES turns it off per tenant (configuration.md).

Members read a budget with get_channel_budget. Listing, setting and clearing are for server admins only. Each change is audited.

A DM moved with /dm-me counts toward the channel it came from, and /dm-me is refused while that budget is used up. A budget does not cover:

  • MCP turns from a key made outside a channel, from the hub or a bearer token. A key made in a channel with limited readers, or one its agent's rule names, is gated by and charged to that channel.
  • Routines made with no channel, for example from a DM.

Signup credit and top-ups

DAIMON_BILLING__SIGNUP_CREDIT (default $10) is granted once per tenant when it is provisioned, not per person, and a reinstall cannot mint a second trial. Set it to 0 to require payment before first use (configuration.md).

Admins buy credit with Stripe Checkout, as one-time payments. /billing offers fixed amounts, each labelled with an estimated number of turns. Admin status is checked at click time. A repeated completion event cannot add a second top-up. Refunds and disputes debit the ledger, never more than the original credit.

A credit that conflicts with an existing one for the same payment fails and stays retryable. Inspect the Stripe event before replaying it.

Without Stripe, operators credit a tenant directly and set monthly limits:

daimon tenants credit discord <guild-id> 25.00 --note "hackathon grant" --id grant-1
daimon tenants cap discord <guild-id> 10.00
daimon tenants cap discord <guild-id> 5.00 --user <platform-user-id>

Credit prints the new balance. Repeating the same arguments with the same --id adds nothing, and omitting --id generates a new one. cap sets a monthly cap: without --user it is the default for everyone, and a zero amount blocks all turns.

Promo codes

A promo code hands out credit. A server-wide code credits the tenant, and a channel code (--channel-cap) credits the channel it is redeemed in. Only a platform admin can redeem either. /billing shows Redeem code to platform admins once some code can be redeemed.

daimon promo create --amount 20                    # prints the code once
daimon promo create --amount 50 --timed \
  --starts 2026-06-01T09:00Z --ends 2026-06-03T18:00Z --max-redemptions 40
daimon promo create --amount 10 --channel-cap 30 --max-redemptions 100
daimon promo list
daimon promo redemptions <code-id>
daimon promo revoke <code-id>

Codes are deployment-wide and stored only as a hash, so a lost code cannot be shown again. --code sets a chosen code of at least 12 characters. --redeem-from, --redeem-until and --max-redemptions bound when and how often it can be redeemed. A tenant redeems a server-wide code at most once.

  • Credit codes add ordinary credit at once. It never expires.
  • Channel codes need --channel-cap of at least --amount, and cannot be timed. Each person redeems once per channel, until the channel has taken the cap. With --amount 10 --channel-cap 30, three admins can each add $10. The credit also raises that channel's budget limit. They cannot be redeemed in a DM, a group DM, a Teams 1:1 chat or by MCP tool.
  • Timed codes grant only between --starts and --ends. After the window closes, what was not spent is removed. Spend inside a window draws on timed credit first, soonest expiry first.

A refund credits back spend recorded after a window closed, about fifteen minutes later. Until then the balance can read low or trip the gate.

Five refused redemptions in 15 minutes pause that person's attempts only. Every attempt is audited. Revoking stops new redemptions only, and credit already redeemed stays.

Budgets, caps, promo redemption and checkout need a platform admin acting directly, never a chat turn, routine, agent key or operator token. See admins.

What admins see

/billing on Discord and Slack, and billing on Teams, shows the current calendar month.

  • Members see their own use against their monthly allowance and the credit left.
  • Admins also see the month's spend, the top five spenders, the five most used channel budgets, Add credit, Redeem code and a Look up a person picker.
  • Expiry dates list timed credit with its end date, soonest first.

Panel figures leave out exempt usage. get_turn_cost returns None rather than zero for an unpriced model.

To list measured turns, without prompts or answers:

daimon usage turns <tenant-uuid> --days 7 --json

Add --channel <channel-id> or --origin routine to filter, or --summary to group by platform, channel and origin. It reads the local database and is telemetry, not an accounting source. The ledger is authoritative for charges.

Long jobs

A long job bills its owner and passes the balance and allowance gates. Its own dollar limit is checked on every heartbeat against provider cost before markup, and a breach stops it as over_budget.

Turn it on

Policy settings are nested under DAIMON_BILLING__ (configuration.md). The Stripe secrets are flat variables in their own block.

Stripe billing needs all the Stripe variables together. If any is missing, Daimon logs that Stripe billing is disabled and mounts no checkout or webhook routes. Metering, the balance gate, allowances and the signup credit still work.

Self-service top-ups also need DAIMON_MCP__PUBLIC_URL and DAIMON_MCP__JWT_SECRET for the hop from the chat adapter to the MCP server (public URL, JWT secret). The image must carry the optional billing extra, which installs stripe.

Recover unbilled usage

A settle bills calls no live stream metered. It runs at the end of a chat turn and whenever an MCP read sees a headless turn end. A scheduler sweep, on by default, settles headless sessions nobody read again. Set DAIMON_SCHEDULER__USAGE_SWEEP_ENABLED=false to turn it off (configuration.md).

Warning: A settle bills every session whose tenant stamp names a tenant in its own database, and a session carries no deployment identity. Two deployments sharing one Managed Agents workspace and the same Discord server or Slack workspace could debit each other's sessions. Give each deployment its own Managed Agents workspace.

Calls from before settling existed are the backlog, which no automatic settle reads. Settle it for internal tenants, as a dry run first:

daimon usage settle-backlog --internal <tenant-uuid>
daimon usage settle-backlog --internal <tenant-uuid> --apply

An internal tenant's calls are debited. Every other tenant's are waived and logged as billing.backlog_waived. Applying twice debits once. The command prints a receipt (JSON with --json) and writes no files, so keep the output.

Self-hosted and Azure models

A self-hosted harness, such as Azure, is billed from measured token counts per request. Configure DAIMON_BILLING__SELFHOSTED__DEPLOYMENTS to map deployment names to underlying models. Configure DAIMON_BILLING__SELFHOSTED__MODELS with each model's tariff history (deployments, models). There is no built-in Azure tariff, so supply your own verified rates.

Usage Daimon cannot measure stays pending and is never charged as zero. List pending items with:

daimon usage pending <tenant-uuid> --limit 1000 --json

Each row carries a reason such as usage_unknown, infrastructure_unknown, admission_missing, model_mismatch or tariff_context_invalid. Pass --cursor <next-cursor> for the next page. The command is read-only. The scheduler re-reads a GPT turn's usage for a day, until it is final.