AI vault & billing

Each AI coin’s own vault pays for its AI in USDC, per request, from its own trading fees.

Every AI coin has its own AI vault: a separate Solana wallet made for that coin. The coin's AI share of the trading fees lands there on-chain, and every AI request is paid from it, one request at a time, in USDC. A coin can only ever spend what its own vault holds.

The vault's money is only for the AI. It is not used for buybacks, burns or liquidity, it is not swept to the platform treasury, and there is no cap above which it overflows somewhere else. Nobody has a withdraw button for it, not even the creator.

Where the money comes from#

ShareGoes toNotes
50%CreatorWith the default 20% platform share.
30%The coin’s AI vaultPays only for this coin’s AI. Locked in the on-chain split at launch.
20%PlatformThe locked platform share. See Platform fee.
  • By default the whole 30% goes to the AI vault (NEXT_PUBLIC_MIND_CREDIT_SHARE_BPS, default 3000). The platform can lower that for new launches; any part of the 30% that does not go to the vault goes to the coin's agent wallet instead (see On-chain actions).
  • Fees are distributed every 15 minutes (see Creator fees). The share arrives as SOL, or as the pair token for coins that trade against another token.
  • Payments for the coin's x402 paid services also land in the same vault.
  • Coins launched before this system keep their locked split. If that split already paid the coin's credits vault, the money keeps going to the same address, which now pays the AI directly instead of being swept. An older AI coin whose split has no such share has nothing funding its vault.

The USDC float#

The AI provider is paid in USDC, but fees arrive in SOL. So the vault keeps a small USDC balance (the float) ready, and tops it up in the background. It never swaps per request.

  1. Check

    A background job checks every AI coin about every 5 minutes. A refill is also requested right after a request leaves the vault below the minimum (at most once every 2 minutes per coin).
  2. Sell the pair token first (token-paired coins)

    If the vault received a pair token worth at least 0.005 SOL, it is sold for SOL. Coins paired with USDC itself need no swap.
  3. Swap SOL to USDC

    When the vault holds less USDC than the float minimum (default $5), it swaps SOL to USDC through Jupiter, up to the float target (default $25). It always keeps 0.01 SOL for network fees, does not swap less than 0.002 SOL, and allows 1% slippage. If there is not enough SOL, it swaps what it can. The quote is also checked against an independent SOL price: it must pay at least that price minus the slippage and a 2% margin, or the swap is refused.
  4. Confirm

    One refill per vault at a time, even across server processes. A swap that is still confirming blocks the next one until it lands or is marked failed.

Both float values are part of the coin's rules, so the creator can change them (see Holder access & rules).

How one request is paid#

  1. Local checks first

    Before anything is paid, the server checks that the model is in the provider's catalog, prices the request from the provider's price sheet, and compares that price with the request's cap, the coin's daily budget and the vault's USDC (minus payments already in flight). If any check fails, nothing is paid.
  2. The vault signs one USDC payment

    The provider states its payment terms in an HTTP 402 answer (the x402 protocol); they are cached so later requests can pay on the first try. The vault signs exactly one USDC transfer to the provider for the price, locally on the server. The network fee of that transfer is paid by the provider's side, not by the vault. Details in x402 paid AI.
  3. The provider answers

    The provider checks the signed payment, then streams the answer. The server does not wait for on-chain confirmation before showing you the answer.
  4. Recorded after the answer

    Tokens used, cost, the payment transaction (when the provider returns one) and a hash of the answer are saved after the last word, without slowing the reply. Each request then gets a public receipt (see Verify AI receipts).

What a request costs

x402 payments are fixed before the answer exists, so the price covers the worst case: the estimated input tokens at the input price, plus the full output limit (max_tokens) at the output price, plus the provider's margin (5% by default), and never less than the provider's minimum ($0.001 by default). Input tokens are estimated as one token per CJK character plus one per 4 other characters. If the provider asks for a different amount, that amount is paid only if it is at most 1.5 times this estimate (or the provider's minimum) and within the request's cap.

Note

A short answer costs the same as a long one with the same output limit, and a lower max_tokens means a lower price. The recorded cost is always the signed amount. In the rare case where the provider refuses a pre-signed payment and asks for another, the refused one is counted too (as “in doubt”, because it could still be submitted); everything one request signs stays within its cap.

Spending limits#

Defaults below. The creator can change the coin's rules within the ranges shown.

LimitDefaultRange
Max per request$0.25$0.001 to $5
Daily budget, whole coin, per UTC day$20$0 to $1,000 (0 stops the AI)
Float minimum (refill below)$5$0 to $1,000
Float target (refill up to)$25$1 to $5,000, at least the minimum
Platform hard cap per request$5Set by the platform, whatever the coin’s rules say

The cap for one request is the smallest of: the coin's max per request, what is left of today's budget, the platform hard cap, and (for an API key) what is left of the key's own spend limit. The daily budget counts every caller together and resets at 00:00 UTC.

What spends from the vault#

UseRecorded as
Holder chat on the coin page, and replies in a linked Telegram groupholder
Follow-up calls after a tool runs in chat, and the website buildertool
The creator’s API keycreator_key
Creator task box and skills, X manager posts, autonomous thoughts (if on)mind
x402 “ask” and “skill” servicesx402

The x402 “report” service makes no model call and spends nothing.

When the vault is empty#

  • A request that the vault cannot pay is refused before anything is paid: “This coin’s AI vault is out of USDC right now. Trading fees refill it.” A refill is requested at the same time.
  • A coin that used its daily budget is refused until 00:00 UTC.
  • The coin page shows the AI as sleeping when its vault has no USDC. If the vault has SOL but no USDC yet, the next float check fixes it.

Where to see the numbers#

  • The chat panel on the coin page shows the vault's USDC and how much of today's budget is used.
  • The AI panel on the coin page shows the vault's spendable USDC (labelled “AI credits left”).
  • GET /api/ai/{mint}/usage is public: the vault address, its USDC and SOL, the daily budget and what was spent today.
  • The vault is a normal public address: every payment is a USDC transfer you can see on an explorer, and each request links to its transaction in its receipt.
  • The Creator dashboard still shows a “credits left” figure from the old credit ledger. Use the coin page for the live vault balance.

Important

The AI vault is a wallet whose key the platform derives from a server secret. It is not a smart contract. You rely on the platform to keep that key safe and on the AI provider to answer what it was paid for. The rules the vault key follows are in Security.

For operators#

SettingDefaultWhat it does
AI_PROVIDER_BASE_URLhttps://sol.blockrun.ai/apiAny OpenAI-compatible x402 provider paid in USDC on Solana. Calls /v1/chat/completions and /v1/models under it. Must be https in production and on mainnet.
AI_PROVIDER_NAMEfrom the hostLabel stored with each request (blockrun for the default).
AI_PROVIDER_PAYTOemptyComma-separated allowlist of the provider’s payment wallets. Empty: the first one seen is pinned and every other one is refused. Set it before mainnet.
AI_PROVIDER_PREAUTHonfalse turns off pre-signing from cached payment terms (every request then takes two round trips).
AI_PROVIDER_MARGIN_PCT5Provider margin used in the local price estimate.
AI_PROVIDER_MIN_USD0.001Provider minimum payment used in the local price estimate.
AI_HARD_CAP_USD5Absolute per-request ceiling (0 to 100).
AI_PROVIDER_HEADERS_TIMEOUT_MS120000Time allowed until the provider’s response headers arrive.
AI_PROVIDER_IDLE_TIMEOUT_MS60000Longest gap without data while an answer streams.
AI_ENABLEDonfalse turns the whole AI gateway off.
AI_DEFAULT_MODELnoneFallback model when no catalog model is allowed.
AI_FLOAT_INLINEonfalse stops the refill request right after a request; the 5-minute job still runs.
AI_FLOAT_SOL_RESERVE_LAMPORTS10000000SOL kept in each vault for network fees (0.01 SOL).
AI_FLOAT_PRICE_MARGIN_BPS200Extra tolerance between the independent SOL price and the swap quote, on top of the 1% slippage.
VAULT_SECRETrequiredDerives each coin’s AI vault. Without it the gateway is off.
FEE_CLAIMER_SECRETrequiredPays the network fee of the receipt memos.

Role settings (X, Telegram, trade cap) are listed in AI roles.