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 | unlimitedParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
pricing | string | Yes | Pricing model: per_call, subscription, or usage |
price | number | Yes (for per_call and usage) | Price per call or per unit of usage |
currency | string | No (default: usd) | ISO 4217 currency code |
free_trial | integer | No | Number of free calls before payment is required, per consumer |
tiers | block | Yes (for subscription) | Named subscription tier definitions |
Tier parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
price | string | Yes | Amount and period, e.g. 29/month, 290/year, or custom |
limit | string | Yes | Call 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: usdsubscription
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: customThe 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: usdFree 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: 100Trial 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 -> recordThree phases:
- Reserve: Check balance or subscription. If insufficient, deny the call and record a PolicyDecision.
- Execute: The machine runs. Steps, governance, and ledger recording proceed normally.
- Settle: Debit the actual cost. For
per_call, this matches the reserved amount. Forusage, 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
economicssection - Inputs: caller identity, quoted price, balance or subscription status
- Decision:
allowordeny - 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:
| Party | Share |
|---|---|
| Publisher | 85% |
| mashin platform | 15% |
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 = 10price_model = "per_run"revenue_share = 0.70# machine.mashin (enforced contract)economics pricing: per_call price: 0.10 currency: usdExamples
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 listPer-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 numberMachine 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 textTranslations
| Language | Keyword |
|---|---|
| English | economics |
| Spanish | economia |
| French | economie |
| German | Wirtschaft |
| Japanese | 経済 |
| Chinese | 经济 |
| Korean | 경제 |
Sub-keywords
| English | Spanish | French | German | Japanese | Chinese | Korean |
|---|---|---|---|---|---|---|
| pricing | precios | tarification | Preisgestaltung | 価格設定 | 定价 | 가격 |
| price | precio | prix | Preis | 価格 | 价格 | 가격 |
| currency | moneda | devise | Wahrung | 通貨 | 货币 | 통화 |
| free_trial | prueba_gratis | essai_gratuit | Probezeit | 無料試用 | 免费试用 | 무료체험 |
| tiers | niveles | niveaux | Stufen | 階層 | 层级 | 계층 |
See also
- ensures - Governance section (economics runs in the same pipeline)
- implements - Where call steps with
paymentblocks are declared - expresses - Surface layer for consumer-facing access
- Economics guide - Tutorial with walkthrough examples