Fees

What a run costs, who receives each part and when, and what returns to the caller.

The three fees

FeePaid toWhenFrom
Turn rewardthe cranker who landed the turnevery turnthe run’s budget
Royaltythe model’s vaultper token, at settlementthe run’s budget
Protocol sharethe fee accountat settlementa share of turn rewards and royalties

A run’s budget is the sum of the three, in lamports:

turn rewards   = turns × turn reward
royalties      = tokens × royalty per token
protocol share = floor((turn rewards + royalties) × protocol share rate / 10,000)

budget         = turn rewards + royalties + protocol share

The protocol share rate is in basis points.

Who pays

The caller pays, in SOL. Opening a run deposits its budget into the run account, and every fee is paid out of that account. Crankers and publishers are paid by the run itself.

Turn reward

The turn reward is a fixed amount per turn. It moves from the run to the turn’s signer inside the turn’s own transaction, so a cranker is paid the moment its turn lands. The amount is set above the fee of the transaction that carries the turn, which is 5,000 lamports for one signature.

Royalty

The royalty is a price per token that the model’s publisher sets. Each turn accrues it in the run for every token the turn completes. At settlement the accrued royalty moves to the model’s vault, and the publisher claims from the vault at any time.

Protocol share

The protocol share is charged to the budget on top of turn rewards and royalties. After each turn the program recomputes it from the run’s totals, all rewards paid plus all royalties accrued, and the increase accrues in the run. It moves to the fee account at settlement. CURTA tells what the fee account does with it.

Royalties and the protocol share settle once per run. A turn touches only its run and its signer, so runs turn in parallel.

The quote is exact

The count of turns a run takes is a pure function of the model, the prompt, max tokens and the temperature. The turn planner in curta-core computes it, and the browser runs the same planner the program does. The quote on /run therefore shows the run’s cost before you sign:

  • turns
  • turn rewards
  • royalties
  • protocol share
  • the total budget, in SOL to nine places

The SDK’s quote call returns the same figures as turns, turnRewards, royalties, protocolShare and totalBudget, each a bigint in lamports. It also returns runAccountSize, the size of the run account in bytes, and runAccountRentLamports, the rent the cluster asks for that size. The quote counts royalties for max tokens.

Where the rates live

The turn reward and the protocol share rate are values in the program’s Config account. The royalty per token is a value in each Model account. The quote reads all three from the chain, and each model’s page shows its royalty.

A run records all three when it opens and keeps them for its whole life. A new turn reward, protocol share rate or royalty applies to runs opened after the change.

What returns on close

Opening a run puts two amounts into the run account: the budget and the account’s rent. Close run returns every lamport still in the account to the caller, which is the unspent budget plus the whole rent, runAccountRentLamports in the quote.

A run that reaches the end token before its max tokens leaves budget unspent, and so does a cancelled run. Runs and turns places close in a run’s life. The run’s page shows budget spent and budget left at every turn.

The rent follows the run account’s size, which grows with the model, the prompt length and max tokens. The reference runs on the prompt “Once upon a time”:

ModelTokensTurnsRun account bytes
stories260K122048,304
stories15M8530624,832