> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Pricing Configuration

> Configure Pricing for Livepeer Gateway Services

Gateways in Livepeer configure pricing to control costs and margins.
As consumers of video transcoding and AI services, gateways set maximum prices
they're willing to pay Orchestrators for processing work.

## Pricing Concepts

#### Payment Currency

All payments are made in ETH(wei) - **not** Livepeer tokens (LPT).

#### Pricing Models

1. Video Transcoding: Per video segment processed

* Unit: Pixels processed (width x height)
* Calculation: pixels processed × price per pixel

2. &#x20;AI Processing: Priced per capability /
   model.&#x20;

* Unit: Price per capability/model
* Calculation:
  * Per-pixel payments: Calculated as width × height × outputs
  * Per-request payments: Single payment per AI request
  * Live video payments: Interval-based payments during streaming (configurable)

## Pricing Configuration Flags

#### Video Transcoding Core Flags

> [card]
>
> Video
>
> **-maxPricePerUnit** `int` (default: 0 (wei))
>
> Maximum price per pixelsPerUnit (in wei `integer` or a custom currency
> format like 0.50USD or 0.02USD) for transcoding work
>
> > [!NOTE]
> >
> > &#x20;
> >
> > All pricing is in `wei` unless currency conversion is configured&#x20;
>
> **-pixelsPerUnit** `int` (default: 1)
>
> Number of pixels per pricing unit
>
> **-ignoreMaxPriceIfNeeded** `boolean` (default: false)
>
> Allow exceeding max price if no suitable Orchestrator exists

#### AI Processing Core Flags

> [card]
>
> AI
>
> **-maxPricePerCapability** `string` (default: none)
>
> JSON list (or `path/to/ai-pricing.json` file) of maximum prices per AI capability/model
>
> ```json icon="file" ExampleFormat.json theme={null}
> {
>   "capabilities_prices": [
>     {
>       "pipeline": "text-to-image",
>       "model_id": "stabilityai/sd-turbo",
>       "price_per_unit": 1000,
>       "pixels_per_unit": 1
>     }
>   ]
> }
> ```
>
> **-livePaymentInterval** `duration` (default: 5s)
>
> Payment processing frequency (e.g. 5s, 10s, 300ms)for Live AI Video workflows, where the gateway needs to send periodic payments to the orchestrator.

## Fee Payment Calculation & Process

Gateways pay fees through different mechanisms depending on workload type:

*Video Transcoding*

* Per-segment payments: Each video segment generates a payment ticket -> [ segment\_rpc.go:](https://github.com/livepeer/go-livepeer/blob/5691cb48/core/segment_rpc.go)
* Fee calculation: Based on pixels processed × price per pixel -> [ segment\_rpc.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/core/segment_rpc.go)

*AI Processing*

* Per-pixel payments: Calculated as width × height × outputs [ live\_payment.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/core/live_payment.go)
* Live video: Uses interval-based payments during streaming [ ai\_http.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/server/ai_http.go)

*Payment Processing Flow*

1. Gateway sends payment with segment/request to orchestrator [ live\_payment.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/core/live_payment.go)
2. Orchestrator validates payment and updates balance [ segment\_rpc.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/core/segment_rpc.go)
3. Fees are debited from gateway's balance account [ ai\_http.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/server/ai_http.go)

## Configuration Methods

Gateways set maximum prices they're willing to pay through configuration flags in
the `transcodingConfig.json` or directly in the CLI.

1. **Command-line** flags
   ```bash icon="terminal" theme={null}
     -maxPricePerUnit=1000 \
     -pixelsPerUnit=1
   ```
2. **JSON Configuration** file (plain text key value format)

For AI capabilities, use JSON files with model-specific pricing

3. **HTTP API** - can be used at runtime to make adjustments without restart
   * /setBroadcastConfig: Set general pricing
   * /setMaxPriceForCapability: Set AI model pricing
4. **CLI Tool**

Use livepeer\_cli -> **Option 16**: "Set broadcast config"

## Orchestrator Configuration & Price Information (Gateway Reference)

A reference for Gateway Operators on how Orchestrators configure pricing and fees for services.

#### Per-Gateway Pricing (can be set by Orchestrators)

Orchestrators can set specific prices for individual gateways using
`-pricePerGateway` [ starter.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/cmd/livepeer/starter.go)

```json icon="terminal" theme={null}
{
  "gateways": [
    {
      "ethaddress": "0x123...",
      "priceperunit": 0.5,
      "currency": "USD",
      "pixelsperunit": 1000000000000
    }
  ]
}
```

#### Price Calculation

The actual price calculation happens in the orchestrator's `priceInfo` function [ orchestrator.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/core/orchestrator.go)

1. Checks for fixed prices per manifest ID
2. Gets base price from orchestrator configuration
3. For AI workloads, sums prices of individual capability/model pairs
4. Applies auto-adjustment based on transaction costs if enabled

#### Dynamic Price Adjustment

Orchestrators can enable automatic price adjustments based on transaction costs - which is why it's important to set maxPricing flags -> [ orchestrator.go](https://github.com/livepeer/go-livepeer/blob/5691cb48/core/orchestrator.go)

```go icon="terminal" theme={null}
if !orch.node.AutoAdjustPrice {
    return basePrice, nil
}
// Apply overhead multiplier based on tx costs
overhead := big.NewRat(1, 1)
if basePrice.Num().Cmp(big.NewInt(0)) > 0 {
    txCostMultiplier, err := orch.node.Recipient.TxCostMultiplier(sender)
    if txCostMultiplier.Cmp(big.NewRat(0, 1)) > 0 {
        overhead = overhead.Add(overhead, new(big.Rat).Inv(txCostMultiplier))
    }
}
```

## Full List of Gateway Pricing Configuration Flags

#### Video Transcoding Pricing Flags

#### AI Processing Pricing Flags

#### Payment Ticket Flags

#### Gas & Transaction Flags (Affect Pricing)

#### Orchestrator-Specific Pricing (For Reference)

#### Notes

* **Gateway flags** control what you **pay** (max prices)
* **Orchestrator flags** control what you **charge** (actual prices)
* AI pricing uses the `maxPricePerCapability` JSON structure for per-model pricing
* All prices can be specified in wei or with currency suffix (e.g., "0.50USD")
* Default "0" values mean accept any price or use system defaults

## Related Pages

> [card] [Gateway Economics](/v2/gateways/concepts/business-model.md)
>
> How gateways earn fees for services

> [card] [Funding Your Gateway](/v2/gateways/guides/payments-and-pricing/fund-gateway.md)
>
> How to fund your gateway.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.