Documentation

Prepaid credits

RunLayer bills metered agent usage from a workspace prepaid balance denominated in settlement-token wei (18 decimals). No card rails — fund on-chain or use workspace grants on testnet.

How credits work

  • Balance lives in prepaid_balances per workspace (off-chain ledger mirrored in the console).
  • After a metered run completes, the orchestrator debits prompt_tokens × rate + completion_tokens × rate (configurable per environment).
  • Free agents (Quick ask) complete with cost_wei: 0 and skip balance checks.
  • Custom agents are always metered.

Check balance

API
GET https://runlayer-y9kc.onrender.com/v1/billing/balance
Authorization: Bearer <token-or-key>

→ { "balance_wei": "1000000000000000000000", "unit": "wei" }

The console shows formatted credits in the top bar, playground, and Usage page.

Funding options

MethodWhenNotes
Onboarding grantNew workspaceInitial test credits from orchestrator config
Credit vault depositTestnet / mainnetERC20 approve + deposit; indexer credits wallet owner workspace
Dev top-upLocal orchestratorPOST /v1/billing/topup with dev secret (Usage page button)

Insufficient balance

Metered runs return 402 insufficient_prepaid_credits when balance is zero before execution, or when the post-run debit would overdraw.

Settlement token — beyond prepaid

The same ERC20 used for vault deposits is the platform settlement unit. Primary use today is prepaid compute credits. The token also anchors:

  • Vault accounting — on-chain deposit/withdraw balances per wallet before orchestrator indexing.
  • Network incentives — operator payouts and SLA bonds settled in the same asset as node registration.
  • Workspace limits — optional spend caps and API key budgets denominated in credits.
  • Integrator resale — ISVs prepay bulk credits and meter downstream customers using receipt ids.

On-chain vs off-chain

Deposits are on-chain; per-run debits are off-chain for latency and receipt granularity. Withdraw unused vault balance on-chain; run history reconciles via credit_ledger and cost_wei on each run.

See Smart contracts for vault interfaces and deployment order.