---
title: "Estimate run cost"
method: POST
path: "/api/v1/tools/estimate_run_cost"
---

# Estimate run cost

`POST /api/v1/tools/estimate_run_cost`

## Request

- Base URL: `https://www.trezalabs.com`
- URL: `https://www.trezalabs.com/api/v1/tools/estimate_run_cost`
- Auth: HTTP bearer

Estimate what one run of a pipeline will charge the credit balance, which steps the money goes to (`lines`), and whether the current balance covers it. Estimates use the draft graph, the same one run_pipeline executes. When a video step would render the same clip for far less on Veo 3.1 Lite, `cheaper` names it with the run's price on it. When the balance covers neither, `preview` prices a first look it does cover: the first video step alone as a short Veo 3.1 Lite clip, which run_pipeline with preview: true renders. Call this before running a pipeline you built or changed in this conversation, tell the person the price (and the preview's, when there is one), and wait for their go-ahead before run_pipeline. Pass the returned quoteId to run_pipeline: it starts the run at this price once, and refuses if the pipeline changed since (estimate again then). Clients that show panels put the estimate in front of them with a Start render button, which sends that go-ahead as their message.

## Request body

- object
  - `pipelineId` string, required

## Response `200`

The tool's result.

- object

## Other responses

- `400`: The arguments were refused. `error` says why.
- `401`: No API key, or one that is not valid.
- `402`: The credit balance does not cover this run.
- `403`: The API key lacks a permission this tool needs.
- `404`: No such tool, or the pipeline, run or asset is not on this account.
- `429`: Too many runs started or in progress. Wait, then try again.

---

[API](https://skmtc.dev/trezalabs/apis/treza-pipelines-api.md) · [All operations](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/revisions/a76574c1731b?raw)
