Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.livepeer.org/llms.txt

Use this file to discover all available pages before exploring further.


The live-video-to-video (Cascade) pipeline operates as a persistent streaming session instead of a discrete request-response exchange. Standard per-pixel or per-request billing does not map naturally to this model. Instead, Livepeer uses per-second compute billing for live AI: the gateway pays for the time the orchestrator’s GPU is actively running inference for the session.

Fee Calculation

The LivePaymentSender interface in go-livepeer handles per-second fee calculation and ticket generation for live AI sessions. It calculates the fee based on:
  • Elapsed seconds since the last payment was sent
  • Configured cost per hour advertised by the orchestrator
fee = elapsed_seconds × (cost_per_hour / 3600)
This fee is expressed in ETH (wei). The PM mechanism translates it into a ticket with the appropriate face value and win probability so the expected payout equals the computed fee. Payments are sent at regular intervals during the session. The orchestrator returns updated ticket parameters after each payment; the gateway uses those parameters for the next payment in the series.

Configuring Pricing

Orchestrators set per-second pricing for AI pipelines in aiModels.json. The pricing field is price_per_unit, and for live AI the unit is one second of inference time:
[
  {
    "pipeline": "live-video-to-video",
    "model_id": "comfystream",
    "url": "http://127.0.0.1:8188",
    "price_per_unit": 1000000000000000,
    "warm": true
  }
]
price_per_unit is in wei per second. 1000000000000000 wei = 0.001 ETH per second = 3.6 ETH per hour. Gateways set a maximum acceptable price via -maxPricePerUnit. Orchestrators whose price_per_unit exceeds this maximum are excluded from selection for that session.

State Management

Per-second billing requires stateful bookkeeping: the gateway must track how much time has elapsed since the last payment and how much ETH has been committed. In the remote signer model, this bookkeeping lives in the signer service instead of the gateway:
  • The gateway sends signerState (the accumulated bookkeeping state from the previous signing call) with each signTicket request
  • The signer updates the state (records elapsed time, adjusts balance) and returns the updated signerState alongside the signed ticket
  • The gateway stores the returned state and sends it with the next request
This design makes the signer stateless across restarts: the gateway carries the state, and the signer reconstructs its view from the state it receives. If a gateway sends a null state, the signer creates a fresh session. Failure to send the correct updated state (or sending stale state) leads to invalid tickets due to repeated nonces or incorrect fee calculations.

Payment Intervals

The gateway sends payments at configurable intervals during the session, not per-frame. The interval is set to balance two concerns: payment frequency (more frequent = smaller per-ticket amounts, smaller ETH commitment per interval) and overhead (more frequent = more signing calls and on-chain submissions). For production live AI workloads, the go-livepeer default payment interval is adequate. Custom gateway implementations using livepeer-python-gateway inherit the interval logic from LivePaymentSender in the remote signer.
Per-second compute billing applies specifically to the live-video-to-video pipeline. Batch AI pipelines (text-to-image, audio-to-text, etc.) use per-output-unit billing. See the individual pipeline reference pages for recommended pricing.

Probabilistic Micropayments

How PM tickets and face values translate per-second fees to on-chain settlement.

Remote Signer

How the remote signer manages LivePaymentSender state for off-chain gateways.

Real-Time AI Overview

The Cascade pipeline that uses per-second compute billing.

Alt-Gateway Overview

Python gateway implementation that integrates with LivePaymentSender.
Last modified on May 19, 2026