Skip to content

economics

economics

Declare the pricing model for a machine. The economics section specifies how much it costs to call this machine, what pricing model applies, and whether a free trial is available. The governance interpreter enforces these declarations at runtime: every incoming call is checked against the caller’s balance or subscription status before execution begins.

When to use

Use economics when a machine should charge callers for access:

  • Machines published to the Kura registry for others to use
  • Internal machines with usage tracking or cost allocation
  • Any machine where you want the runtime to enforce payment before execution

Machines without an economics section are free to call. No payment check occurs.

Syntax

economics
pricing: <model>
price: <amount>
currency: <code>
free_trial: <count>

With subscription tiers:

economics
pricing: subscription
tiers
<tier_name>
price: <amount>/<period>
limit: <count> calls | unlimited
<tier_name>
price: <amount>/<period>
limit: <count> calls | unlimited

Parameters

ParameterTypeRequiredDescription
pricingstringYesPricing model: per_call, subscription, or usage
pricenumberYes (for per_call and usage)Price per call or per unit of usage
currencystringNo (default: usd)ISO 4217 currency code
free_trialintegerNoNumber of free calls before payment is required, per consumer
tiersblockYes (for subscription)Named subscription tier definitions

Tier parameters

ParameterTypeRequiredDescription
pricestringYesAmount and period, e.g. 29/month, 290/year, or custom
limitstringYesCall limit, e.g. 1000 calls or unlimited

Pricing models

per_call

Every call costs the same fixed amount. The governance interpreter reserves the amount before execution and settles it after.

economics
pricing: per_call
price: 0.05
currency: usd

subscription

Consumers subscribe to a named tier with a monthly or annual price and a call limit. The interpreter checks the caller’s active tier and remaining calls.

economics
pricing: subscription
tiers
starter
price: 29/month
limit: 1000 calls
pro
price: 99/month
limit: unlimited
enterprise
price: custom

The custom price indicates publisher-negotiated pricing. The interpreter checks for a valid subscription record without enforcing a specific amount.

usage

Price is per unit of measured usage (tokens, compute seconds, data volume). The interpreter reserves an estimated amount before execution and settles the actual measured amount after.

economics
pricing: usage
price: 0.001
currency: usd

Free trial

The free_trial parameter gives each consumer a fixed number of free calls before payment is required:

economics
pricing: per_call
price: 0.10
currency: usd
free_trial: 100

Trial usage is tracked per consumer per machine in the behavioral ledger. Once the trial count is exhausted, the economic governance stage requires payment. There is no way to reset a trial; it is a one-time allowance per consumer.

Payment pipeline

The economic governance stage runs inside the interpreter pipeline:

trust_ceiling -> denial_history -> consent -> agency -> permissions -> economic -> execute -> record

Three phases:

  1. Reserve: Check balance or subscription. If insufficient, deny the call and record a PolicyDecision.
  2. Execute: The machine runs. Steps, governance, and ledger recording proceed normally.
  3. Settle: Debit the actual cost. For per_call, this matches the reserved amount. For usage, this is the measured amount.

Governance implications

Every economic decision is a PolicyDecision event in the behavioral ledger:

  • Stage: economic
  • Rule: the pricing model and price from the economics section
  • Inputs: caller identity, quoted price, balance or subscription status
  • Decision: allow or deny
  • Reason: "sufficient_balance", "active_subscription", "free_trial", "insufficient_funds", "subscription_expired", "trial_exhausted"

These events are hash-chained (Inv 6: Trace Integrity) and append-only (Inv 4: Decision Completeness).

Revenue sharing

When a consumer pays for a machine, the revenue splits:

PartyShare
Publisher85%
mashin platform15%

Stripe processing fees are absorbed by the platform’s 15% share.

Relationship to krate.toml

The .mashin file declares the runtime pricing contract: what the governance interpreter enforces. The krate.toml file declares the registry listing metadata: what consumers see when browsing Kura. They should match, but the .mashin file is the enforced contract.

# krate.toml (registry metadata)
[economics]
price_per_run = 10
price_model = "per_run"
revenue_share = 0.70
# machine.mashin (enforced contract)
economics
pricing: per_call
price: 0.10
currency: usd

Examples

Simple per-call pricing

machine data_enricher
accepts
company as text, is required
responds with
data as object
economics
pricing: per_call
price: 0.05
currency: usd
implements
compute process
{data: {name: input.company, enriched: true}}

Subscription with tiers

machine analytics_engine
accepts
query as text, is required
responds with
results as list
economics
pricing: subscription
tiers
starter
price: 49/month
limit: 5000 calls
professional
price: 149/month
limit: 50000 calls
enterprise
price: custom
limit: unlimited
ensures
permissions
allowed to
llm_call, db_read
implements
ask analyze, using: "anthropic:claude-sonnet-4-6"
with role "You are a data analyst."
with task input.query
returns
results as list

Per-call with free trial

machine sentiment_api
accepts
text as text, is required
responds with
sentiment as text
confidence as number
economics
pricing: per_call
price: 0.02
currency: usd
free_trial: 50
ensures
permissions
allowed to
llm_call
implements
ask analyze, using: "anthropic:claude-haiku"
with role "Return sentiment (positive/negative/neutral) and confidence (0-1)."
with task input.text
returns
sentiment as text
confidence as number

Machine calling a paid machine

machine market_report
accepts
company as text, is required
responds with
report as text
ensures
permissions
allowed to
llm_call, machine.call
implements
ask enrich, from: "@dataco/company-enrich"
company: input.company
payment
max: 50 credits
prefer: "mpp"
fallback: "x402"
returns
financials as object
ask write, using: "anthropic:claude-sonnet-4-6"
with role "Write a market report."
with task "Company: ${input.company}\nFinancials: ${steps.enrich.financials}"
returns
report as text

Translations

LanguageKeyword
Englisheconomics
Spanisheconomia
Frencheconomie
GermanWirtschaft
Japanese経済
Chinese经济
Korean경제

Sub-keywords

EnglishSpanishFrenchGermanJapaneseChineseKorean
pricingpreciostarificationPreisgestaltung価格設定定价가격
priceprecioprixPreis価格价格가격
currencymonedadeviseWahrung通貨货币통화
free_trialprueba_gratisessai_gratuitProbezeit無料試用免费试用무료체험
tiersnivelesniveauxStufen階層层级계층

See also

  • ensures - Governance section (economics runs in the same pipeline)
  • implements - Where call steps with payment blocks are declared
  • expresses - Surface layer for consumer-facing access
  • Economics guide - Tutorial with walkthrough examples