# Introduction

{% hint style="info" %}
Treza is the node editor for generative media. Chain the best video, image, and language models into a pipeline on a visual canvas, run it from a prompt, then publish it behind one API.
{% endhint %}

***

## What is Treza?

Treza turns one prompt into video, images, and text. You build a workflow by wiring models, tools, and guardrails together as nodes on a drag-and-drop canvas, with no glue code between the pieces.

Every pipeline becomes a versioned HTTP endpoint you can call from your product, your scripts, or an AI agent, either with the typed `/invoke` API or an OpenAI-compatible `/chat/completions` drop-in.

***

## Why teams use Treza

* **Every modality on one canvas.** Video with Seedance 2.5 and Veo 3.1, images with Gemini image models, and text with open models like Llama, DeepSeek, and Qwen, plus transcription and embeddings. Pick a model per node and change it any time.
* **No lock-in.** Models run through an OpenAI-compatible backend across providers like Together, OpenRouter, Fireworks, and DeepSeek. Not listed? Type any Hugging Face or OpenRouter model id straight into the node. Bring your own provider keys, stored encrypted.
* **One API, two ways to call it.** Every published pipeline gets a versioned endpoint. Use the typed `/invoke` API for JSON in and JSON out, or point any OpenAI SDK at the `/chat/completions` endpoint, streaming included.
* **Guardrails when you want them.** Drop redaction, PII, and conditional-routing nodes into any pipeline so sensitive data is handled before it reaches a model or an external system.
* **Team and Enterprise plans available.**
* **Production-ready.** Automatic retries and fallback models, and a KMS-encrypted secrets manager for the keys your pipelines use.

***

## Start here

* [**Concepts**](/getting-started/concepts) - pipelines, nodes, models, runs, and published endpoints.
* [**Build your first pipeline**](/pipelines/quickstart) - go from a prompt to a published API in a few minutes.
* [**Models**](/pipelines/models) - the model catalog and how to use any model id.
* [**Pipeline API**](/api/pipeline-api) - call a published pipeline over HTTP.

***

## Build with Treza

* [**Pipeline API**](/api/pipeline-api) - the typed `/invoke` and OpenAI-compatible `/chat/completions` endpoints on every published pipeline.

***

![Build with Treza - one prompt into video, images, and text behind one API](https://3934055398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfDWhRrBcfxg5TQJxGqVx%2Fuploads%2Fgit-blob-b8d120fb43271d7b8cd5c7bd13ea7e5df259fb07%2Fbuild-with-treza.png?alt=media)

### Links

* [Website](https://trezalabs.com)
* [Platform](https://trezalabs.com)
* [Documentation](https://docs.trezalabs.com)
* [Twitter](https://twitter.com/trezalabs)
* [Telegram](https://t.me/trezalabs)

***


# Concepts

The core of Treza is the **pipeline**: a graph of nodes that turns inputs into generated media. Everything else, from the visual editor to the published API, is built around it. Start with the concepts below.

***

### Pipelines

#### What they are

A pipeline is a directed graph of nodes that you build on the visual canvas. Data flows along the edges from one node to the next: an input becomes a prompt, a prompt becomes a video, a video gets a caption. A pipeline has a **draft** you edit and, once you publish, a versioned **published** snapshot that serves API traffic.

#### Core ideas

* **Draft vs. published.** You edit the draft freely. Publishing takes a snapshot and assigns it a version number. API calls always run the published snapshot, never your in-progress draft.
* **Contract.** Treza derives an input/output contract from your input and output nodes. The input keys you send to the API, and the output keys you get back, come from this contract.
* **Ownership.** Pipelines and API keys are scoped to your account. A key can only invoke pipelines owned by the same account.

#### Typical flow

1. Start from a prompt or a template on the canvas.
2. Wire nodes together and run the pipeline to test it.
3. Publish to get a versioned endpoint.
4. Call the endpoint from your product, scripts, or an agent.

***

### Nodes

#### What they are

Nodes are the building blocks on the canvas. Each node does one job and passes its output to the next. You add them from the palette and connect them by dragging edges.

#### Common node types

* **Input** - the entry point that accepts a value from the editor or an API call.
* **Model / generation** - video, image, language, audio, or embedding models. Pick a model per node.
* **Prompt / transform** - reshape text between steps, for example refining a brief into a shot prompt.
* **Guardrail** - redaction, PII, and conditional-routing nodes that handle sensitive data before it reaches a model or an external system.
* **Output** - the value returned by the pipeline. Output nodes define the response contract.

***

### Models

#### What they are

Every generation node runs a model. Treza reaches models through an OpenAI-compatible backend spanning providers like Together, OpenRouter, Fireworks, and DeepSeek, so you are never tied to one vendor.

#### Core ideas

* **One model per node**, changeable at any time with no rewrites.
* **Any model id.** Pick from the catalog or type any Hugging Face or OpenRouter model id straight into the node.
* **Bring your own keys.** Provider keys are stored encrypted and used server-side.

See the [Models](/pipelines/models) page for the catalog and the [Secrets](#secrets) concept for provider keys.

***

### Runs & versions

#### What they are

A **run** is a single execution of a pipeline, whether triggered from the editor or over the API. Every run is recorded with per-node timing, token counts, cost, and status.

#### Core ideas

* **Run history.** Inspect any run node by node to see exactly how a prompt became an output. Filter by trigger (editor vs. API).
* **Versioning.** Each publish creates a new version. You can roll back to an earlier version at any time.
* **Export.** Export run history for SOC 2, HIPAA, or an internal audit.

***

### Published endpoints & API keys

#### What they are

Publishing a pipeline exposes it as a versioned HTTP endpoint under `https://trezalabs.com/api/pipelines/<id>`. You authenticate with a Treza API key (`treza_live_...`), created on the **API keys** page and sent as a bearer token.

#### Two ways to call it

* **Typed** - `POST /api/pipelines/<id>/invoke` with `{ "inputs": { ... } }` returns a `runId`; poll `GET .../invoke?runId=...` for JSON keyed by the output contract.
* **OpenAI-compatible** - `POST /api/pipelines/<id>/chat/completions`, a drop-in for any OpenAI SDK, streaming included.

See the [Pipeline API](/api/pipeline-api) reference for full request and response shapes.

***

### Guardrails

#### What they are

Guardrail nodes handle sensitive data inside a pipeline. The redaction and PII nodes strip personal data before it reaches a model or an external system; conditional-routing nodes branch the graph based on the data.

***

### Secrets

#### What they are

The secrets manager stores provider API keys and other credentials your nodes need. Values are envelope-encrypted with KMS at rest, never returned by any API, and injected server-side at run time, so your pipeline can call a provider without your application handling the key.

***

### Billing & credits

#### What it is

Treza is **prepaid credits**, with no subscription. You buy a credit pack once (starting at $5), and credits are spent as your pipelines run models. A failed generation costs nothing; if a run stops partway, the steps that finished are charged. Signing up is free, your first top-up gets up to $5 extra, and purchased credits never expire. Track your balance and spend in billing settings.

***

### See Also

* [**Build your first pipeline**](/pipelines/quickstart) → *Go from a prompt to a published API*
* [**Models**](/pipelines/models) → *The model catalog and how to use any model id*
* [**Pipeline API**](/api/pipeline-api) → *Call a published pipeline over HTTP*
* [**Publishing & versioning**](/pipelines/publishing) → *Publish, version, and roll back*

***


# Overview

A **pipeline** is a graph of nodes that turns one prompt into video, images, and text. You build it on a drag-and-drop canvas, wiring models, prompts, and guardrails together with no glue code between the pieces. When it works, you publish it behind one versioned API.

***

## How it works

1. **Start with a prompt.** Type what you want to make, a product video, a campaign image, launch copy, or open a template like Product Demo Video and tweak the brief.
2. **Chain the models.** Wire Veo, Gemini Image, Llama, or any open model together on the canvas. One node refines your brief into a shot prompt, the next renders it. Swap models per node, no rewrites.
3. **Publish behind one API.** Every pipeline becomes a versioned endpoint. Generate from your product, scripts, or agents with the typed `/invoke` API or an OpenAI-compatible streaming endpoint.

***

## What a pipeline is made of

* **Nodes** - the building blocks on the canvas. Input nodes accept values, model nodes generate media, prompt and transform nodes reshape data between steps, guardrail nodes handle sensitive data, and output nodes define the response.
* **Edges** - the connections that pass each node's output to the next.
* **Contract** - the input and output keys, derived from your input and output nodes, that define the pipeline's API surface.
* **Versions** - each publish snapshots the graph and assigns a version number that API traffic runs against.

See [Concepts](/getting-started/concepts) for the full model.

***

## What you can build

* **Video** with Seedance 2.5 and Veo 3.1.
* **Images** with Gemini image models.
* **Text** with open models like Llama, DeepSeek, and Qwen.
* **Audio and embeddings** for transcription and retrieval steps.

Because each generator is a node, a single prompt can drive several modalities in one pipeline: refine a brief, render a clip, draft a caption, and transcribe the result, all in one run.

***

## In this section

* [**Build your first pipeline**](/pipelines/quickstart) - from a prompt to a published API in a few minutes.
* [**Models**](/pipelines/models) - the catalog and how to use any Hugging Face or OpenRouter model id.
* [**Publishing & versioning**](/pipelines/publishing) - publish, version, roll back, and read run history.

For calling a published pipeline from code, see the [Pipeline API](/api/pipeline-api).


# Build your first pipeline

Go from a prompt to a published API in a few minutes. You will build a small pipeline on the canvas, run it, publish it, then call it over HTTP.

***

## Prerequisites

* A Treza account. Sign in at [trezalabs.com](https://trezalabs.com/).
* Credits for model runs. Packs start at $5, your first top-up gets up to $5 extra, and you can top up in billing settings any time.

***

## 1. Create a pipeline

In the dashboard, open **Pipelines** and create a new pipeline, or start from a template like **Product Demo Video** and tweak it. You land on the canvas with an empty graph.

***

## 2. Add and wire nodes

Drag nodes from the palette onto the canvas and connect them by dragging an edge from one node's output to the next node's input. A simple starter graph:

1. **Input** - accepts the brief, for example a product description.
2. **Prompt / transform** - refines the brief into a proper shot prompt.
3. **Model (video or image)** - renders the prompt with a model like Veo 3.1 or a Gemini image model.
4. **Output** - returns the generated asset.

Pick a model on each generation node. You can change it any time, or type any Hugging Face or OpenRouter model id directly into the node. See [Models](/pipelines/models).

***

## 3. Run it

Click **Run**. Treza executes the graph and shows each node's status, output, timing, and token counts. Runs happen in the background, so you can keep editing while a video renders. Open **Run history** to inspect any past run node by node.

If a node needs a provider key, add it to the [secrets manager](/getting-started/concepts#secrets) first. Keys are stored encrypted and injected at run time.

***

## 4. Publish

When the pipeline works, click **Publish**. Publishing takes a snapshot of the graph and assigns it a **version number**. API traffic always runs the published snapshot, never your in-progress draft. Re-publish any time to cut a new version, and roll back from **Publishing & versioning** if you need to. See [Publishing & versioning](/pipelines/publishing).

***

## 5. Create an API key

Open the **API keys** page and create a key. The key (`treza_live_...`) is shown once at creation, so store it in a secrets manager. You send it as the `Authorization: Bearer` header on every call. A key can only invoke pipelines owned by the same account.

***

## 6. Call your pipeline

Every published pipeline exposes two endpoints. Use the typed `/invoke` endpoint for JSON in and JSON out:

```bash
curl https://trezalabs.com/api/pipelines/<pipeline-id>/invoke \
  -H "Authorization: Bearer treza_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": {
      "brief": "A 6-second product demo of a matte-black water bottle on a kitchen counter"
    }
  }'
```

The input keys (`brief` above) come from your input nodes. Runs execute in the background, so `/invoke` returns a `runId` right away:

```json
{
  "runId": "2026-07-10T18:30:00.000Z#a1b2c3d4",
  "status": "running",
  "version": 3,
  "statusUrl": "https://trezalabs.com/api/pipelines/<pipeline-id>/invoke?runId=..."
}
```

Poll `statusUrl` (a `GET .../invoke?runId=...` with the same key) until `status` is no longer `running`; the finished response is keyed by your output nodes:

```json
{
  "runId": "2026-07-10T18:30:00.000Z#a1b2c3d4",
  "status": "success",
  "version": 3,
  "outputs": { "video": "https://.../output.mp4" },
  "usage": { "total": 1234, "costUsd": 0.42 },
  "durationMs": 48213
}
```

Prefer an OpenAI-compatible call, or want streaming? Point any OpenAI SDK at the `/chat/completions` endpoint instead. See the full [Pipeline API](/api/pipeline-api) reference.

***

## Next steps

* [**Models**](/pipelines/models) - the catalog and using any model id.
* [**Publishing & versioning**](/pipelines/publishing) - versions, rollback, and run history.
* [**Pipeline API**](/api/pipeline-api) - both endpoints, auth, errors, and streaming.


# Models

Every generation node in a pipeline runs a model. Treza reaches models through an OpenAI-compatible backend that spans providers like Together, OpenRouter, Fireworks, and DeepSeek, so you can pick the best model for each step and never get locked into one vendor.

***

## The catalog

The catalog covers every modality. Pick a model per node from the lists below, or type any model id straight in (see [Any model id](#any-model-id)).

### Video

Cinematic clips from a sentence, with duration and aspect ratio set per node.

* Seedance 2.5
* Seedance 2.0
* Veo 3.1
* Veo 3.1 Fast
* Kling 3.0 Pro
* Wan 3.0
* Wan 2.6

### Image

Product shots, illustrations, and campaign art with full response metadata.

* Gemini 2.5 Flash Image
* Gemini 3 Pro Image

### Language

Drafting, rewriting, classification, and reasoning with open-weight models.

* Llama 3.3 70B
* DeepSeek R1
* Qwen2.5 72B
* Mixtral 8x22B

The catalog also covers the major open families: Llama, Mistral, Qwen, DeepSeek, Gemma, and Phi, plus hosted Claude and GPT models.

#### Reasoning

Some hosted models can think before they answer. On a Text Generation node this is a per-node **Reasoning** setting: Off, Low, Medium, or High. Off is the default and the right choice for prompt-driven steps such as picking a clip, rewriting copy, or classifying, where the instructions already carry the rules. Turn it up for a node that has to weigh data it is given. Thinking is billed as output tokens; when reasoning is on, the node raises its request cap so the reply still fits inside Max tokens. Models without reasoning ignore the setting.

### Audio & embeddings

Transcribe speech and vectorize text for search and retrieval steps.

* Whisper Large v3
* BGE Large EN

***

## Any model id

Not listed? Type any Hugging Face or OpenRouter model id directly into the node and Treza will route to it through the OpenAI-compatible backend. This means new models are usable the day they ship, without waiting for them to be added to the catalog.

***

## Swap models, no lock-in

* **One model per node**, changeable at any time. Swapping a model never requires rewriting the rest of the pipeline.
* **Per-node choice.** Use a fast, cheap model to refine a brief and a premium model to render the final asset.
* **Bring your own keys.** Store provider API keys in the encrypted [secrets manager](/getting-started/concepts#secrets). Keys are used server-side and never returned by any API, so you are never tied to one price or one vendor.

***

## Cost

Model runs are paid for with prepaid credits. A failed generation costs nothing; if a run stops partway, the steps that finished are charged. There is no subscription: you buy credits once and spend them as you run models. Every run records its token counts and cost in [run history](/pipelines/publishing#run-history).


# Groups & recipes

Nodes are primitives: each one does a single, predictable thing. Real work is usually several of them in a particular arrangement, and that arrangement is worth keeping. Groups let you collapse one into a single card; recipes let you save it and drop it into any pipeline.

***

## Groups

Select two or more nodes and press **Ctrl/Cmd+G**. They collapse into one card on the canvas, and wires drawn to the card attach to the right nodes inside it.

A group is a view, not a change to the graph. Membership is stored on the nodes themselves, so runs, validation and publishing all still see a plain flat graph. Nothing about grouping changes what a pipeline does.

* **Double-click** a card to open the group in its own tab above the canvas.
* **Ctrl/Cmd+Shift+G** dissolves a group and returns its nodes to the canvas.
* Groups do not nest. Grouping a selection that includes a group merges its nodes in.

***

## Settings on the card

A group is only usable without opening it if someone decides which few settings matter. That is what exposing a field does.

1. Open the group and select a node inside it.
2. Scroll to **On the group card** at the bottom of its settings.
3. Tick the fields worth surfacing.

Back on the main canvas, selecting the group shows just those settings. Changing one writes straight through to the node that owns it. Everything else stays inside, one double-click away.

Exposed fields work for plain settings: text, numbers, toggles and dropdowns. Model pickers and media fields keep their own upload and catalog interfaces, so the card points to the node that holds them instead.

***

## Recipes

A saved group you can drop into any pipeline.

Select a group and click **Save as recipe**. Give it a name, a short description of what it does, and an icon. It appears in the palette under **Recipes**, above the node categories.

To use one, click it or drag it onto the canvas. It arrives as its own collapsed group with the settings you exposed already on the card.

Recipes belong to your account and are available in every pipeline you own.

***

## Recipes are copies

Inserting a recipe copies real, independent nodes onto the canvas. From that moment they are ordinary nodes.

**Editing a recipe later does not change pipelines that already used it.** This is deliberate. A live link would mean editing a recipe silently altering every pipeline built from it, including ones that publish on a schedule without anyone watching. Re-applying an improvement by hand is the safer half of that trade.

Two things are deliberately left behind when you save a recipe:

* **Group membership**, because each insert joins a fresh group.
* **Pinned run outputs** from lock-and-re-run, because a pin refers to one run of one pipeline. A copy carrying someone else's media would be worse than one carrying none.

***

## Worked example: a comedic sting

A reaction beat in a short video is five primitives in a row:

| Node              | What it does                                                     |
| ----------------- | ---------------------------------------------------------------- |
| **Find Beat**     | Locates a line in the transcript and returns the moment it lands |
| **Freeze Frame**  | Holds the frame there                                            |
| **Punch In**      | Snaps the framing closer for that moment                         |
| **Desaturate**    | Drains the colour                                                |
| **Audio Overlay** | Lays a recognisable sound over the narration                     |

Wire them, group them, expose **Hold**, **Amount** and **Gain** on the card, and save it as "Comedic sting". Anyone using it gets three knobs and never has to know it is five nodes.

That is the general shape. When you find yourself wanting a node called "comedic sting", what you actually want is a recipe: the primitives stay predictable, and the arrangement carries the intent.


# Video effects

Single-purpose effects you can apply to a whole clip or to one moment in it. Each does one thing, so you compose the look you want rather than picking a preset that nearly fits.

***

## They never change the clip's length

Every effect here covers the stretch of video it applies to, rather than being inserted in front of it. A freeze holds the picture over that moment; it does not push the rest of the video later.

That matters more than it sounds:

* **Audio is never touched.** Narration keeps playing underneath a freeze instead of pausing for it.
* **Nothing downstream shifts.** Burned-in captions stay on the words, and the clip ends when it always did.
* **Effects stack.** Point several at the same moment and each one applies without moving the others.

***

## Find Beat

Locates a phrase in a transcript and returns when it lands, in seconds.

Wire the words you want to hit and a transcript from a **Transcribe** node. Everything else in this section can take the result as its **At** input.

| Setting     | Notes                                                                                                                                                                    |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Land on** | The end of the phrase (default) lets the line finish before the effect fires. The start is for effects that should run underneath the words instead of reacting to them. |
| **Offset**  | Nudges the moment. The small negative default keeps the matched word on screen, since a word ends exactly as the next caption swaps in.                                  |

If the phrase is not in the transcript, Find Beat returns an empty result and says so in the run. It does not fail the run — a phrase that was never spoken is a normal outcome, and the effects downstream simply do nothing.

***

## Freeze Frame

Holds a single frame for a moment. Needs something wired into **At**; without one it passes the video straight through.

**Hold** sets how long the frame holds.

***

## Punch In

Snaps the framing closer. **Amount** is a percentage: 100 keeps the framing, 125 snaps in a quarter closer.

**Apply to** decides the scope:

* **A moment** (default) needs an **At**, and does nothing without one.
* **The whole clip** ignores **At** entirely.

The default is deliberate. When this hangs off a Find Beat that came up empty, doing nothing is right, and punching in on an entire episode is not.

***

## Desaturate

Drains the colour. Takes the same **Apply to** scope as Punch In.

**Contrast** is lifted slightly by default. Colour carries a lot of the separation in a frame, and removing it without any contrast back tends to read as flat rather than stylised.

***

## Sound Effect

Outputs the URL of a bundled one-shot, ready to wire into **Audio Overlay**:

* **Fahh** — recoiling at something gross or absurd
* **Vine boom** — a hit, a reveal, sudden emphasis
* **Record scratch** — wait, what? something undercut

These are widely recognised on purpose. The effect depends on the audience already knowing the sound, which is also why matching the sound to the beat matters: a reaction is not a reveal.

***

## Audio Overlay

Lays a sound over the video's own audio.

Wire a **video**, an **audio** source (a Sound Effect node, an Audio Generation node, or any audio URL) and optionally an **At** for when it starts.

**Nothing is ducked.** The sound plays on top of the narration rather than in place of it, and a one-shot longer than the moment rings out over the resumed picture instead of being cut to fit. **Gain** adjusts only the overlaid sound; the clip's own audio is left exactly as it was.

***

## Chaining them

Effects are separate nodes, so each one is its own render pass. Chaining four costs four passes of time and a little image quality, which is the price of being able to compose them freely. In practice that is a few extra seconds on a short.

Two habits keep it cheap:

* Point every effect in a chain at the same **Find Beat** output rather than repeating a timestamp.
* Group the chain and [save it as a recipe](/pipelines/groups-and-recipes) once it looks right, so the next pipeline reuses it instead of rebuilding it.

***

## When a moment falls outside the clip

If the moment lands past the end of the video, the effect is skipped and the run continues with a note explaining why. Losing a finished render over a missed effect costs far more than missing the effect.


# Publishing & versioning

Publishing turns a pipeline into a versioned HTTP endpoint. This page covers how versions work, how to roll back, and how to read run history.

***

## Draft vs. published

Every pipeline has two states:

* **Draft** - the graph you edit on the canvas. Running from the editor executes the draft.
* **Published** - a frozen snapshot that serves API traffic. The `/invoke` and `/chat/completions` endpoints always run the published snapshot, never your in-progress draft.

This separation means you can keep editing a live pipeline without affecting production calls until you publish again.

***

## Versions

Each time you publish, Treza snapshots the current graph and assigns it an incrementing **version number**. The version is returned on every API response (the `version` field on `/invoke`, and the `x-treza-pipeline-version` header on `/chat/completions`), so you always know which snapshot produced a result.

* Re-publish to cut a new version after editing the draft.
* API keys and the endpoint URL stay the same across versions. Only the running snapshot changes.

***

## Rollback

If a new version misbehaves, roll back to an earlier one from the pipeline's publishing controls. Rollback re-points the published snapshot at a previous version without changing your draft, so live traffic recovers immediately while you fix the draft.

***

## Run history

Every execution, whether triggered from the editor or over the API, is recorded as a **run**. Each run captures:

* **Per-node timing** - how long each node took.
* **Tokens and cost** - token counts and the provider cost charged.
* **Status** - success or error, with the failing node surfaced on errors.
* **Trigger** - whether the run came from the editor or the API.
* **Version** - which published version served the run.

Open **Run history** on a pipeline to inspect any run node by node and see exactly how a prompt became an output.

***

## Usage & insights

The **Usage & insights** view aggregates across your account: total runs, runs via API, tokens, credits used, and success rate over the last 30 days, plus a per-pipeline breakdown. Use it to watch spend and reliability at a glance. You can export run history for SOC 2, HIPAA, or an internal audit.

***

## Requirements for API calls

For a pipeline to serve API traffic it must:

* Be **published** (an unpublished pipeline returns `409`).
* Have at least one **input node** (an entry point to accept the request).
* Have at least one **output node** (to return a result).

See the [Pipeline API](/api/pipeline-api) for the full request and response contract.


# Pipeline API

Every published pipeline is a versioned HTTP endpoint. There are two ways to call it: the typed **`/invoke`** endpoint for JSON in and JSON out, and an OpenAI-compatible **`/chat/completions`** endpoint that works as a drop-in for any OpenAI SDK, streaming included.

***

## Base URL

```
https://trezalabs.com
```

Both endpoints live under `/api/pipelines/<id>`, where `<id>` is the pipeline's id from the dashboard. They accept and return `application/json` (the streaming variant returns Server-Sent Events).

***

## Authentication

Authenticate with a Treza API key, created on the **API keys** page in the dashboard and sent as a bearer token:

```
Authorization: Bearer treza_live_...
```

The key (`treza_live_...`) is shown once at creation. Store it in a secrets manager. A key can only invoke pipelines owned by the same account, and the pipeline must be **published**.

Starting a run (`POST .../invoke` and `/chat/completions`) needs the `pipelines:run` scope. Polling a run (`GET .../invoke`) accepts `pipelines:read` or `pipelines:run`. A key without the scope gets `403` with `code: "MISSING_SCOPE"`. See [API Keys](/api/api-keys).

***

## Prerequisites

For a pipeline to accept API calls it must be published and have at least one input node and one output node. The **input keys** you send and the **output keys** you receive are derived from those nodes (the pipeline's contract). See [Publishing & versioning](/pipelines/publishing).

***

## Limits and credits

* **Rate limit.** 60 requests a minute per account, shared by `POST .../invoke` and `/chat/completions`. Past it you get `429` with `code: "RATE_LIMITED"` and `retryAfter` (seconds), plus `Retry-After` and `X-RateLimit-*` headers.
* **Concurrent runs.** Up to 10 runs of one pipeline can be in progress from `/invoke` at once. The next one gets `429` with `code: "TOO_MANY_CONCURRENT_RUNS"`.
* **Credits.** Runs draw from your account's prepaid credit balance. Before a run starts, the balance has to cover its estimated charge, and on `/invoke` also what is already committed to your runs still rendering. Check it with `GET /api/account/balance` and the same API key (see [Funding an account without a human](/api/x402-payments#funding-an-account-without-a-human)).

When the balance falls short, the run is refused with `402` before anything is charged:

```json
{
  "error": "This run generates media estimated at ~$1.06 in credits and your balance is $0.40. Add $0.66 in credits to run it.",
  "code": "INSUFFICIENT_CREDITS",
  "balanceUsd": 0.4,
  "topUpUrl": "https://www.trezalabs.com/platform/settings",
  "x402TopUpUrl": "https://www.trezalabs.com/api/billing/credits/x402"
}
```

`topUpUrl` is where a person adds credits. `x402TopUpUrl` lets an agent with a wallet top up on its own (see [x402 Payments](/api/x402-payments)). On `/chat/completions` the same fields sit inside the `error` object, with `type: "billing_error"`.

***

## `POST /api/pipelines/{id}/invoke`

Starts a run of the published pipeline with typed inputs. Runs execute asynchronously on Treza's background workers, so this returns a `runId` immediately. Poll [`GET .../invoke`](#get-api-pipelines-id-invoke) for the result. Use this endpoint for video and other long runs.

### Request

```bash
curl https://trezalabs.com/api/pipelines/<id>/invoke \
  -H "Authorization: Bearer treza_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": {
      "brief": "A 6-second product demo of a matte-black water bottle on a kitchen counter"
    }
  }'
```

| Field    | Type   | Description                                                                  |
| -------- | ------ | ---------------------------------------------------------------------------- |
| `inputs` | object | Map of the pipeline's input keys to values. Keys come from your input nodes. |

### Response `202 Accepted`

```json
{
  "runId": "2026-07-10T18:30:00.000Z#a1b2c3d4",
  "status": "running",
  "version": 3,
  "statusUrl": "https://trezalabs.com/api/pipelines/<id>/invoke?runId=2026-07-10T18%3A30%3A00.000Z%23a1b2c3d4"
}
```

| Field       | Description                                         |
| ----------- | --------------------------------------------------- |
| `runId`     | Id of the run to poll. Also appears in run history. |
| `status`    | Always `running` on accept.                         |
| `version`   | The published version serving the run.              |
| `statusUrl` | Ready-made URL to poll for status and outputs.      |

***

## `GET /api/pipelines/{id}/invoke`

Polls a run started by `POST .../invoke`. Same bearer API key.

### Request

```bash
curl "https://trezalabs.com/api/pipelines/<id>/invoke?runId=<runId>" \
  -H "Authorization: Bearer treza_live_..."
```

| Query param | Description                                                |
| ----------- | ---------------------------------------------------------- |
| `runId`     | The `runId` returned by `POST .../invoke` (URL-encode it). |

### Response

While the run is in progress:

```json
{ "runId": "…", "status": "running", "version": 3, "startedAt": "…" }
```

Once finished:

```json
{
  "runId": "…",
  "status": "success",
  "version": 3,
  "startedAt": "2026-07-10T18:30:00.000Z",
  "finishedAt": "2026-07-10T18:30:48.000Z",
  "durationMs": 48213,
  "usage": { "prompt": 0, "completion": 0, "total": 1234, "costUsd": 0.42 },
  "outputs": { "video": "https://.../output.mp4" }
}
```

| Field        | Description                                                                            |
| ------------ | -------------------------------------------------------------------------------------- |
| `status`     | `running`, `success`, `error`, `partial`, or `cancelled` (stopped before it finished). |
| `outputs`    | Map keyed by the output nodes' keys of the version that ran (present once finished).   |
| `usage`      | Token counts and provider cost (`costUsd`) for the run.                                |
| `durationMs` | Wall-clock run time in milliseconds (once finished).                                   |

{% hint style="info" %}
Poll `statusUrl` every few seconds until `status` is no longer `running`. Video and image generation poll asynchronous provider jobs, so a run can take a while. Output **media URLs** are returned verbatim; long **text** outputs are truncated in the polled result. A failed run is reported here as `status: "error"`, not as an HTTP error.
{% endhint %}

Polling without `runId` returns `400`; a `runId` this pipeline does not have returns `404`.

***

## `POST /api/pipelines/{id}/chat/completions`

An OpenAI-compatible chat-completions endpoint. Point any OpenAI SDK at it by changing the base URL and API key. The latest user message is fed into the pipeline's entry node, and the output node's value is returned as the assistant message.

{% hint style="warning" %}
This endpoint keeps the request open until the whole run finishes, and gives up after about five minutes. That suits text and image pipelines. Most video pipelines take longer, so call those with [`/invoke`](#post-api-pipelines-id-invoke) and poll.
{% endhint %}

### curl

```bash
curl https://trezalabs.com/api/pipelines/<id>/chat/completions \
  -H "Authorization: Bearer treza_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "treza",
    "messages": [
      { "role": "user", "content": "A serene mountain lake at sunrise, cinematic" }
    ]
  }'
```

The `model` field is accepted but not used to pick a model (the pipeline's nodes decide that); send any string.

### Python (OpenAI SDK)

```python
from openai import OpenAI

client = OpenAI(
    api_key="treza_live_...",
    base_url="https://trezalabs.com/api/pipelines/<id>",  # SDK appends /chat/completions
)

completion = client.chat.completions.create(
    model="treza",
    messages=[{"role": "user", "content": "A serene mountain lake at sunrise, cinematic"}],
)

print(completion.choices[0].message.content)
```

### TypeScript (OpenAI SDK)

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'treza_live_...',
  baseURL: 'https://trezalabs.com/api/pipelines/<id>', // SDK appends /chat/completions
});

const completion = await client.chat.completions.create({
  model: 'treza',
  messages: [{ role: 'user', content: 'A serene mountain lake at sunrise, cinematic' }],
});

console.log(completion.choices[0].message.content);
```

### Response

A standard OpenAI chat-completion object:

```json
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1751904000,
  "model": "treza",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "https://.../output.png" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 1234 }
}
```

Two response headers help you tie a completion back to a run:

| Header                     | Meaning                                        |
| -------------------------- | ---------------------------------------------- |
| `x-treza-run-id`           | Id of the recorded run.                        |
| `x-treza-pipeline-version` | The published version that served the request. |

### Streaming

Set `"stream": true` to receive the response as Server-Sent Events, emitted as `chat.completion.chunk` objects and terminated by `data: [DONE]`. The final chunk carries `finish_reason: "stop"` and a `usage` block. Any OpenAI SDK's streaming mode works unchanged. The chunks are sent once the run has finished, so streaming does not shorten the wait or the five-minute limit.

***

## Errors

Every error response has an `error` field. On `/invoke` it is a message string, often next to a `code` you can branch on. On `/chat/completions` every error uses the OpenAI shape `{ "error": { "message": ..., "type": ..., "code": ... } }`, so an OpenAI SDK raises its usual exception with the message intact. `code` is set where `/invoke` has one (`MISSING_SCOPE`, `INSUFFICIENT_CREDITS`, `RATE_LIMITED`).

| Status | Meaning                                                                                                                                                                         |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | Malformed request: no `messages` on `/chat/completions`, or no `runId` when polling `/invoke`.                                                                                  |
| `401`  | Missing or invalid API key.                                                                                                                                                     |
| `402`  | Not enough credits for this run (`code: "INSUFFICIENT_CREDITS"`). See [Limits and credits](#limits-and-credits).                                                                |
| `403`  | The key's account does not own this pipeline, or the key lacks the scope (`code: "MISSING_SCOPE"`).                                                                             |
| `404`  | Pipeline not found, or (when polling) run not found.                                                                                                                            |
| `409`  | Pipeline is not published.                                                                                                                                                      |
| `422`  | `/chat/completions` only: the pipeline has no entry node or no output node.                                                                                                     |
| `429`  | Rate limit or concurrent-run limit. See [Limits and credits](#limits-and-credits).                                                                                              |
| `502`  | `/chat/completions` only: the pipeline ran but a node failed, and the error carries that node's message. On `/invoke` a failed run shows up as `status: "error"` when you poll. |
| `500`  | Internal server error.                                                                                                                                                          |

***

## Related

* [Build your first pipeline](/pipelines/quickstart) - end-to-end from the canvas.
* [Publishing & versioning](/pipelines/publishing) - versions, rollback, and run history.
* [API Keys](/api/api-keys) - creating keys and choosing scopes.
* [x402 Payments](/api/x402-payments) - topping up credits from an agent's wallet.


# API Keys

Treza API keys authenticate programmatic access to the platform: calling a published [pipeline](/pipelines/pipelines) and connecting AI assistants over the [MCP server](/api/mcp-server). A key looks like `treza_live_...`, is scoped to your account, and is sent as a bearer token.

***

## Create a key

In the dashboard, open the **API keys** page and create a key.

{% hint style="warning" %}
The key (`treza_live_...`) is shown **once**, at creation. Store it in a secrets manager immediately. If you lose it, revoke it and create a new one.
{% endhint %}

***

## Use a key

Send the key in the `Authorization` header as a bearer token on every request:

```
Authorization: Bearer treza_live_...
```

For example, invoking a published pipeline:

```bash
curl https://trezalabs.com/api/pipelines/<id>/invoke \
  -H "Authorization: Bearer treza_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "inputs": { "brief": "A 6-second product demo" } }'
```

The same key works with the OpenAI-compatible endpoint. Point any OpenAI SDK at your pipeline and pass the key as the `api_key`. See the [Pipeline API](/api/pipeline-api).

***

## Ownership and scope

* **Account-scoped.** A key can only act on resources owned by the same account. In particular, a key can only invoke pipelines your account owns; calls to another account's pipeline return `403`.
* **Published only.** Pipeline endpoints serve the published snapshot. An unpublished pipeline returns `409`.
* **Credits.** Calls that run a pipeline draw from your account's prepaid credit balance. If the balance is empty, requests return `402`.

***

## Scopes

Keys carry scoped permissions that gate access per feature. Grant only the scopes a key needs.

| Scope             | Grants                                                                                                                                                   |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pipelines:read`  | List pipelines and read run history over the [MCP server](/api/mcp-server), and poll runs with `GET .../invoke` on the [Pipeline API](/api/pipeline-api) |
| `pipelines:run`   | Start pipeline runs: `/invoke` and `/chat/completions` on the [Pipeline API](/api/pipeline-api), and over the [MCP server](/api/mcp-server)              |
| `pipelines:write` | Author and publish pipelines, and add to or edit your media library, over the [MCP server](/api/mcp-server)                                              |
| `keys:provision`  | Mint new keys with `create_api_key` over an OAuth connection. A key can never mint another key                                                           |

Invoking a published pipeline requires a valid key that owns the pipeline and carries `pipelines:run`.

***

## Manage and rotate

* **Revoke** a key from the API keys page the moment you suspect it is exposed.
* **Rotate** keys periodically: create a new key, move your integrations over, then delete the old one.
* **Never** embed a key in client-side code or a public repository. Call Treza from your backend, where the key stays secret.

***

## Related

* [Pipeline API](/api/pipeline-api) - call a published pipeline with your key.
* [MCP Server](/api/mcp-server) - connect Claude and other AI assistants with `pipelines:*` scopes.
* [Build your first pipeline](/pipelines/quickstart) - end-to-end, including creating a key.


# MCP Server

Treza ships a remote [Model Context Protocol](https://modelcontextprotocol.io/) server, so AI assistants like ChatGPT and Claude can build pipelines, run them, inspect the results, and turn media you already have into finished videos on your behalf.

```
https://www.trezalabs.com/api/mcp
```

The server speaks Streamable HTTP and authenticates every request. You can connect with OAuth (sign in with your Treza account, no key handling) or with an API key.

***

## Connect from ChatGPT

Treza is in ChatGPT's plugin directory, so there is no URL to paste:

1. Open [Treza in ChatGPT](https://chatgpt.com/plugins/plugin_asdk_app_6ab579a2fc24819199d8bea61fa8195f), or search for Treza under **Plugins** in ChatGPT, and add it.
2. You'll be sent to Treza to sign in with Google and approve access, then returned to ChatGPT. Signing in creates a Treza account if you don't have one.
3. Mention **@Treza** in a chat, for example "@Treza make a 30-second vertical video about the deep ocean with narration and captions."

***

## Connect from Codex

Codex shares ChatGPT's plugin catalog. In the ChatGPT desktop app, open the **Plugins** tab, open **Treza** and select the plus button. You'll be sent to Treza to sign in with Google and approve access.

In Codex CLI, add the server, then sign in. Adding it does not sign you in on its own:

```bash
codex mcp add treza --url https://www.trezalabs.com/api/mcp
codex mcp login treza
```

***

## Connect from Claude

Claude's web and desktop apps support custom connectors on every plan. Free plans can add one; on Team and Enterprise, an Owner adds it for the organization first.

1. Open **Customize → Connectors**, press **+ Add**, then **Add custom connector**.
2. Name it `Treza`, enter `https://www.trezalabs.com/api/mcp` and press **Continue**.
3. Under **OAuth client**, choose **Register automatically**, then press **Add**. You'll be sent to Treza to sign in and approve access, then returned to Claude.

Ask Claude things like "list my Treza pipelines" or "run my daily short pipeline and tell me when it finishes."

***

## Connect from Claude Code

```bash
claude mcp add --transport http --scope user treza https://www.trezalabs.com/api/mcp
```

Then run `/mcp` inside Claude Code, choose `treza` and sign in in the browser window that opens. `--scope user` makes Treza available in every project; leave it out to add it to the current project only. To use an [API key](/api/api-keys) instead:

```bash
claude mcp add --transport http treza https://www.trezalabs.com/api/mcp \
  --header "Authorization: Bearer treza_live_..."
```

***

## Connect from Muse

**Muse app.** Muse builds custom connectors itself, from an API description and a key:

1. In the dashboard, open the [API keys](/api/api-keys) page and create a key with `pipelines:read`, `pipelines:run` and `pipelines:write`.
2. In a Muse chat, say: "Create a custom connector for Treza. Its API is described at <https://www.trezalabs.com/openapi.json> and it takes an API key as a Bearer token."
3. When Muse asks for credentials, paste the key. Muse keeps it in its secure credentials store, not in the chat.

Muse is available in the US and Canada to people 18 and over.

**Muse Code.** Add Treza to `~/.config/muse/settings.json`. `schema_version` is required, the key is `mcp_servers` in snake case, and `"mode": "optional"` keeps a Treza outage from stopping your session (the default, `required`, aborts it):

```json
{
  "schema_version": 1,
  "mcp_servers": {
    "treza": {
      "transport": "streamable_http",
      "url": "https://www.trezalabs.com/api/mcp",
      "mode": "optional"
    }
  }
}
```

Then run `muse mcp login treza` and sign in in the browser.

***

## Connect from Gemini

**Gemini app.** Add Treza on the web, and it works in the Gemini mobile app too. Custom apps are for personal Google Accounts in the US, 18 and over, in English.

1. On gemini.google.com, click **Settings**, then **Connected Apps**. If you don't see it, open **Personal Intelligence** first.
2. Under **Custom apps**, click **Add a custom app** and enter `https://www.trezalabs.com/api/mcp`.
3. Click **Next**. You'll be sent to Treza to sign in with Google and approve access.

**Antigravity CLI.** Antigravity CLI replaced Gemini CLI for personal Google accounts in June 2026. Add Treza to `~/.gemini/config/mcp_config.json`, or `.agents/mcp_config.json` in a project. Antigravity needs `serverUrl`; it does not read `url` or `httpUrl`:

```json
{
  "mcpServers": {
    "treza": {
      "serverUrl": "https://www.trezalabs.com/api/mcp"
    }
  }
}
```

Type `/mcp` to open the MCP Manager, and Antigravity signs you in to Treza in the browser.

**Gemini CLI**, for Gemini API keys and enterprise licenses. Treza is a Gemini CLI extension:

```bash
gemini extensions install https://github.com/treza-labs/treza-plugin
```

Then run `/mcp auth treza` inside Gemini CLI and sign in. The extension also loads Treza's workflow skill, so Gemini checks your credits and tells you the price before it runs a pipeline.

***

## Connect from Cursor

Use the **Add to Cursor** button on [Treza's Cursor page](https://www.trezalabs.com/integrations/cursor), or add Treza to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project) and restart Cursor:

```json
{
  "mcpServers": {
    "treza": {
      "url": "https://www.trezalabs.com/api/mcp"
    }
  }
}
```

The first time the agent uses Treza, Cursor sends you to Treza to sign in and approve access.

***

## Connect from Hermes Agent

Add Treza under `mcp_servers` in `~/.hermes/config.yaml`. `auth: oauth` lets Hermes register itself with Treza, so no key goes in the file:

```yaml
mcp_servers:
  treza:
    url: "https://www.trezalabs.com/api/mcp"
    auth: oauth
```

Then sign in, and sign in to Treza with Google in the browser window that opens:

```bash
hermes mcp login treza
```

Start a new Hermes session, or run `/reload-mcp` in one that is already open. Hermes keeps the token in `~/.hermes/mcp-tokens/treza.json` and refreshes it on its own.

On a server with no browser, use an [API key](/api/api-keys) instead. Put it in `~/.hermes/.env` as `TREZA_API_KEY` and give the server a header in place of `auth: oauth`:

```yaml
mcp_servers:
  treza:
    url: "https://www.trezalabs.com/api/mcp"
    headers:
      Authorization: "Bearer ${env:TREZA_API_KEY}"
```

***

## Connect from Cline

In Cline's **MCP Servers** view, open **Remote Servers**, name the server `treza`, enter `https://www.trezalabs.com/api/mcp`, choose **Streamable HTTP**, and add it. Then click **Authenticate**: your browser opens Treza's sign-in page, and after you approve access you're returned to Cline.

To add it by hand instead, put this in `cline_mcp_settings.json`:

```json
{
  "mcpServers": {
    "treza": {
      "type": "streamableHttp",
      "url": "https://www.trezalabs.com/api/mcp"
    }
  }
}
```

Any other MCP client that supports Streamable HTTP works the same way: point it at the URL, and either complete the OAuth flow or send your key as a bearer token.

***

## Authentication and scopes

| Method  | How                                                         | Scopes                                                                 |
| ------- | ----------------------------------------------------------- | ---------------------------------------------------------------------- |
| OAuth   | Sign in with your Treza account when the client prompts you | `pipelines:read`, `pipelines:run`, `pipelines:write`, `keys:provision` |
| API key | `Authorization: Bearer treza_live_...` header               | Whatever the key was granted                                           |

API keys must carry the `pipelines:read` scope to connect, `pipelines:run` to start runs, and `pipelines:write` for the authoring tools. `assemble_video` and `edit_asset` need both `pipelines:run` and `pipelines:write`, because they save a pipeline and then run it. `import_media` and `create_upload_url` need `pipelines:write`, because they add to your library. Grant scopes when you create the key on the **API keys** page. See [API Keys](/api/api-keys).

{% hint style="info" %}
Connected before late August 2026? Your connection likely holds only the read and run scopes: the server used to advertise just `pipelines:read`, and clients request exactly what is advertised. Disconnect and re-add the connector to pick up the full set. Do the same after any server update that changes tool schemas, since clients cache the tool list when the session opens. The last such update, on 25 September 2026, added connecting a channel and publishing from the chat, and the panels for checking a price, picking files, and seeing a pipeline.
{% endhint %}

Access is account-scoped either way: the server only ever sees pipelines owned by the signed-in account, and requests for anything else return an error.

***

## Available tools

**Find and inspect work**

| Tool             | Description                                                                                                                                                                                                                                              |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list_pipelines` | List your pipelines with status, a summary of recent runs, and each schedule's state and next fire time                                                                                                                                                  |
| `get_pipeline`   | One pipeline's metadata, published-version info, full schedule state, plus a graph summary; pass `includeGraph` for the complete graph with every node's config, required reading before an update, since a graph rebuilt from the summary drops configs |
| `list_runs`      | Recent runs for a pipeline, newest first                                                                                                                                                                                                                 |
| `get_run`        | One run's status, per-node results, and output media URLs; a finished run also carries `outputs`, what its Output nodes returned, keyed the way the [Pipeline API](/api/pipeline-api) keys them                                                          |

**Author a pipeline** (requires `pipelines:write`)

| Tool                      | Description                                                                                                                                                                                                                               |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list_pipeline_templates` | Ready-made pipelines `create_pipeline` can copy, each with the entry node ids a run's `inputs` are keyed by                                                                                                                               |
| `list_node_types`         | Every node type available, by category                                                                                                                                                                                                    |
| `get_node_type`           | One node type's ports and config schema; on model-bearing nodes it includes the live model catalog with each model's supported durations, aspect ratios, and voices, and for video models what a second of video costs at each resolution |
| `create_pipeline`         | Create a pipeline from a template (`templateId`) or from a node graph. A graph with error-level issues is refused, with every issue listed, and nothing is saved                                                                          |
| `update_pipeline`         | Change an existing pipeline's graph or metadata. Send the whole graph back, as `get_pipeline` with `includeGraph` returns it; the same checks apply to what you change                                                                    |
| `publish_pipeline`        | Publish the current draft so scheduled and API runs pick it up                                                                                                                                                                            |
| `set_schedule_paused`     | Pause or resume a published pipeline's schedule without touching the deployed graph                                                                                                                                                       |

An assistant can learn the node vocabulary and build a working pipeline from a description. You do not have to draw one on the canvas first.

Every edge names the two nodes it joins and a port on each, for example `{"source": "music", "sourceHandle": "audio", "target": "sequence", "targetHandle": "shots"}`, using the port ids `get_node_type` lists. So that a saved pipeline runs the way it was asked to, the authoring tools refuse settings the pipeline would otherwise ignore or quietly change, and each refusal names what would work instead:

* a config key the node does not have, or a value outside a field's options or range
* a model id that is not in the live catalog, or a duration, aspect ratio, resolution, or voice the chosen model does not offer
* a new wire that uses the generic `in` or `out` port on a node with several ports on that side, where the engine would have to guess which one you meant (`update_pipeline` refuses it; `create_pipeline` warns, so a copy of a working pipeline still saves)

Only what the call changes is held to these checks. Resending an older pipeline unchanged never fails over settings it already had.

Schedules are authored as a `schedule-trigger` node and only fire from the published snapshot: a schedule that exists only on the draft is inert until `publish_pipeline` deploys it. Pausing flips a flag the schedule runner checks, so the published graph stays exactly what was deployed, and resuming starts from the next real slot instead of replaying the slots missed while paused.

**Finish media you already have** (`assemble_video` and `edit_asset` require `pipelines:run` and `pipelines:write`; `import_media` and `create_upload_url` require `pipelines:write`)

| Tool                | Description                                                                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list_assets`       | Your library of images, videos, and audio, newest first, filtered by kind or by words in the prompt that made them; the urls it returns are the ones `assemble_video` and `edit_asset` accept                 |
| `assemble_video`    | Join clips into one finished video, over a voiceover and a music bed (from your library, or composed from a description), with burned-in captions if you want them. Free once your account has bought credits |
| `edit_asset`        | Run any transform node over one file: captions, an upscale, background removal, lipsync, a crop, a trim, a logo in a corner of a video or a picture                                                           |
| `import_media`      | Add a file to your library: one you attached in ChatGPT, a public https link, or a local file uploaded through `create_upload_url`                                                                            |
| `create_upload_url` | A one-time link that a client able to run a command (Claude Code, Codex, Cursor, Hermes Agent) uploads a local file to, for `import_media` to add                                                             |
| `open_library`      | Your library on a page of its own, opened from ChatGPT's sidebar or beside a conversation. Only the panel calls it                                                                                            |

These need no graph. See [Finish media you already have](#finish-media-you-already-have) and [Bring in your own files](#bring-in-your-own-files) below.

**Budget and run**

| Tool                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `estimate_run_cost`       | Estimated charge for a pipeline before starting it, step by step, and a cheaper video model when one renders the same clip for far less                                                                                                                                                                                                                                                                                                   |
| `get_credit_balance`      | Prepaid balance, plan usage, and how to top up                                                                                                                                                                                                                                                                                                                                                                                            |
| `run_pipeline`            | Start a run in the background and return its `runId` immediately. `inputs` are keyed by entry node id; a key that names no entry node, or an entry node left with nothing saved and nothing passed, is refused before anything runs or is charged. Pass `preview: true` to render only a cheap first look, the first video step as a short Veo 3.1 Lite clip, which `estimate_run_cost` prices when the balance will not cover a full run |
| `list_connected_channels` | The YouTube channels and TikTok accounts connected to the account, with the ids publishing nodes need                                                                                                                                                                                                                                                                                                                                     |
| `connect_channel`         | A link to connect a YouTube channel or TikTok account, which you finish in your own browser                                                                                                                                                                                                                                                                                                                                               |
| `publish_asset`           | Lay a finished video out for review before it posts to YouTube or TikTok; it posts only when you press **Post** in the panel                                                                                                                                                                                                                                                                                                              |
| `confirm_publish`         | Posts what `publish_asset` prepared when you press **Post**. Only the panel calls it                                                                                                                                                                                                                                                                                                                                                      |
| `create_api_key`          | Mint a durable scoped key for headless use (OAuth connections only)                                                                                                                                                                                                                                                                                                                                                                       |

***

## See results in the chat

In apps that show MCP panels, ChatGPT and Claude among them, Treza's results appear as panels in the conversation:

| Tool                                                           | Panel                                                                                                                                                                                                                                                                                                         |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run_pipeline`, `assemble_video`, `edit_asset`, `import_media` | The file itself, shown like the chat's own images: images, videos you can play, and audio. Click an image to see it larger. Press **Edit** on a file and say in the chat what to change, and the assistant works on that file. A render shows its progress and turns into the finished file when it is ready. |
| `estimate_run_cost`                                            | The price of one run, step by step, against your balance, with a **Start render** button. When a video step would render the same clip for far less on Veo 3.1 Lite, the panel says so and offers the switch. The assistant waits for your go-ahead: the button, or saying so in the chat.                    |
| `list_assets`                                                  | Your library as a grid. Pick files, then tell the assistant in the chat what to do with them, and it works on exactly those, in the order you picked them when order matters.                                                                                                                                 |
| `get_pipeline`                                                 | A map of the pipeline's steps. A scheduled pipeline also shows when it runs next, with a switch to pause or resume it.                                                                                                                                                                                        |
| `set_schedule_paused`                                          | The schedule, with the same switch.                                                                                                                                                                                                                                                                           |
| `publish_asset`                                                | The post as it will go out: the account, the video, the title or caption. On YouTube you can edit the title, description and visibility; on TikTok you choose who can view it, which interactions to allow, and whether it is commercial content. It posts when you press **Post**, never before.             |

Apps that do not show panels get the same answers as text and links.

***

## Connect a channel and publish

Ask the assistant to post a video you made, and it can do the whole thing in the conversation:

1. **Connect the channel once.** `connect_channel` returns a link. Open it, sign in to Treza with the Google account you use with the assistant, and allow YouTube or TikTok to let Treza post. A page tells you when it is connected. The link only ever connects your own channel to your own account: opened while signed in to a different Treza account, it says so and connects nothing.
2. **Review the post.** `publish_asset` lays the video out in a panel with the account it will post as and its title or caption. Nothing is posted yet.
3. **Press Post.** On TikTok you first choose who can view it, which interactions to allow, and whether it promotes you or a brand, as TikTok requires for every post. A video Treza generated is labeled as AI-generated.

Posting needs an app that shows MCP panels, such as ChatGPT or Claude. In a client without panels, publish by building a pipeline that ends in an upload node.

***

## Runs are asynchronous

Video generation takes minutes, so `run_pipeline` never blocks. It starts the run on Treza's background workers and returns a `runId` right away; the assistant then polls `get_run` until the status is no longer `running`. Finished runs include output URLs for the generated media, and `outputs` holds what the pipeline returned. `assemble_video` and `edit_asset` work the same way.

{% hint style="warning" %}
Runs started over MCP are real runs: they draw from your prepaid credit balance and appear in run history, exactly like runs started from the dashboard or the [Pipeline API](/api/pipeline-api).
{% endhint %}

***

## Finish media you already have

The images, videos, and audio your runs, chats, and uploads produce collect in one library. `list_assets` browses it, and two tools turn what is there into a finished file without drawing a graph:

* **`assemble_video`** joins up to 12 clips, in the order given, into one video. Add `narrationUrl` for a voiceover (everything else ducks under it), and `musicUrl` for a bed beneath it all or `musicPrompt` to have one composed for the cut from a description, set `captions` to burn in a transcript, pick `orientation` (`vertical`, `horizontal`, or `match_first`) and a `transition` between shots (`fade`, `fadeblack`, `wipeleft`, `zoomin`, or `none` for a hard cut), and fade the bed with `audioFadeInSec` and `audioFadeOutSec`. One clip plus a track, or one clip and a `musicPrompt`, is how to score a single video. Stills hold 3 seconds each, or stretch so a longer voiceover plays in full; the result's `lengthSec` says how long the cut will run.
* **`edit_asset`** runs up to 6 nodes over one file, each fed the output of the one before, so "caption it and upscale it" is one call with two `operations`. Any transform node in `list_node_types` works; `get_node_type` shows its config, and a setting the node does not have, or a value it does not offer, is refused with the valid ones listed. A Transcribe stage is added for you wherever an operation needs a transcript. Upload nodes cannot be chained onto an edit: to publish, build a pipeline that ends in the upload node.

Both only accept media this account owns, so take the urls from `list_assets` or from a finished run's outputs, exactly as returned. An example call to `assemble_video`:

```json
{
  "clipUrls": [
    "https://media.trezalabs.com/api/media/generated/.../clip-1.mp4?s=...",
    "https://media.trezalabs.com/api/media/generated/.../clip-2.mp4?s=..."
  ],
  "musicUrl": "https://media.trezalabs.com/api/media/generated/.../bed.mp3?s=...",
  "audioFadeOutSec": 3,
  "captions": true,
  "orientation": "vertical"
}
```

It returns a `pipelineId` and `runId` straight away. Poll `get_run` with both; when the status is `success`, `outputs` holds the finished video, which also lands in `list_assets`:

```json
{
  "status": "success",
  "outputs": {
    "video": "https://media.trezalabs.com/api/media/generated/.../final.mp4?s=..."
  }
}
```

The pipeline these tools run on is scratch space that the next `assemble_video` or `edit_asset` call overwrites, so do not schedule, publish, or share it. To keep a cut as something repeatable, build it as a pipeline with `create_pipeline`.

***

## Bring in your own files

`assemble_video` and `edit_asset` only take files that are already in your library. `import_media` puts one there, from wherever the file is:

| Where the file is                                                  | How it gets in                                                                                                             |
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| Attached in a ChatGPT conversation                                 | ChatGPT passes the attachment to `import_media` directly                                                                   |
| At a public https link                                             | `import_media` with `url` set to the link                                                                                  |
| On your computer, with Claude Code, Codex, Cursor, or Hermes Agent | `create_upload_url`, then a `PUT` of the file, then `import_media` with the returned `mediaUrl`                            |
| Attached in Claude on the web or desktop                           | Drop it into your library at [trezalabs.com/chat/assets](https://www.trezalabs.com/chat/assets), then ask Claude to use it |

Claude's apps cannot pass an attachment to any MCP tool: Claude sees the image, but has no file or link to hand on. The library page is the way in there.

`import_media` reads the file's type from its contents, not its name. It takes images (PNG, JPEG, WebP, GIF) up to 25 MB, audio (MP3, M4A, WAV, OGG) up to 100 MB, and video (MP4, MOV, WebM) up to 200 MB, and refuses anything else, SVG included. It spends no credits, and returns the library url:

```json
{
  "url": "https://media.trezalabs.com/api/media/generated/uploads/...png?s=...",
  "kind": "image",
  "name": "Logo"
}
```

To put that logo in the bottom-left corner of a video or a picture, pass it to the Overlay node through `edit_asset`. A picture comes back as a PNG the same size:

```json
{
  "sourceUrl": "https://media.trezalabs.com/api/media/generated/.../video.mp4?s=...",
  "operations": [
    {
      "nodeType": "overlay",
      "config": { "position": "bottom-left", "sizePct": 12 },
      "inputs": { "image": "https://media.trezalabs.com/api/media/generated/uploads/...png?s=..." }
    }
  ]
}
```

With a local file, `create_upload_url` takes the file's `contentType` (for example `image/png`) and returns a `PUT` link that expires in 15 minutes, together with the command to run:

```bash
curl -sSf -X PUT -H 'Content-Type: image/png' --upload-file ./logo.png '<uploadUrl>'
```

Then call `import_media` with `url` set to the `mediaUrl` it returned. The file is not in your library until then.

***

## Credits, and paying without a human

Call `get_credit_balance` before committing to expensive work. It returns the current balance, roughly how many videos that covers, and where more credits come from (connections from ChatGPT get the balance alone):

```json
{
  "balanceUsd": 16.13,
  "typicalVideoChargeUsd": 1.06,
  "approxVideosRemaining": 15,
  "topUpUrl": "https://www.trezalabs.com/platform/settings",
  "x402": {
    "url": "https://www.trezalabs.com/api/billing/credits/x402",
    "topUpPerCallUsd": 5,
    "network": "eip155:8453"
  }
}
```

`topUpUrl` is for a signed-in human with a card. The `x402` block, when present, is for an agent that holds a wallet: pay that endpoint in USDC on Base and the credits post immediately, with nobody in the loop. See [x402 Payments](/api/x402-payments).

***

## What still needs a person

Three things no tool here can do, so ask for them rather than working around them:

1. **The Treza account.** Created by signing in during the OAuth flow you already completed.
2. **Credits**, unless the agent pays via x402 as above.
3. **A connected channel**, if the pipeline publishes. Ask the assistant to connect one: `connect_channel` gives you a link that signs you in to Treza and asks YouTube or TikTok for permission to post, then says when it is connected. `list_connected_channels` returns the ids a `youtube-upload` or `tiktok-upload` node needs.

***

## Related

* [Integrations](https://www.trezalabs.com/integrations) - setup for each app, step by step.
* [API Keys](/api/api-keys) - create a key with `pipelines:*` scopes.
* [x402 Payments](/api/x402-payments) - let an agent fund its own runs.
* [Pipeline API](/api/pipeline-api) - call a published pipeline over plain HTTP.
* [Build your first pipeline](/pipelines/quickstart) - end-to-end from the canvas.


# x402 Payments

Treza integrates the [x402 protocol](https://docs.cdp.coinbase.com/x402/welcome) to enable instant, autonomous stablecoin micropayments for API access. AI agents and developers can pay for Treza services programmatically using USDC on Base or Solana, with no API keys, subscriptions, or manual billing required.

Seven endpoints are payable. The first six sell one thing per payment and need no Treza account:

* [**Pay-per-video**](#pay-per-video): send a prompt (and optionally a first frame), get a generated clip back.
* [**Speech**](#speech-music-and-images): send text, get an ElevenLabs voiceover back.
* [**Music**](#speech-music-and-images): describe a track, get an original Lyria 3 piece back.
* [**Images**](#speech-music-and-images): send a prompt, get an image back on the model you pick.
* [**Clips**](#clips-and-narrated-shorts): send a YouTube link, get its most shareable moment back as a captioned clip.
* [**Narrated shorts**](#clips-and-narrated-shorts): send a topic, get a finished 30-second narrated short back.
* [**Credit top-up**](#funding-an-account-without-a-human): add to the prepaid balance that pipeline runs draw from.

### What is x402?

x402 is an open payment protocol built by [Coinbase](https://docs.cdp.coinbase.com/x402/welcome) that uses the HTTP `402 Payment Required` status code. When a client requests a paid resource:

1. The server responds with `402` and payment instructions (price, network, recipient)
2. The client signs a USDC payment
3. The client retries the request with a `Payment-Signature` header
4. The server verifies the payment and settles it on-chain through a facilitator, then returns the resource

Payments are instant, permissionless, and settled in USDC on Base (L2) or Solana.

### How Treza Uses x402

#### Paid Endpoints

| Endpoint                    | Method | Price                                     | Description                                                                                                                                       |
| --------------------------- | ------ | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/api/x402/video`           | POST   | from $0.42                                | Generate a video from a prompt or a first frame, returned in the same response when it renders within 45 seconds. Priced by model and clip length |
| `/api/x402/speech`          | POST   | from $0.02                                | Turn text into an ElevenLabs voiceover (MP3), returned in the same response. Priced per character                                                 |
| `/api/x402/music`           | POST   | from $0.06                                | Generate an original Google Lyria 3 track from a description                                                                                      |
| `/api/x402/image`           | POST   | from $0.02 ($0.05 from February 10, 2027) | Generate an image on Nano Banana, GPT Image 2.6, Seedream, FLUX or Recraft. Priced by model and setting                                           |
| `/api/x402/clip`            | POST   | from $0.04                                | Clip a YouTube link: its most shareable moment as a captioned vertical clip. Priced by the source's length                                        |
| `/api/x402/short`           | POST   | from $0.87                                | A finished 30-second narrated short from a topic: script, scenes, narrator, music, captions                                                       |
| `/api/billing/credits/x402` | POST   | $5.00                                     | Top up a prepaid credit balance                                                                                                                   |

#### Networks

Every 402 challenge from every endpoint lists two ways to pay the same amount, Base first:

| Chain          | `network`                                 | USDC (`asset`)                                 | Gas in your wallet                                                     |
| -------------- | ----------------------------------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
| Base mainnet   | `eip155:8453`                             | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`   | None: the payment is an EIP-3009 authorization the facilitator submits |
| Solana mainnet | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` | `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` | None: the facilitator pays the network fee (`extra.feePayer`)          |

An x402 client pays the first entry it has a wallet for. A client with an EVM wallet pays on Base, and a client with a Solana wallet pays on Solana (see [Paying from a Solana wallet](#paying-from-a-solana-wallet)). Your wallet needs USDC on the chain it pays from, and nothing else.

Paid on Solana, the response's `network` is `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`, `transaction` is a base58 transaction signature rather than a `0x` hash, and `payer` is your base58 address. A Base wallet and a Solana wallet are separate Treza wallet accounts: credit left on one is not visible to the other.

### Pay-Per-Video

`POST /api/x402/video` generates a video from a text prompt, or animates an image from its first frame. It returns the video in the same response when the render finishes within 45 seconds, otherwise a `statusUrl` to collect it from. Pay once per clip. No Treza account, API key, or signup is required. The payment is the only credential.

#### Price

Price is quoted per request and depends on the model and the clip length. Read it off the 402 challenge rather than hard-coding it. Each model sells its own lengths:

| `model`                | Prices (USDC)                     |
| ---------------------- | --------------------------------- |
| `minimax-h3` (default) | 5 s $0.42, 10 s $0.84, 15 s $1.26 |
| `veo-3.1-lite`         | 4 s $0.45, 6 s $0.68, 8 s $0.90   |
| `wan-2.7`              | 5 s $0.70, 10 s $1.40             |
| `veo-3.1-fast`         | 4 s $0.68, 6 s $1.01, 8 s $1.35   |
| `kling-3.0`            | 5 s $0.89, 10 s $1.77, 15 s $2.65 |
| `kling-3.0-pro`        | 5 s $1.18, 10 s $2.36, 15 s $3.53 |
| `seedance-2.5`         | 5 s $1.64, 10 s $3.27, 15 s $4.90 |
| `veo-3.1`              | 4 s $2.24, 6 s $3.36, 8 s $4.48   |

`16:9` and `9:16` cost the same, and so does a clip that starts from an `image_url`. The cheapest clip is $0.42 and the most expensive is $4.90.

#### Models

Send `model` to pick one. Omit it and the default renders, unless you send an `image_url`: then the cheapest model that takes an image at the length you ask for renders it, and the 402 quotes that model's price.

| `seconds`, with an `image_url` and no `model` | Renders on     |
| --------------------------------------------- | -------------- |
| `5` or `10`                                   | `wan-2.7`      |
| `15`                                          | `kling-3.0`    |
| `4`, `6`, `8`, or none                        | `veo-3.1-lite` |

So `{"prompt": "...", "seconds": 5, "image_url": "..."}` buys a 5-second clip on `wan-2.7` for $0.70. Naming `minimax-h3` with an `image_url` is refused, since it renders from text only.

| `model`                | Model                  | First frame | Worth knowing                                                                                                                                                                                                                                                                                                                                            |
| ---------------------- | ---------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `minimax-h3` (default) | MiniMax Hailuo 3       | No          | 768p with native audio, and the fewest prompt refusals of anything we run. The right choice unless you have a reason to pay more. Text only: it cannot take an `image_url`                                                                                                                                                                               |
| `veo-3.1-lite`         | Google Veo 3.1 Lite    | Yes         | Google Veo at its lowest price, with native audio, usually ready in about a minute. Google's safety filter returns nothing for some prompts; that is not charged and can be retried                                                                                                                                                                      |
| `wan-2.7`              | Alibaba Wan 2.7        | Yes         | Native audio at 5 or 10 seconds, and the most permissive with photos of real people as a first frame                                                                                                                                                                                                                                                     |
| `veo-3.1-fast`         | Google Veo 3.1 Fast    | Yes         | Sharper Veo with native audio, typically under two minutes                                                                                                                                                                                                                                                                                               |
| `kling-3.0`            | Kling 3.0              | Yes         | 720p with native audio                                                                                                                                                                                                                                                                                                                                   |
| `kling-3.0-pro`        | Kling 3.0 Pro          | Yes         | Kling's higher-fidelity tier, 1080p with native audio                                                                                                                                                                                                                                                                                                    |
| `seedance-2.5`         | ByteDance Seedance 2.5 | Yes         | 720p with native audio and higher fidelity, at about four times the price of the default. Its content filter is strict: prompts that resemble a brand, a broadcast, or a famous scene are refused, and so are photos of real people. A refusal is not charged, and the response carries a `retryUrl` that renders a reworded prompt without paying again |
| `veo-3.1`              | Google Veo 3.1         | Yes         | Google's top-fidelity model with synchronized audio, for final shots                                                                                                                                                                                                                                                                                     |

A `model` value that is not on this list is refused with a `400` before any payment moves, naming the ones that are. Nothing is ever silently swapped for the default.

To read the current list and prices programmatically, `GET /api/x402/video` with no query parameters. It returns every model on sale with what it is for, whether it takes a first frame, and its prices, plus the request fields, the limits, and how delivery works. No payment or credential is needed.

```bash
curl https://www.trezalabs.com/api/x402/video
```

Abridged (notes and most of the 46 offers left out):

```json
{
  "service": "Treza pay-per-video",
  "description": "Generate a video from a text prompt, or animate an image from its first frame, and get the file back in the same response. The payment is the only credential: no account, API key, or signup.",
  "howToBuy": {
    "method": "POST",
    "body": { "prompt": "a manta ray gliding over a sunlit coral reef, slow cinematic drift", "seconds": 5, "aspectRatio": "16:9", "model": "minimax-h3" },
    "note": "..."
  },
  "fields": { "prompt": "...", "seconds": "...", "aspectRatio": "...", "model": "...", "image_url": "...", "async": "..." },
  "models": [
    { "id": "minimax-h3", "label": "MiniMax Hailuo 3", "default": true, "firstFrame": false, "note": "...", "prices": [{ "seconds": 5, "priceUsd": 0.42 }, { "seconds": 10, "priceUsd": 0.84 }, { "seconds": 15, "priceUsd": 1.26 }] },
    { "id": "veo-3.1-lite", "label": "Google Veo 3.1 Lite", "default": false, "firstFrame": true, "note": "...", "prices": [{ "seconds": 4, "priceUsd": 0.45 }, { "seconds": 6, "priceUsd": 0.68 }, { "seconds": 8, "priceUsd": 0.9 }] },
    { "id": "wan-2.7", "label": "Alibaba Wan 2.7", "default": false, "firstFrame": true, "note": "...", "prices": [{ "seconds": 5, "priceUsd": 0.7 }, { "seconds": 10, "priceUsd": 1.4 }] },
    { "id": "veo-3.1-fast", "label": "Google Veo 3.1 Fast", "default": false, "firstFrame": true, "note": "...", "prices": [{ "seconds": 4, "priceUsd": 0.68 }, { "seconds": 6, "priceUsd": 1.01 }, { "seconds": 8, "priceUsd": 1.35 }] },
    { "id": "kling-3.0", "label": "Kling 3.0", "default": false, "firstFrame": true, "note": "...", "prices": [{ "seconds": 5, "priceUsd": 0.89 }, { "seconds": 10, "priceUsd": 1.77 }, { "seconds": 15, "priceUsd": 2.65 }] },
    { "id": "kling-3.0-pro", "label": "Kling 3.0 Pro", "default": false, "firstFrame": true, "note": "...", "prices": [{ "seconds": 5, "priceUsd": 1.18 }, { "seconds": 10, "priceUsd": 2.36 }, { "seconds": 15, "priceUsd": 3.53 }] },
    { "id": "seedance-2.5", "label": "ByteDance Seedance 2.5", "default": false, "firstFrame": true, "note": "...", "prices": [{ "seconds": 5, "priceUsd": 1.64 }, { "seconds": 10, "priceUsd": 3.27 }, { "seconds": 15, "priceUsd": 4.9 }] },
    { "id": "veo-3.1", "label": "Google Veo 3.1", "default": false, "firstFrame": true, "note": "...", "prices": [{ "seconds": 4, "priceUsd": 2.24 }, { "seconds": 6, "priceUsd": 3.36 }, { "seconds": 8, "priceUsd": 4.48 }] }
  ],
  "offers": [
    { "model": "minimax-h3", "seconds": 5, "aspectRatio": "16:9", "priceUsd": 0.42 },
    { "model": "minimax-h3", "seconds": 5, "aspectRatio": "9:16", "priceUsd": 0.42 },
    { "model": "veo-3.1-lite", "seconds": 4, "aspectRatio": "16:9", "priceUsd": 0.45 }
  ],
  "limits": { "maxPromptChars": 2000, "seconds": [4, 5, 6, 8, 10, 15], "aspectRatio": ["16:9", "9:16"], "model": ["minimax-h3", "veo-3.1-lite", "wan-2.7", "veo-3.1-fast", "kling-3.0", "kling-3.0-pro", "seedance-2.5", "veo-3.1"] },
  "delivery": "The paid POST answers 200 at once and holds the connection while the render runs, sending a whitespace byte every two seconds (JSON parsers ignore it), then one JSON object: the finished result (status, video, statusUrl) or, after 45 seconds by default, status \"running\" with the statusUrl. The X-Status-Url response header carries the same URL from the first byte. \"Prefer: wait=<seconds>\" changes the wait (up to 720), and \"async\": true or \"Prefer: respond-async\" answers 202 with the statusUrl at once. GET the statusUrl exactly as given (the runId contains \"#\" and must stay encoded as %23); it takes \"Prefer: wait=<seconds>\" too."
}
```

#### Request

```json
{
  "prompt": "a manta ray gliding over a sunlit coral reef, slow cinematic drift",
  "seconds": 5,
  "aspectRatio": "16:9",
  "model": "minimax-h3"
}
```

| Field         | Required | Default                                                                             | Notes                                                                                                                                                                                                                                              |
| ------------- | -------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt`      | Yes      | none                                                                                | What the video should show. Max 2000 characters                                                                                                                                                                                                    |
| `seconds`     | No       | the model's shortest                                                                | A length the model sells (see [Price](#price)). Drives the price. Also accepted as `duration` or `durationSeconds`                                                                                                                                 |
| `aspectRatio` | No       | `16:9`                                                                              | `16:9` or `9:16`. Also accepted as `aspect`                                                                                                                                                                                                        |
| `model`       | No       | `minimax-h3`; with an `image_url`, the cheapest model that takes one at your length | One of the ids in [Models](#models). Drives the price                                                                                                                                                                                              |
| `image_url`   | No       | none                                                                                | First frame (image-to-video): a public https JPEG, PNG or WebP up to 10 MB. It is cropped to the `aspectRatio` you buy (1280x720 or 720x1280) and the video starts from it. Every model except `minimax-h3` takes one. Also accepted as `imageUrl` |
| `async`       | No       | `false`                                                                             | `true` answers `202` at once with a `statusUrl` to poll, instead of waiting for the render                                                                                                                                                         |

These fields are the whole request; they are also accepted nested under `"inputs"`. A request asking for a length or model that is not on sale, sending an `image_url` with `minimax-h3`, or carrying any field the endpoint does not read, is refused with a `400` **before the payment settles**, so a malformed call costs nothing, and nothing you send can be silently ignored and paid for.

An `image_url` is checked before the payment settles too, so an image that cannot be used is refused with nothing charged. The URL and the model are checked first; then the image is downloaded, and it must be fetchable within 4 seconds. Every `image_url` refusal carries a `code` alongside an `error` that says what to fix:

| `code`                   | Status | Meaning                                                                                                           |
| ------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------- |
| `IMAGE_URL_INVALID`      | 400    | Not a plain https URL: `http`, a username or password, or a non-default port                                      |
| `IMAGE_URL_BLOCKED`      | 400    | Points at a private, loopback or internal host. Host the image somewhere public, such as a CDN or a public bucket |
| `IMAGE_MODEL_MISMATCH`   | 400    | Sent with `minimax-h3`, which renders from text only. Name another model, or leave `model` out                    |
| `IMAGE_FETCH_FAILED`     | 400    | The download failed: the host did not resolve, answered an error, or took longer than 4 seconds                   |
| `IMAGE_TOO_LARGE`        | 413    | Larger than 10 MB                                                                                                 |
| `IMAGE_UNSUPPORTED_TYPE` | 400    | Not a JPEG, PNG or WebP                                                                                           |
| `IMAGE_DIMENSIONS`       | 400    | Short edge under 256 px, an edge over 8000 px, over 40 megapixels, or a shape beyond 4:1                          |
| `IMAGE_STORE_FAILED`     | 503    | The image was fine but could not be stored on our side. Try again                                                 |

#### Flow

The payment settles before the render starts. The paid call then waits up to 45 seconds: a clip that renders in time comes back in the same response, and a longer render leaves you a `statusUrl` to collect it from. The 45-second default keeps the whole call inside fixed client timeouts, such as the 60 seconds an MCP tool call allows, so your client always receives its claim ticket.

```bash
# 1. Ask. With no payment you get the challenge back.
curl -i -X POST https://www.trezalabs.com/api/x402/video \
  -H 'content-type: application/json' \
  -d '{"prompt":"a manta ray gliding over a sunlit coral reef, slow cinematic drift","seconds":5,"aspectRatio":"16:9","model":"minimax-h3"}'

# HTTP/2 402
# Payment-Required: <base64 challenge: the price, with a Base and a Solana entry>
```

Any x402 client signs and retries for you. The paid response is streamed:

1. Status `200` and the headers arrive at once. `X-Status-Url` carries the `statusUrl`, so you hold the claim ticket before the render has finished.
2. While the render runs, the body is a whitespace byte every 2 seconds. JSON parsers ignore leading whitespace, so `res.json()` reads the body as usual.
3. The body ends with one complete JSON object: the result, or `"status": "running"` once the wait is over.

The HTTP status is `200` whatever happened to the render, so read `status` in the body. When the video is ready:

```json
{
  "runId": "2026-09-23T18:04:11.000Z#1a2b3c4d",
  "status": "success",
  "startedAt": "2026-09-23T18:04:11.000Z",
  "finishedAt": "2026-09-23T18:04:52.000Z",
  "durationMs": 41000,
  "video": "https://www.trezalabs.com/api/media/generated/x402_video/1a2b3c4d.mp4?s=...&c=...",
  "outputs": { "video": "https://www.trezalabs.com/api/media/generated/x402_video/1a2b3c4d.mp4?s=...&c=..." },
  "statusUrl": "https://www.trezalabs.com/api/x402/video?runId=...&token=...",
  "paidUsd": 0.42,
  "model": "minimax-h3",
  "seconds": 5,
  "aspectRatio": "16:9",
  "network": "eip155:8453",
  "transaction": "0x6d9154...",
  "payer": "0x0ac0ab..."
}
```

Use the `video` URL exactly as given, query parameters included. When you sent an `image_url`, it is echoed back as `imageUrl`. Paid on Solana, `network`, `transaction` and `payer` take their Solana forms (see [Networks](#networks)).

If the render takes longer than the wait (45 seconds by default), the body ends with `"status": "running"` instead:

```json
{
  "runId": "2026-09-23T18:04:11.000Z#1a2b3c4d",
  "status": "running",
  "statusUrl": "https://www.trezalabs.com/api/x402/video?runId=...&token=...",
  "pollAfterMs": 15000,
  "paidUsd": 0.42,
  "model": "minimax-h3",
  "seconds": 5,
  "aspectRatio": "16:9",
  "network": "eip155:8453",
  "transaction": "0x6d9154...",
  "payer": "0x0ac0ab...",
  "balanceUsd": 0.42
}
```

Then poll `statusUrl` until `status` is no longer `running`. The token in the URL is the only credential it needs, and polling is free. Use the URL exactly as given: the `runId` contains `#`, which must stay encoded as `%23`. To long-poll instead, send `Prefer: wait=N` and the status call holds its answer until the run finishes, for up to N seconds (at most 720), streamed the same way:

```bash
curl -N -H 'Prefer: wait=600' "$STATUS_URL"
```

**Waiting longer.** If your client can hold a connection open, send `Prefer: wait=N` on the paid call to wait up to N seconds instead of 45, at most 720.

**Getting the status URL at once.** To have the paid call answer immediately and poll yourself, send `"async": true` in the body or the header `Prefer: respond-async`. The paid call then answers `202` with the `runId`, `statusUrl` and `pollAfterMs`, as in the `running` body above.

Both the `200` and the `202` carry the `statusUrl` in an `X-Status-Url` header, and a `Preference-Applied` header echoes the preference that was honoured (`respond-async`, or `wait=N`).

**A render that outlasts its deadline.** Occasionally a provider finishes a clip after the render's own deadline. The run then reads `"status": "running"` with a `note` while the clip is collected from the provider, and turns `success` with the video when it arrives. Keep polling; a retry is refused (`409`) meanwhile, because the clip is still coming.

#### When a render fails

A render can fail after the payment has settled, most often because the model declined the prompt or the image. Nothing is charged for a failed render, so the payment stays on your wallet's account and the retry spends it instead of costing you again.

The response for a failed run, from the paid call or from `statusUrl`, carries what went wrong and what to do about it:

```json
{
  "runId": "2026-09-03T17:29:52.032Z#4509944a",
  "status": "partial",
  "error": "Video generation completed with no output (content may have been filtered)",
  "failedStep": "Video Generation",
  "reason": "prompt_refused",
  "retryable": true,
  "retryUrl": "https://www.trezalabs.com/api/x402/video/retry?runId=...&token=...",
  "message": "The video model refused this prompt or image, so nothing was rendered and nothing was charged for it. Your payment stays on your wallet balance. POST a reworded prompt to retryUrl to render again without paying twice.",
  "balanceUsd": 5.9
}
```

| Field        | Notes                                                                                                                                                         |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`     | `error` or `partial` (occasionally `cancelled`)                                                                                                               |
| `reason`     | `prompt_refused` means the model declined the prompt or image, so reword it. `render_failed` means the render did not finish, and the same prompt may succeed |
| `retryable`  | `true` until the run's one free retry has been used, then `false`                                                                                             |
| `retryUrl`   | Where to retry. It carries the same signed ticket, so it needs no other credential. Gone once the run has been retried                                        |
| `message`    | What happened and what to do, in one sentence                                                                                                                 |
| `balanceUsd` | Credit left on your wallet's account, which the retry spends                                                                                                  |

`POST` the `retryUrl` to render again without paying twice. Send `{"prompt": "..."}` to reword, which is the fix for `prompt_refused`, or send no body to run the original prompt again. The retry renders the same model, length, shape and first frame the failed run was sold, and each failed run can be retried once. Like the paid call, the retry waits up to 45 seconds by default (`Prefer: wait=N` for longer, at most 720) and ends with the result or with `"status": "running"` and its own `statusUrl`; send `{"async": true}` or `Prefer: respond-async` for an immediate `202` with a new `runId` and `statusUrl`.

```bash
curl -X POST "$RETRY_URL" \
  -H 'content-type: application/json' \
  -d '{"prompt":"a manta ray gliding over a coral reef at dawn"}'
```

Once a run has been retried, its own status (and a second retry attempt, which answers `409`) points at the retry with `retriedBy`, so a lost retry response never loses the clip. Poll `retriedBy.statusUrl` for the result:

```json
{
  "runId": "2026-09-03T17:29:52.032Z#4509944a",
  "status": "partial",
  "error": "Video generation completed with no output (content may have been filtered)",
  "failedStep": "Video Generation",
  "reason": "prompt_refused",
  "retryable": false,
  "retriedBy": {
    "runId": "2026-09-03T17:41:07.118Z#8c21d0e5",
    "statusUrl": "https://www.trezalabs.com/api/x402/video?runId=...&token=..."
  },
  "retriedByRunId": "2026-09-03T17:41:07.118Z#8c21d0e5",
  "message": "This run was retried. Poll retriedBy.statusUrl for the result."
}
```

#### Billing

Your payment credits an account keyed to your wallet address, and the render is charged against that balance. Anything left over stays as credit for your next call. The same wallet always maps to the same account, and a Base wallet and a Solana wallet are separate accounts.

A failed render is not charged, so the payment remains available for a retry.

Each payment buys one render. A payment presented again after it was redeemed is refused with a `409`, and nothing new is rendered or charged:

```json
{
  "error": "This payment has already been redeemed for a render.",
  "code": "PAYMENT_ALREADY_REDEEMED",
  "transaction": "0x6d9154..."
}
```

#### Full example

```typescript
import { x402Client } from '@x402/core/client';
import { registerExactEvmScheme } from '@x402/evm/exact/client';
import { safeBase64Encode, safeBase64Decode } from '@x402/core/utils';
import { privateKeyToAccount } from 'viem/accounts';

const ENDPOINT = 'https://www.trezalabs.com/api/x402/video';
const body = JSON.stringify({
  prompt: 'a manta ray gliding over a sunlit coral reef, slow cinematic drift',
  seconds: 5,
  aspectRatio: '16:9',
  model: 'minimax-h3',
});

const post = (paymentHeader?: string) =>
  fetch(ENDPOINT, {
    method: 'POST',
    headers: {
      'content-type': 'application/json',
      ...(paymentHeader ? { 'PAYMENT-SIGNATURE': paymentHeader } : {}),
    },
    body,
  });

// 1. Unpaid request returns the challenge, priced for this model and length.
const challenge = await post();
const paymentRequired = JSON.parse(safeBase64Decode(challenge.headers.get('payment-required')!));

// 2. Sign a payment for it. The client refuses any payment over $1 unless
//    you raise the cap, and clips run up to $4.90.
const client = new x402Client();
client.setSpendControls({ maxAmountPerPayment: '$5' });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`) });
const payload = await client.createPaymentPayload(paymentRequired);

// 3. Pay. The response ends with the video if the render finishes within
//    45 seconds, or with status "running" and a statusUrl.
const paid = await post(safeBase64Encode(JSON.stringify(payload)));
if (!paid.ok) throw new Error(`${paid.status}: ${await paid.text()}`);
let run = await paid.json();

// 4. Only if the render outlasted the wait: poll the claim ticket.
const statusUrl: string = run.statusUrl;
while (run.status === 'running') {
  await new Promise((r) => setTimeout(r, run.pollAfterMs ?? 15000));
  run = await (await fetch(statusUrl)).json();
}

if (run.video) console.log(run.video);
else console.log(`${run.status}: ${run.message} Retry at ${run.retryUrl}`);
```

#### Paying from a Solana wallet

The same purchase from a Solana wallet, with [`@x402/fetch`](https://www.npmjs.com/package/@x402/fetch), [`@x402/svm`](https://www.npmjs.com/package/@x402/svm), `@solana/kit` and `bs58`. The secret key is the base58 64-byte export from Phantom and most wallets. The wallet needs USDC on Solana and no SOL.

```typescript
import { wrapFetchWithPaymentFromConfig } from '@x402/fetch';
import { ExactSvmScheme } from '@x402/svm/exact/client';
import { createKeyPairSignerFromBytes } from '@solana/kit';
import bs58 from 'bs58';

const signer = await createKeyPairSignerFromBytes(bs58.decode(process.env.SOLANA_PRIVATE_KEY!));

const paidFetch = wrapFetchWithPaymentFromConfig(fetch, {
  // Only Solana is registered, so the client pays the challenge's Solana entry.
  schemes: [{ network: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', client: new ExactSvmScheme(signer) }],
  // The client refuses any payment over $1 by default; clips run up to $4.90.
  spendControls: { maxAmountPerPayment: '$5' },
});

const response = await paidFetch('https://www.trezalabs.com/api/x402/video', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    prompt: 'a manta ray gliding over a sunlit coral reef, slow cinematic drift',
    seconds: 5,
    aspectRatio: '16:9',
    model: 'minimax-h3',
  }),
});
// Same body as on Base; network is solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
// and transaction is a base58 signature. Poll statusUrl if status is "running".
const run = await response.json();
```

`ExactSvmScheme` reads the USDC mint from a Solana RPC; pass `{ rpcUrl }` as its second argument to use your own instead of the public endpoint.

A worked example is at [trezalabs.com/x402](https://www.trezalabs.com/x402), and a complete buyer script, which pays on Base or Solana, is at [treza-labs/x402-video-example](https://github.com/treza-labs/x402-video-example).

### Speech, Music and Images

Three more endpoints sell the same way as pay-per-video: POST the body, pay the 402, and the paid response ends with the file. Each is its own resource, with its own listing in the x402 Bazaar. A bare `GET` on any of them returns its menu (every option and price), and an unpaid `POST` returns the 402 quoting the exact price for your body. Only the documented fields are read; anything else is refused with a 400 before payment.

The response is the same streamed shape as pay-per-video: `200` at once with the `X-Status-Url` header, a whitespace byte every 2 seconds, then one JSON object whose `status` is `success`, `error` (with `retryUrl`) or `running` (poll `statusUrl`). The file URL is under `audio` for speech and music, and `image` for images. Use it exactly as given. These usually finish in 3 to 25 seconds, well inside the 45-second default wait. `"async": true` or `Prefer: respond-async` answers `202` with a `statusUrl` instead. A failed generation charges nothing, and `POST <endpoint>/retry?runId=...&token=...` (the `retryUrl`) tries again on the balance the payment left, once, optionally with a reworded `text` or `prompt`.

#### Speech: `POST /api/x402/speech`

Text in, an ElevenLabs voiceover (MP3) out.

| Field   | Required | Values                                                                                                                                                                                                           |
| ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `text`  | yes      | Up to 3,000 characters. `input` is accepted as a synonym                                                                                                                                                         |
| `voice` | no       | `george` (default), `daniel`, `callum`, `alice`, `lily`, `brian`, `adam`, `asher`, `archie`, `mark`, `piper`, `rachel`, `charlie`                                                                                |
| `model` | no       | `eleven-v3` (default): the most expressive read; performs directions in square brackets, e.g. `[whispers]`, without speaking them. `eleven-multilingual-v2`: the steadiest read for long narration, 29 languages |
| `async` | no       | `true` for a `202` and a `statusUrl`                                                                                                                                                                             |

Price: $0.42 per 1,000 characters, rounded up to the cent, minimum $0.02 (1,000 characters is about a minute of speech). The response echoes `characters`, the count the price was computed from.

```bash
curl -X POST https://www.trezalabs.com/api/x402/speech \
  -H 'Content-Type: application/json' \
  -d '{"text": "Welcome back. Today we are looking at three small habits that make a big difference.", "voice": "george"}'
```

#### Music: `POST /api/x402/music`

A description of the sound you want in, an original track out.

| Field    | Required | Values                                                                                       |
| -------- | -------- | -------------------------------------------------------------------------------------------- |
| `prompt` | yes      | Genre, mood, instruments, tempo. Up to 2,000 characters                                      |
| `model`  | no       | `lyria-3-clip` (default): a 30-second piece, $0.06. `lyria-3-pro`: a full-length song, $0.12 |
| `async`  | no       | `true` for a `202` and a `statusUrl`                                                         |

```bash
curl -X POST https://www.trezalabs.com/api/x402/music \
  -H 'Content-Type: application/json' \
  -d '{"prompt": "warm lo-fi hip hop, soft piano chords, vinyl crackle, relaxed 80 bpm groove"}'
```

#### Images: `POST /api/x402/image`

A prompt in, one image out, on the model you pick.

| Field         | Required | Values                                             |
| ------------- | -------- | -------------------------------------------------- |
| `prompt`      | yes      | Up to 2,000 characters                             |
| `model`       | no       | See the table below. Defaults to `nano-banana`     |
| `aspectRatio` | no       | Defaults to `1:1`. Each model sells its own shapes |
| `resolution`  | no       | Only on the models priced by resolution            |
| `quality`     | no       | Only on `gpt-image-2.6` and `gpt-image-2`          |
| `async`       | no       | `true` for a `202` and a `statusUrl`               |

| `model`                                              | Shapes                                              | Price                                                                           |
| ---------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------- |
| `nano-banana` (Google, default)                      | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4, 21:9 | $0.06                                                                           |
| `nano-banana-2` (Google)                             | same as above                                       | `resolution` 512 $0.07, 1K $0.10 (default), 2K $0.15, 4K $0.22                  |
| `nano-banana-pro` (Google)                           | same as above                                       | `resolution` 1K $0.20 (default), 2K $0.20                                       |
| `gpt-image-2.6` (OpenAI GPT Image 2.6 Flare)         | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9           | `quality` low $0.05, medium $0.08 (default), high $0.10, xhigh $0.16, max $0.36 |
| `gpt-image-2` (OpenAI, sold until February 10, 2027) | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9           | `quality` low $0.02, medium $0.10 (default), high $0.36                         |
| `seedream-5-pro` (ByteDance)                         | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 4:5, 5:4, 21:9 | `resolution` 2K $0.13                                                           |
| `flux-2-pro` (Black Forest Labs)                     | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9           | 16:9, 9:16 and 21:9 $0.07; 4:3, 3:4, 3:2 and 2:3 $0.09; 1:1 $0.11               |
| `recraft-v4.1` (Recraft)                             | 1:1, 16:9, 9:16, 4:3, 3:4                           | $0.05                                                                           |

A setting the model does not offer (a `resolution` on `gpt-image-2.6`, a shape Recraft does not render) is refused with a 400 rather than silently dropped, so what you pay for is what renders.

OpenAI shuts GPT Image 2 down on February 10, 2027. From that day `gpt-image-2` is off the menu, and a request naming it is refused with a 400 (`"code": "MODEL_RETIRED"`) before you pay, naming `gpt-image-2.6` instead. `gpt-image` with no version means `gpt-image-2.6`.

```bash
curl -X POST https://www.trezalabs.com/api/x402/image \
  -H 'Content-Type: application/json' \
  -d '{"prompt": "a lighthouse on a sea cliff at golden hour, soft mist", "model": "nano-banana-pro", "resolution": "2K", "aspectRatio": "16:9"}'
```

The buyer scripts in [treza-labs/x402-video-example](https://github.com/treza-labs/x402-video-example) cover these too: `npm run buy:speech`, `npm run buy:music` and `npm run buy:image`.

### Clips and Narrated Shorts

Two endpoints sell finished edits rather than one generation. Both render on our worker in a few minutes, so the paid response usually ends after its 45-second wait with `"status": "running"` and a `statusUrl`: poll it (send `Prefer: wait=600` to hold one request open instead). Both return the file as `video`.

If one of these fails part way (a scene the video model refuses, a download YouTube blocks), the steps that finished are charged and the rest of the payment stays on your wallet balance. The free retry (`retryUrl`) with no body resumes the failed run: finished steps are reused, not re-billed, and only what failed runs again.

#### Clips: `POST /api/x402/clip`

A YouTube link in; its most shareable 30 to 60 seconds out, cut and reframed on the speaker, with burned-in captions. `outputs.moment` carries the pick as JSON: start, end, and a title and caption to post it with.

| Field         | Required | Values                                                                                                           |
| ------------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
| `url`         | yes      | A YouTube video link: a watch page, a Short, or a youtu.be link. Other sites, playlists and channels are refused |
| `aspectRatio` | no       | `9:16` (default), `4:5`, `1:1` (all cropped on the speaker), or `16:9` (the original framing)                    |
| `async`       | no       | `true` for a `202` and a `statusUrl`                                                                             |

Price: by the source's length, $0.02 plus $0.005 a minute, times the 1.4 markup, rounded up to the cent. About $0.12 for a 12-minute video, $0.45 for an hour; sources up to 2 hours. The video is looked up before you pay, so the 402 quotes the exact price for your link, and a video that cannot be clipped (private, age-restricted, live, missing, too long) is refused with a 400 and a `code` before any payment moves. Clip only videos you have the rights to use.

```bash
curl -X POST https://www.trezalabs.com/api/x402/clip \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://www.youtube.com/watch?v=KtTXyBJ2N30"}'
```

#### Narrated shorts: `POST /api/x402/short`

A topic in; a finished 30-second vertical short out: a written script, four scenes, an ElevenLabs narrator, a music bed, word-by-word captions and callout cards. `outputs.title` and `outputs.description` come with it.

| Field   | Required | Values                                                                                                                                           |
| ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `topic` | yes      | What the short is about, up to 500 characters                                                                                                    |
| `style` | no       | `motion` (default, $3.22): each scene animated with Google Veo 3.1 Lite. `stills` ($0.87): the same edit on generated stills with a slow push-in |
| `voice` | no       | The narrator, one of the speech voices (default `brian`)                                                                                         |
| `async` | no       | `true` for a `202` and a `statusUrl`                                                                                                             |

```bash
curl -X POST https://www.trezalabs.com/api/x402/short \
  -H 'Content-Type: application/json' \
  -d '{"topic": "how octopuses taste the world with their arms", "style": "stills"}'
```

### Funding an Account Without a Human

This is the one most agents want. Pipeline runs draw a prepaid credit balance, and an agent holding a wallet can refill that balance itself, with nobody signing in to a billing page.

Ask what the balance is and how to add to it, using [`get_credit_balance`](/api/mcp-server) over MCP or `GET /api/account/balance` with an API key:

```json
{
  "balanceUsd": 1.13,
  "typicalVideoChargeUsd": 1.06,
  "topUpUrl": "https://www.trezalabs.com/platform/settings",
  "x402": {
    "url": "https://www.trezalabs.com/api/billing/credits/x402",
    "topUpPerCallUsd": 5,
    "network": "eip155:8453",
    "networks": ["eip155:8453", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"]
  }
}
```

An `x402` block means agent-native top-up is available on this deployment, and `networks` lists the chains it accepts, Base first. `topUpUrl` is the human path; the rest of this page is the other one.

**Paying the endpoint**

`PAYMENT-SIGNATURE` carries the payment and is the only required header.

`Authorization` is optional and selects which account is credited. Send a Treza credential (API key, OAuth token, or session) to credit that account; send none and the credits go to an account keyed to the paying wallet address (a Base wallet and a Solana wallet are separate accounts). The example pays on Base; a Solana wallet pays the same way with `ExactSvmScheme`, as in [Paying from a Solana wallet](#paying-from-a-solana-wallet).

```typescript
import { x402Client } from '@x402/core/client';
import { registerExactEvmScheme } from '@x402/evm/exact/client';
import { safeBase64Encode, safeBase64Decode } from '@x402/core/utils';
import { privateKeyToAccount } from 'viem/accounts';

const ENDPOINT = 'https://www.trezalabs.com/api/billing/credits/x402';
const headers = { authorization: `Bearer ${process.env.TREZA_API_KEY}` };

// 1. Ask, and get the terms back.
const challenge = await fetch(ENDPOINT, { method: 'POST', headers });
const paymentRequired = JSON.parse(
  safeBase64Decode(challenge.headers.get('payment-required')!)
);

// 2. Sign a payment for exactly those terms.
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.WALLET_KEY) });
const payload = await client.createPaymentPayload(paymentRequired);

// 3. Ask again, paying.
const paid = await fetch(ENDPOINT, {
  method: 'POST',
  headers: { ...headers, 'PAYMENT-SIGNATURE': safeBase64Encode(JSON.stringify(payload)) },
});
console.log(await paid.json());
```

A successful call returns the grant and the transaction that paid for it:

```json
{
  "grantedUsd": 5,
  "duplicate": false,
  "balanceUsd": 16.13,
  "network": "eip155:8453",
  "transaction": "0x3e08158c2933cf4174d4f6b7429cdebd2df23b91f135c5a59eaef11a6cbd6450",
  "payer": "0x0Ac0AB6C04C3A92C929e35b39Be88E445360c199"
}
```

Call it again to add another $5. The credits are spendable immediately.

{% hint style="info" %}
The wallet needs USDC on Base mainnet (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`) or on Solana mainnet (`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`). Neither needs gas money: on Base the facilitator broadcasts the transfer, and on Solana it pays the network fee.
{% endhint %}

**Paying twice for the same thing is not possible**

The ledger entry is keyed to the settled transaction (a hash on Base, a signature on Solana), so a repeated request credits once and answers `"duplicate": true`. On Base a replayed payment usually does not even reach that check: the authorization nonce is already spent on-chain, and the facilitator rejects it.

```json
{ "error": "invalid_payload: authorization nonce already submitted; transaction already on-chain" }
```

**When a payment is refused**

The response says why, rather than repeating the challenge:

| Message                                                  | Meaning                                                    |
| -------------------------------------------------------- | ---------------------------------------------------------- |
| `invalid_payload: ... execution reverted`                | The wallet cannot cover the payment                        |
| `invalid_payload: authorization nonce already submitted` | This payment was already spent                             |
| `Invalid or expired credentials`                         | The bearer is wrong, or the key lacks a `pipelines:` scope |
| `x402 payments are not configured on this deployment`    | Agent-native top-up is off here; use `topUpUrl`            |

Authorization is checked before the payment settles, so a request refused for a bad bearer costs nothing.

#### Payment Flow

The pay-per-video call end to end. The request, and any `image_url`, is checked after the payment verifies and before it settles, and the payment settles before the render starts. The response then stays open until the render finishes, for up to 45 seconds by default.

```
Client                          Treza API                     Facilitator         Chain
  │                                │                              │                  │
  │── POST /api/x402/video ───────▶│                              │                  │
  │                                │                              │                  │
  │◀── 402 Payment Required ───────│                              │                  │
  │    price: $0.42                │                              │                  │
  │    a Base and a Solana entry   │                              │                  │
  │    payTo per network           │                              │                  │
  │                                │                              │                  │
  │── Sign USDC payment ──┐        │                              │                  │
  │◀── Payment-Signature ─┘        │                              │                  │
  │                                │                              │                  │
  │── POST /api/x402/video ───────▶│                              │                  │
  │    + Payment-Signature         │── Verify payment ───────────▶│                  │
  │                                │◀── Valid ────────────────────│                  │
  │                                │  request and image_url       │                  │
  │                                │  checked: a refusal here     │                  │
  │                                │  costs nothing               │                  │
  │                                │── Settle payment ───────────▶│── USDC tx ──────▶│
  │                                │◀── Settled ──────────────────│                  │
  │                                │                              │                  │
  │◀── 200 + X-Status-Url ─────────│  render starts               │                  │
  │◀── " " every 2 seconds ────────│  up to 45 s by default       │                  │
  │◀── JSON: video, or running ────│                              │                  │
  │                                │                              │                  │
```

### Client-Side: Paying for Treza Services

#### Using Any x402 Client

Any x402-compatible wallet works:

```typescript
import { wrapFetchWithPayment } from '@x402/fetch';
import { x402Client } from '@x402/core/client';
import { registerExactEvmScheme } from '@x402/evm/exact/client';
import { privateKeyToAccount } from 'viem/accounts';

const account = privateKeyToAccount('0xYourPrivateKey...');

const client = new x402Client();
registerExactEvmScheme(client, { signer: account });
// The client refuses any payment over $1 by default; clips run up to $4.90.
client.setSpendControls({ maxAmountPerPayment: '$5' });

const paidFetch = wrapFetchWithPayment(fetch, client);

const response = await paidFetch('https://www.trezalabs.com/api/x402/video', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    prompt: 'a manta ray gliding over a sunlit coral reef, slow cinematic drift',
    seconds: 5,
    aspectRatio: '16:9',
    model: 'minimax-h3',
  }),
});
// The body completes when the render does, or after 45 seconds with status
// "running" and a statusUrl to poll.
const run = await response.json();
```

#### Using curl (Manual)

To inspect the 402 response without paying:

```bash
curl -i -X POST https://www.trezalabs.com/api/x402/video \
  -H 'content-type: application/json' \
  -d '{"prompt":"a manta ray gliding over a sunlit coral reef, slow cinematic drift","seconds":5,"aspectRatio":"16:9","model":"minimax-h3"}'

# HTTP/2 402
# Payment-Required: <base64 challenge>
#
```

Decoded, the challenge carries the price for the model and clip length you asked for, once per chain (abridged):

```json
{
  "x402Version": 2,
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "420000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0xaE393a9CD728F7397F50f6f8C88096a0F3D2b42C",
      "maxTimeoutSeconds": 120,
      "extra": { "...": "..." }
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "amount": "420000",
      "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "payTo": "EX4MyYWHc7NKBGuytmMpxixM7ovSWYLNy5acN2mFfoGd",
      "maxTimeoutSeconds": 120,
      "extra": { "feePayer": "<a Coinbase fee payer address>" }
    }
  ]
}
```

Amounts are in token atomic units (USDC has 6 decimals on both chains, so the price times 1,000,000): `420000` is 0.42 USDC and a $4.90 clip is `4900000`. Pay to the `payTo` the challenge names rather than a copied address.

### Server-Side: Adding x402 to Your Own Endpoints

If you're building on the Treza platform and want to monetize your own API endpoints, use the `withX402Payment` wrapper.

#### Basic Usage

```typescript
import { NextRequest, NextResponse } from 'next/server';
import { withX402Payment } from '@/lib/x402';

async function handleGET(
  request: NextRequest,
  { params }: { params: Promise<{ id: string }> }
): Promise<NextResponse> {
  // Your endpoint logic here
  return NextResponse.json({ data: 'your response' });
}

export const GET = withX402Payment(handleGET, {
  price: '0.001',       // USDC price per request
  description: 'Get resource data',
});
```

#### With Bazaar Discovery

Make your endpoint discoverable by AI agents on the [x402 Bazaar](https://docs.cdp.coinbase.com/x402/bazaar):

```typescript
export const POST = withX402Payment(handlePOST, {
  // A fixed price, or a function of the request body for per-request pricing.
  price: (body) => `$${priceFor(body).toFixed(2)}`,
  // Name the route. Without this it registers as `*`, which the Bazaar
  // publishes under a generated template like `:var1`.
  routePattern: 'POST /api/x402/video',
  serviceName: 'Treza',
  tags: ['video', 'text-to-video', 'image-to-video', 'ai'],
  description:
    'Generate a video from a text prompt, or animate an image_url from its first frame, and get the video URL back in the same response.',
  discovery: {
    method: 'POST',
    bodyType: 'json',
    input: {
      prompt: 'a manta ray gliding over a sunlit coral reef, slow cinematic drift',
      seconds: 5,
      aspectRatio: '16:9',
      model: 'minimax-h3',
    },
    inputSchema: {
      type: 'object',
      properties: {
        prompt: { type: 'string', maxLength: 2000 },
        seconds: { type: 'number', enum: [4, 5, 6, 8, 10, 15] },
        aspectRatio: { type: 'string', enum: ['16:9', '9:16'] },
        model: {
          type: 'string',
          enum: ['minimax-h3', 'veo-3.1-lite', 'wan-2.7', 'veo-3.1-fast', 'kling-3.0', 'kling-3.0-pro', 'seedance-2.5', 'veo-3.1'],
        },
        image_url: { type: 'string', format: 'uri' },
        async: { type: 'boolean' },
      },
      required: ['prompt'],
      additionalProperties: false,
    },
    output: {
      example: {
        runId: '2026-09-23T18:04:11.000Z#1a2b3c4d',
        status: 'success',
        video: 'https://www.trezalabs.com/api/media/generated/x402_video/1a2b3c4d.mp4?s=...&c=...',
        statusUrl: 'https://www.trezalabs.com/api/x402/video?runId=...&token=...',
        paidUsd: 0.42,
        model: 'minimax-h3',
      },
    },
  },
});
```

Declare `method` and `bodyType` for any route that takes a request body. Without them the listing describes the route as query-parameterized, and an agent will send its arguments in the URL of a request that only reads JSON.

#### Environment Variables

| Variable                   | Required          | Default                                         | Description                                                                                                                                                                                                             |
| -------------------------- | ----------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `X402_ENABLED`             | No                | `false`                                         | Set to `true` to enable x402 payment gating                                                                                                                                                                             |
| `TREZA_X402_PAY_TO`        | Yes (if enabled)  | none                                            | Base wallet address that receives USDC payments                                                                                                                                                                         |
| `TREZA_X402_PAY_TO_SOLANA` | No                | none                                            | Solana address that receives USDC payments. When set, and the facilitator settles Solana mainnet, every 402 lists a Solana entry after the Base one                                                                     |
| `X402_NETWORK`             | No                | `eip155:8453`                                   | Network identifier (Base mainnet)                                                                                                                                                                                       |
| `X402_FACILITATOR_URL`     | No                | `https://api.cdp.coinbase.com/platform/v2/x402` | Payment verification facilitator                                                                                                                                                                                        |
| `X402_CDP_API_KEY`         | Yes (CDP mainnet) | none                                            | CDP API key id; the CDP facilitator authenticates every call                                                                                                                                                            |
| `X402_CDP_API_SECRET`      | Yes (CDP mainnet) | none                                            | CDP API key secret                                                                                                                                                                                                      |
| `X402_TOPUP_USD`           | No                | `5`                                             | USD credited per successful top-up call                                                                                                                                                                                 |
| `X402_VIDEO_PIPELINE`      | No                | `pipeline_x402_video`                           | The one published pipeline every pay-per-video purchase renders on                                                                                                                                                      |
| `X402_VIDEO_WAIT_MS`       | No                | `45000`                                         | How long a paid call waits for the render by default before answering with status `running`, in ms. Capped at 720000; `0` answers `202` by default. Leave it unset rather than empty, since an empty value reads as `0` |

{% hint style="warning" %}
Mainnet settlement runs through Coinbase's facilitator, which authenticates every verify and settle call. Without `X402_CDP_API_KEY` and `X402_CDP_API_SECRET` the endpoint fails closed with a 503 and stops advertising itself, rather than answering payments it cannot settle.
{% endhint %}

**Testnet Configuration**

```env
X402_ENABLED=true
TREZA_X402_PAY_TO=0xYourTestnetAddress
X402_NETWORK=eip155:84532
X402_FACILITATOR_URL=https://www.x402.org/facilitator
```

**Mainnet Configuration**

```env
X402_ENABLED=true
TREZA_X402_PAY_TO=0xYourWalletAddress
# Optional: also accept USDC on Solana mainnet, paid to this address.
TREZA_X402_PAY_TO_SOLANA=YourSolanaAddress
X402_NETWORK=eip155:8453
X402_FACILITATOR_URL=https://api.cdp.coinbase.com/platform/v2/x402

# Pay-per-video. Every model, length, shape and first frame on sale renders
# on one published pipeline; what was bought travels with each run. Optional.
X402_VIDEO_PIPELINE=pipeline_x402_video
# How long a paid call waits for the render by default, in ms (default
# 45000, cap 720000). Callers can ask for longer with Prefer: wait=<seconds>.
X402_VIDEO_WAIT_MS=45000
# Legacy: the per-combination pipelines that sold clips before the single
# pipeline. Runs bought on them, and their free retries, are recognised and
# priced from this map, so keep it set until at least 24 hours after the
# single-pipeline deploy (claim tickets last 24 hours).
X402_VIDEO_PIPELINES={"minimax-h3-5s-16x9":"..."}
# Provider cost per generated second on the default model. Price is this times
# the credits markup.
X402_VIDEO_PER_SECOND_USD=0.06
# Per-model overrides, keyed by public model id, for re-pricing one model
# without a deploy when its provider rate moves.
X402_VIDEO_MODEL_RATES_USD={"seedance-2.5":0.233}
```

### Discovering Payable Services

AI agents can discover Treza's x402-payable endpoints through the Bazaar:

```typescript
import { discoverPayableServices } from '@treza/sdk';

const services = await discoverPayableServices({
  maxPrice: '0.01',          // filter by max price per call
  network: 'eip155:8453',   // filter by network
});

services.forEach(service => {
  console.log(service.url, service.description, service.accepts);
});
```

### Security Model

| Layer                        | Protection                                                                                   |
| ---------------------------- | -------------------------------------------------------------------------------------------- |
| **Facilitator Verification** | Payment signatures are verified by the Coinbase facilitator before the server returns data   |
| **On-Chain Settlement**      | Payments settle as real USDC transfers on Base or Solana, providing an immutable audit trail |
| **Replay Protection**        | Each payment signature is bound to a specific request and cannot be reused                   |

### Architecture

```
┌──────────────────┐
│ AI Agent/Client  │
│ @x402/fetch      │
│ auto-pay on 402  │
└────────┬─────────┘
         │
         ▼
┌──────────────────┐     ┌──────────────────┐     ┌──────┐
│  Treza Platform  │────▶│  Facilitator     │────▶│ Base │
│  withX402Payment │     │  (Coinbase/x402) │     │  or  │
│  402 → verify →  │     │  verify + settle │     │Solana│
│  settle → respond│     │                  │     │ USDC │
└──────────────────┘     └──────────────────┘     └──────┘
```

### FAQ

**Do I need USDC to use Treza?** Only if x402 is enabled on the endpoint you're calling. During development and on testnet, x402 is disabled by default.

**Which chains?** USDC on Base mainnet or Solana mainnet. Every 402 challenge lists both at the same price, Base first, and your client pays with whichever wallet it has; neither chain needs gas money in your wallet. A Base wallet and a Solana wallet are separate accounts, so credit left on one is not visible to the other. Testnet deployments use Base Sepolia.

**What if I send the same payment twice?** It is redeemed once. A second video request with the same payment answers `409` with `code: "PAYMENT_ALREADY_REDEEMED"` and renders nothing, and a second top-up credits nothing and answers `"duplicate": true`. Send a new payment to buy again.

**How much do API calls cost?** Video generation is priced by model and clip length, from $0.42 for a five-second clip on the default model to $4.90 for fifteen seconds on Seedance 2.5; the 402 challenge quotes the exact figure for what you asked for, and `GET /api/x402/video` lists every model's prices. Credit top-up is $5.00 per call.

**Do I have to poll for the video?** Not for quick renders. The paid call returns the video URL in the same response when the render finishes within 45 seconds, and `Prefer: wait=N` waits longer (at most 720 seconds). Poll `statusUrl` when the body ends with `"status": "running"`, when you sent `"async": true`, or when your connection dropped: the `X-Status-Url` header gave you the URL before the render finished.

**Can I animate my own image?** Yes. Send `image_url`, a public https JPEG, PNG or WebP up to 10 MB, and the video starts from it, cropped to the aspect ratio you buy. Every model except `minimax-h3` takes one. Without a `model`, the cheapest model that takes an image at your length renders it: `wan-2.7` for 5 or 10 seconds, `kling-3.0` for 15, `veo-3.1-lite` for 4, 6, 8 or no length. The image must be fetchable within 4 seconds, and it is checked before the payment settles, so one that cannot be used costs nothing.

**Do I need a Treza account?** No, for either x402 endpoint. Video generation needs only the payment, and credit top-up without a bearer credits an account keyed to your wallet address. An account is required for the pipeline API.

**What if the render fails?** A failed render is not charged. The payment stays as credit on your wallet's account, and the response carries a `retryUrl` you can POST to render again without paying twice, optionally with a reworded prompt. See [When a render fails](#when-a-render-fails).

**Is there a minimum balance?** No minimum. You just need enough USDC in your wallet to cover the call price.

### Related

* [x402 Protocol Documentation](https://docs.cdp.coinbase.com/x402/welcome)
* [x402 Bazaar](https://docs.cdp.coinbase.com/x402/bazaar)
* [Coinbase Payments MCP](https://docs.cdp.coinbase.com/payments-mcp/welcome)
* [Pay-per-video walkthrough](https://www.trezalabs.com/x402)


# Terms Of Service

**Effective Date: July 11, 2026** · **Last Updated: October 21, 2026**\
Welcome to **Treza**. These Terms of Service ("Terms") are an agreement between you and **Treza Labs, Inc.** ("Treza," "Company," "we," "our," or "us") and govern your access to and use of our platform, available at trezalabs.com and app.trezalabs.com, and of the Treza API, the Treza MCP server, and pay-per-request x402 purchases (collectively, the "Service"). By accessing or using the Service, you agree to be bound by these Terms and by our [Privacy Policy](/terms-and-privacy/privacy).

{% hint style="info" %}
This document describes how the Service works today. It is provided for transparency and is not a substitute for legal advice. Please review it with your own counsel before relying on it.
{% endhint %}

***

#### 1. The Service

Treza is a platform for building generative-media pipelines. You wire AI models, tools, and guardrails together on a visual canvas, run them to generate video, images, audio, and text, edit the results in a timeline editor, run pipelines on a schedule, and can publish a pipeline as an HTTP API that you or your applications call. You can also use the Service through its in-app chat, from an AI assistant you connect (see Section 2.1), or by paying per request with x402. The Service is offered on an ongoing basis and its features may change over time. Features marked as previews or experimental may change or be removed and are provided as they are.

***

#### 2. Eligibility, Accounts, and API Keys

You must be at least 18 years old, or the age of majority where you live if that is higher, to use the Service. If you use the Service on behalf of a company or other organization, you confirm that you are authorized to accept these Terms for it.

You need an account to use most of the Service, and you sign in with Google. You are responsible for your account credentials and API keys, and for all activity that occurs under them, including runs, purchases, and posts. Treza API keys (`treza_live_...`) are secrets: keep them confidential, do not embed them in client-side code, and revoke any key you believe has been exposed. See [API Keys](/api/api-keys). When you pay with x402 without an account, the paying wallet identifies your purchases, and you are responsible for activity paid for from it.

***

#### 2.1 Connected AI Assistants

You can connect an AI assistant to your account, such as the Treza plugin in ChatGPT, a connector in Claude, or another app that supports the Model Context Protocol (MCP). This feature is optional. If you use it:

* **Your authorization.** When you approve a connection, you authorize that assistant to act on your account within the permissions you approved, which can include viewing your pipelines, runs, media, and credit balance; creating, editing, and publishing pipelines; and starting runs that spend your credits. You are responsible for the requests an assistant makes on your account, as you are for requests made with your API keys, and runs it starts are charged like any other run.
* **Posting.** When an assistant prepares a post to a YouTube channel or TikTok account you connected, nothing is posted until you confirm it with the Post button. A pipeline that ends in an upload step publishes as that pipeline is set up, so check what a pipeline does before you ask an assistant to run it. You are responsible for anything published from your accounts.
* **Mistakes.** Assistants can misunderstand a request or get details wrong. Review what an assistant proposes, including a run's estimated cost, before you tell it to go ahead.
* **Third-party terms.** Your use of an assistant is governed by its provider's own terms and policies, for example OpenAI's for ChatGPT and Anthropic's for Claude. Treza is not affiliated with, endorsed by, or sponsored by OpenAI, Anthropic, or any other assistant provider.
* **Disconnect.** You can disconnect an assistant at any time in its settings. See the [Privacy Policy](/terms-and-privacy/privacy) for what an assistant receives and how its access ends.

***

#### 3. Models and Third-Party Providers

The Service runs your prompts and content through third-party model and infrastructure providers. Most models are reached through OpenRouter, which passes requests to the model's developer, such as Anthropic, OpenAI, Google, ByteDance, Kuaishou (Kling), Alibaba (Wan), MiniMax, Runway, Black Forest Labs, xAI, HeyGen, and others. Some Kling video renders go instead through Gondola, a marketplace for Venice AI inference, and Venice AI passes them to Kuaishou. We also use fal.ai, ElevenLabs, and OpenAI directly, along with Amazon Web Services, Vercel, Stripe, Resend, and the other providers listed in Section 2 of our [Privacy Policy](/terms-and-privacy/privacy).

The models and providers available change over time, and a model can be changed, repriced, or retired by its developer. We do not control the accuracy, availability, or reliability of these providers, and Treza is not responsible for their outputs, errors, safety filters, or downtime. Your use of a particular model or integration may also be subject to that provider's own terms and usage policies, and you agree to comply with them.

***

#### 4. Connected YouTube Accounts

The Service uses YouTube API Services and optionally lets you connect one or more YouTube channels you own or manage through Google OAuth (YouTube Data API v3 and YouTube Analytics API). This feature is optional. If you use it:

* **Your authorization.** You authorize Treza to upload videos you generate in the Service to the YouTube channel(s) you select, including on a recurring schedule you configure, and to post the Treza credit comment described below. If you turn on comment replies, you also authorize Treza to reply to viewer comments on videos it published for you, according to reply guidelines you configure. These actions occur only under pipelines, schedules, or settings you set up; Treza does not act on your channel without your direction.
* **Treza credit.** Each video the Service uploads to your channel includes a short line at the end of its description saying it was made with Treza, with a link to our site and a link to our partner program, unless the description you set already links to trezalabs.com. For each public or unlisted upload, the Service also posts one comment from your channel with a similar line and link. You can turn that comment off for any connected channel in Settings under Connected accounts, using the "Post a Treza comment on uploads" switch; the description line is not affected. You can also edit or remove the line and the comment in YouTube Studio at any time.
* **Your obligations.** You are solely responsible for videos, comments, and replies published to or from your channel, including compliance with [YouTube's Terms of Service](https://www.youtube.com/t/terms), [Community Guidelines](https://www.youtube.com/howyoutubeworks/policies/community-guidelines/), and applicable copyright and privacy laws. You must only publish content you have the rights to distribute.
* **AI disclosure.** YouTube requires creators to disclose realistic content that is altered or synthetic. The YouTube publish step has a setting that marks a video as altered or synthetic, and depending on how you publish it may be off by default. You are responsible for turning it on whenever YouTube's rules require it.
* **Scopes.** We request only the OAuth scopes required for these features: `youtube.upload` (upload videos you generate), `youtube.readonly` (read channel metadata and statistics for videos published through the Service), `youtube.force-ssl` (post the Treza credit comment and, when you turn on comment replies, read and reply to viewer comments on those videos), and `yt-analytics.readonly` / `yt-analytics-monetary.readonly` (read watch-time and estimated-revenue reports for those videos to show your performance dashboard).
* **Limited use.** Treza does not edit or delete your existing YouTube videos, and does not manage videos or comments other than those it publishes for you, nor your channel memberships or broader Google account settings through this integration.
* **Third-party terms.** Your use of YouTube is also governed by Google's terms and privacy policies. Treza is not affiliated with, endorsed by, or sponsored by Google or YouTube.
* **Disconnect.** You can disconnect a YouTube channel at any time in Settings → Connected accounts. Disconnecting removes Treza's ability to publish to that channel on your behalf going forward.

***

#### 5. Connected TikTok Accounts

The Service optionally lets you connect one or more TikTok accounts you own through TikTok OAuth (TikTok Content Posting API). This feature is optional. If you use it:

* **Your authorization.** You authorize Treza to publish videos you generate in the Service to the TikTok account(s) you select. Posts occur only when you run a pipeline or otherwise initiate a publish action; Treza does not post to your account without your direction.
* **Your obligations.** You are solely responsible for videos published to your account, including compliance with [TikTok's Terms of Service](https://www.tiktok.com/legal/terms-of-service), [Community Guidelines](https://www.tiktok.com/community-guidelines), and applicable copyright, music-licensing, and privacy laws. You must only publish content you have the rights to distribute. By posting through the Service, you agree that your content complies with TikTok's requirements, including TikTok's music-usage, branded-content, and AI-generated content labeling rules where applicable.
* **Scopes.** We request only the OAuth scopes required for this feature: `video.publish` (publish videos you generate via Direct Post) and `user.info.basic` (read basic profile metadata such as display name, username, and avatar so you can confirm the publish target and show allowed privacy options). TikTok also grants `video.upload` with the Content Posting API; Treza does not use it.
* **Limited use.** Treza does not edit, delete, or manage your existing TikTok videos, comments, analytics, followers, or broader TikTok account settings through this integration.
* **Privacy and interaction settings.** Before publishing, the Service queries TikTok for your account's allowed privacy levels and interaction settings (such as comments, duet, and stitch). You choose the visibility and interaction options for each post; Treza does not post without your explicit confirmation in the publish flow.
* **Third-party terms.** Your use of TikTok is also governed by TikTok's terms and privacy policies. Treza is not affiliated with, endorsed by, or sponsored by TikTok or ByteDance.
* **Disconnect.** You can disconnect a TikTok account at any time in Settings → Connected accounts. Disconnecting removes Treza's ability to publish to that account on your behalf going forward.

***

#### 5.1 Schedules, Automations, and Other Integrations

* **Schedules.** A scheduled pipeline runs automatically at the times you set, spends credits, and publishes as it is configured, until you pause or delete the schedule. The Service may pause a schedule after several failed runs in a row, and you can set a daily spend limit, but you remain responsible for what your schedules run and publish.
* **Destinations you configure.** Steps that deliver files to your cloud storage (such as the AWS S3 step), call a web address or webhook, or send email send data where you direct, using the credentials and addresses you provide. You are responsible for having permission to use those destinations and to email the people you add, and for the security of the credentials you give us.
* **Media from links.** The Media Download step and similar features fetch media from links you provide. See Section 6 for your responsibilities when you use third-party media.

***

#### 6. Your Content and Generated Output

* **Inputs.** You retain all rights to the prompts, files, and other content you submit ("Inputs").
* **Outputs.** As between you and Treza, and to the extent permitted by law and by the applicable model provider's terms, you own the video, images, audio, text, and other content you generate ("Outputs"). Because of the nature of generative models, Outputs may not be unique, and similar or identical content may be generated for other users.
* **Responsibility.** You are responsible for your Inputs and Outputs and for ensuring you have the rights necessary to use them. You must not submit content you do not have the rights to use, or generate content that infringes, is unlawful, or otherwise violates these Terms.
* **Real people.** Some features can animate a photo, sync a face to audio, transfer motion onto a person, or create a speaking avatar. You may use a real person's face, body, or voice with these features only if you are that person or have their permission, and you must not use them to make it appear that a real person said or did something they did not in a way that could deceive viewers.
* **Third-party source media.** Some features take an existing video, audio file, podcast feed, or public page URL as input, including the clipping templates, the Media Download node, and any episodes or shows the Service suggests as examples. Suggested sources are offered for convenience only and are not a license or a representation that you may reuse them. You are solely responsible for confirming that you hold the rights, permissions, or a legal basis (such as fair use in your jurisdiction) to download, edit, clip, caption, or republish any third-party media you run through the Service, and for complying with the terms of the platform it came from. Treza does not review the sources you choose and is not responsible for claims arising from your use of them.
* **Sharing.** Share links you create let anyone who has the link view what you shared, unless you add a password, and links to your media files open for anyone who has them. You are responsible for what you share and with whom.
* **License to operate.** You grant Treza the limited rights needed to operate the Service, namely to process, store, and transmit your Inputs and Outputs to and from the providers described in Section 3, to publish them to the destinations you choose, and to provide the Service to you.
* **Feedback.** If you send us ideas or feedback about the Service, we may use them without any obligation to you.

***

#### 7. Acceptable Use

You agree not to use the Service to:

* Generate or distribute unlawful content, or content that infringes the intellectual property, privacy, or publicity rights of others.
* Create child sexual abuse material or any content that sexualizes minors.
* Create sexually explicit or nude images or video of a real person, or "undress" a real person, without their consent.
* Create non-consensual, deceptive, or defamatory impersonations or "deepfakes" of real people, or content designed to deceive people about real events, such as elections or emergencies, in a way that could cause harm.
* Harass, threaten, or defraud others, or generate malware or other harmful code.
* Send spam, including email to people who did not agree to receive it, or break the rules of the platforms you publish to, such as their rules on spam, misleading metadata, and inauthentic engagement.
* Create multiple accounts, or use stolen or unauthorized payment methods, to obtain free credits, avoid paying, or test payment cards.
* Reverse-engineer, exploit, overload, or attempt to gain unauthorized access to the Service, or circumvent its rate limits, safety filters, or access controls.
* Violate the usage policies of any underlying model provider.

We may refuse or stop runs, remove content or share links, pause schedules, and suspend or terminate accounts that violate this section, and we may report illegal content to the appropriate authorities.

#### 7.1 Reporting Intimate Images and Deepfakes

If you are shown in an intimate image or video made available through the Service without your consent, including one generated or altered by AI, you can ask us to remove it. A person authorized to act for you can ask on your behalf.

Email <alex@trezalabs.com> with the subject "Intimate image removal" and include:

* Your name and contact information, and your relationship to the person shown if you are acting for them.
* Enough information for us to find the content, such as a share link or where you saw it.
* A brief statement that you believe in good faith that the image or video was made or shared without the consent of the person shown.
* Your physical or electronic signature.

We remove validly reported content, and any identical copies we are aware of, within 48 hours of receiving the request, and we suspend the account that made it while we review it. We report apparent child sexual abuse material to the National Center for Missing & Exploited Children, and we keep records where the law requires us to.

***

#### 8. Fees, Credits, and Payment

* **Prepaid credits.** The Service is paid for with prepaid credits, shown in units where 100 credits equal US$1 of balance. You buy credits in one-time packs through Stripe at the prices on our [pricing page](https://trezalabs.com/pricing). Enterprise customers may instead be billed under a separate written agreement.
* **What is charged.** Runs are charged for the models and processing steps they use, at the prices shown in the app. A generation that fails is not charged, but if a run stops partway, the steps that finished before it stopped are charged. Replies from the in-app assistant and voice conversations also use credits, except where the app shows a free allowance.
* **Estimates.** The app may show an estimated cost before a run. Estimates are not guarantees, and the actual charge can be higher or lower. Credits may be held while a run is in progress. A run can take your balance slightly below zero, and your next purchase covers the difference.
* **Auto top-up.** If you turn on auto top-up, you authorize us and Stripe to charge your saved payment method the amount you chose whenever your balance falls below the threshold you set, up to any monthly limit you set, until you turn it off in Settings. Auto top-up turns itself off after repeated declined charges.
* **Free and promotional credits.** New accounts may receive a small amount of free credit, and we sometimes offer credit codes and purchase bonuses. Free and promotional credits have no cash value, cannot be transferred or refunded, and are limited as described when they are offered, for example one code per account. Codes must be redeemed before they expire. We may withhold or remove free credits obtained through multiple accounts or other abuse.
* **Crypto payments (x402).** When you pay per request with USDC on Base or Solana, the price is quoted with each request and the payment settles on-chain before the work runs. Blockchain payments are final and cannot be reversed. If a paid run fails, the amount stays as credit on that wallet's account so the request can be retried.
* **Expiry.** Purchased credits do not expire.
* **Refunds.** Purchases are final and credits are non-refundable, except where required by law. If a run fails or delivers nothing because of a problem on our side, we may restore the credits it used.
* **Disputes.** If you dispute a charge with your bank or card issuer, we may suspend your account while the dispute is open, and we may remove the credits from a payment that is reversed.
* **Changes.** We may change model prices, credit packs, and other prices at any time; the prices in effect when a run starts apply to it. We will give notice of material changes to these payment terms.

***

#### 9. Guardrails, Automated Checks, and Data Handling

The Service offers guardrail and redaction features to help you handle sensitive data. These features are provided to assist you, but they do not guarantee compliance with any law or standard, and you remain responsible for meeting your own regulatory and contractual obligations. You are responsible for not submitting sensitive data you are not permitted to process.

The Service also runs automated checks. Before it publishes text it wrote for you, such as a title, description, caption, or comment reply, an AI model reviews that text and may correct misspelled names or claims the source does not support; text you typed yourself is not changed. The Service screens prompts for certain prohibited requests and refuses them, and model providers apply their own safety filters, so a run may be refused or fail. These checks can make mistakes in both directions, and you remain responsible for what you publish.

Running the Service requires that we store your pipelines, Inputs, Outputs, and run history, and that authorised Treza personnel can access them where necessary to operate, support, secure, and improve the Service. We do not use your Inputs or Outputs to train our own models, and we will ask you before featuring your work publicly. See the [Privacy Policy](/terms-and-privacy/privacy) for what this covers.

***

#### 10. Partner Program

If you join the Treza partner (affiliate) program, the [Partner Program Terms](https://www.trezalabs.com/partners/terms) also apply to you.

***

#### 11. Copyright Complaints

If you believe content made available through the Service infringes your copyright, send a notice to our designated agent, registered with the U.S. Copyright Office under 17 U.S.C. 512(c):

Alex Daro, Copyright Agent\
Treza Labs, Inc.\
1301 N Broadway STE 94446\
Los Angeles, CA 90012\
Phone: (310) 270-6309\
Email: <alex@trezalabs.com>

Include in your notice: your name and contact information; a description of the copyrighted work; a description of the material you believe infringes it and where it can be found (for example, a share link); a statement that you have a good-faith belief the use is not authorized by the owner, its agent, or the law; a statement, under penalty of perjury, that the information in your notice is accurate and that you are the owner or authorized to act for the owner; and your physical or electronic signature. If you believe material you posted was removed by mistake, you may send the agent a counter-notice that meets the requirements of 17 U.S.C. 512(g). We may remove or disable access to the material and will terminate the accounts of repeat infringers in appropriate circumstances. Content you published to YouTube, TikTok, or another platform is also subject to that platform's own copyright process.

***

#### 12. Intellectual Property

The Service, including its software, design, templates, and content (excluding your Inputs and Outputs), is owned by Treza and protected by intellectual property laws. These Terms do not grant you any right to our trademarks or branding.

***

#### 13. Third-Party Platforms

YouTube, TikTok, and the other platforms you publish to decide whether to accept, show, recommend, label, monetize, restrict, or remove what you publish. Treza does not guarantee views, reach, revenue, or any other result, and is not responsible for actions a platform takes on your accounts or content.

***

#### 14. Disclaimers

THE SERVICE AND ALL OUTPUTS ARE PROVIDED "AS IS" AND "AS AVAILABLE," WITHOUT WARRANTIES OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY LAW, TREZA LABS, INC. DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. TREZA LABS, INC. DOES NOT WARRANT THAT THE SERVICE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY OUTPUT WILL BE ACCURATE, APPROPRIATE, LAWFUL TO USE, OR FIT FOR A PARTICULAR PURPOSE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SOME OF THESE EXCLUSIONS MAY NOT APPLY TO YOU.

Generative models can produce content that is inaccurate, offensive, or similar to existing works, and you should review Outputs before you rely on or publish them.

***

#### 15. Limitation of Liability

To the maximum extent permitted by law, Treza is not liable for any indirect, incidental, special, consequential, or punitive damages, or for any loss of profits, data, or goodwill, arising from your use of the Service. Our total liability for any claim arising out of or relating to the Service is limited to the amounts you paid us for the Service in the three months preceding the event giving rise to the claim.

***

#### 16. Indemnification

You will defend, indemnify, and hold harmless Treza and its personnel from any claims, damages, and costs (including reasonable legal fees) arising from your Inputs and Outputs, content you publish or share through the Service, your use of the Service, or your violation of these Terms or of anyone else's rights.

***

#### 17. Termination

You may stop using the Service at any time, and you can ask us to close your account by emailing <hello@trezalabs.com>. We may suspend or terminate your access if you violate these Terms, if we are required to by law, or to protect the Service, our users, or others. When an account is closed, we may delete its content as described in the [Privacy Policy](/terms-and-privacy/privacy), and unused credits are not refunded except where required by law. Provisions that by their nature should survive termination will survive.

***

#### 18. Changes to These Terms

We may update these Terms from time to time. If we make significant changes, we will notify you through the Service or by other means. Your continued use of the Service after any modifications constitutes acceptance of the updated Terms.

***

#### 19. General

These Terms, together with the Privacy Policy and any terms for specific programs such as the Partner Program Terms, are the entire agreement between you and Treza about the Service. If any provision is found unenforceable, the rest remain in effect. Our failure to enforce a provision is not a waiver of it. You may not transfer these Terms without our consent; we may transfer them in connection with a merger, acquisition, or sale of assets.

***

#### 20. Contact Information

If you have any questions about these Terms, please contact us at: <hello@trezalabs.com>

***

By accessing or using Treza, you acknowledge that you have read, understood, and agree to these Terms of Service.


# Privacy Policy

**Effective Date: July 11, 2026** · **Last Updated: October 21, 2026**\
Welcome to **Treza**. The Service is operated by **Treza Labs, Inc.** ("Treza," "Company," "we," "our," or "us"), which is responsible for the personal information described here. This Privacy Policy explains how we collect, use, disclose, and protect your information when you use our platform for building and running generative-media pipelines, including the website at trezalabs.com, the in-app chat and editors, the Treza API, the Treza MCP server and the apps that connect to it, and pay-per-request x402 purchases (collectively, the "Service"). By accessing or using the Service, you agree to the collection and use of information in accordance with this Privacy Policy.

{% hint style="info" %}
This document describes how the Service handles data today. It is provided for transparency and is not a substitute for legal advice. Please review it with your own counsel before relying on it.
{% endhint %}

***

#### 1. Information We Collect

**1.1 Information you provide or create**

**Account Information:** You sign in with Google (including Google One Tap), which shares your name, email address, profile photo, and Google account identifier with us. We use your email address as your account identifier and keep your name and photo in your signed-in session.\
**Pipeline Content:** We process and store the prompts, files, links, and other content you submit ("Inputs"), the pipelines (graphs of nodes), schedules, recipes, and timeline-editor projects you build, and the video, images, audio, text, and other content you generate ("Outputs"). We also store run history (including per-node status, timing, inputs and outputs, token and credit usage), the files in your library, and the share links you create.\
**Conversations:** We store your conversations with the in-app assistant, including the assistant panels in the pipeline and timeline editors, so you can return to them. This includes the messages, the media they reference, and any thumbs-up or thumbs-down feedback you give. Voice notes you record in the chat composer are stored as audio files. In live voice conversations, your microphone audio streams directly from your browser to OpenAI, and we store the text of each turn but not the audio.\
**Payment Information:** Card and other payment details are collected and processed by Stripe; we do not receive or store full card numbers. We store your Stripe customer ID, your purchase and credit history, and, if you turn on auto top-up, the saved payment method's ID and a short label such as the card brand and last four digits.\
**Crypto Payments:** If you pay for a request with USDC through x402, we receive and store the paying wallet address, the transaction reference, and the amount. Your wallet address becomes the identifier for that purchase history. Transactions on public blockchains are visible to anyone and cannot be deleted by us.\
**API Keys and Secrets:** We store a one-way hash of each Treza API key you create, which is how we authenticate requests made with it, and its last four characters so you can tell your keys apart. The full key is shown to you once, when you create it, and we cannot retrieve it later. We store the provider keys, cloud credentials, and other secrets you add to the Service in encrypted form so your pipelines can run, and we keep the last four characters of each secret unencrypted so you can tell them apart.\
**Connected Accounts (optional):** If you connect a YouTube channel, a TikTok account, or an AI assistant, we receive the information described in Sections 2.1 to 2.3.\
**Communications:** When you contact us, use the contact form, or reply to our emails, we receive your message and contact details. We also store your email preferences and a record of which product emails we have sent you.\
**Partner Program (optional):** If you join our partner (affiliate) program, we store your email address, the PayPal email address you give us for payouts, your referral code, the number of visits your link brings, and the sign-ups, purchases, commissions, and payouts attributed to you.\
**Credit Codes:** When you redeem a credit code, we record the code, your account, and the IP address it was redeemed from.

**1.2 Information collected automatically**

**Usage Data:** We collect data on how you interact with the Service, including IP address, browser type, device information, pages visited, features used, API requests, and timestamps. Our hosting provider records request logs, including IP addresses.\
**Sign-up Information:** When your account is created, we record the IP address it was created from and, where available, how you first found us: the page you landed on, the referring site, campaign (UTM) tags, and your device type (mobile, tablet, or desktop). If you arrived through a partner's link, we record which partner referred you.\
**Error Reports:** If the app crashes in your browser, it sends us the error message, the page address, the referring page, your browser's user agent, and your approximate location (country and region) so we can fix the problem.\
**Cookies and Analytics:** We and our analytics providers use cookies and similar technologies, as described in Section 3.1.

**1.3 Information about other people in your content**

Your Inputs and Outputs may include other people, for example their faces and voices in a video you upload or a podcast episode you clip, the email address of someone you ask to approve a pipeline step, or viewer comments on your YouTube videos when you turn on comment replies. We process this information only to run the pipelines and features you set up. You are responsible for having the right to submit it (see our [Terms of Service](/terms-and-privacy/terms-of-service)).

**1.4 Face detection and comparison**

Some features that frame vertical crops and choose thumbnails detect faces in your video. To avoid showing the same person twice in a thumbnail, the Service also computes numeric face measurements (face embeddings) and compares them within that video. This runs on our own servers, the measurements are held in memory only for that step, and they are discarded when the step ends. We do not store face measurements, build face databases, or use them to identify who a person is. Separately, to work out who is speaking, the Service sends video frames and audio to the AI models described in Section 2. They can label speakers with names taken from the source material, such as an episode description, and are instructed never to identify anyone from their face or appearance alone.

**1.5 Information from other sources**

We receive information from Google when you sign in, from YouTube and TikTok when you connect an account, from Stripe and our crypto payment facilitators about the status of your payments, and from AI assistants you connect (Section 2.3). To contact businesses that may be interested in Treza, we also obtain business contact information, such as a name, work email address, company, and role, from public sources and business-data providers such as Apollo.io. If we contact you this way, you can ask us to stop at any time by replying or by emailing us.

***

#### 2. Third-Party Model and Infrastructure Providers

To run your pipelines and operate the Service, we share data with the following providers. Each processes data under its own terms and privacy policy.

* **AI model access.** Most model requests go through **OpenRouter**, which passes your prompts, files, audio, and video frames to the developer of the model you or the assistant selected, such as Anthropic (Claude), OpenAI (GPT, Whisper), Google (Gemini, Veo, Lyria), ByteDance (Seedance, Seedream), Kuaishou (Kling), Alibaba (Wan, Qwen), MiniMax (Hailuo), Runway, Black Forest Labs (Flux), xAI (Grok Imagine), HeyGen, Meta, Mistral, DeepSeek, Tencent, and other model developers. The models available change over time, and you can choose any model OpenRouter offers.
* **Gondola** and **Venice AI**, for some Kling video renders. Gondola is a marketplace for Venice AI inference. Your prompt and any first-frame image go through Gondola to Venice AI, which passes them to Kuaishou (Kling) without your identity. Gondola keeps only accounting records (model, price, and timing), and Venice AI's copy of the finished clip is deleted once we have stored it.
* **fal.ai**, for motion transfer, lip sync, avatars, upscaling, background removal, speech isolation, and speaker labelling.
* **ElevenLabs**, for text-to-speech, sound effects, and music generated from your video.
* **OpenAI**, directly, for live voice conversations (Realtime API).
* **Web search** (Exa, through OpenRouter), to check names and facts in text the Service writes before it is published.
* **Amazon Web Services (AWS)**, for storage, databases, encryption keys, processing, and media delivery (Amazon S3, DynamoDB, KMS, SQS, Fargate, and CloudFront), in the United States.
* **Vercel**, for hosting, request logs, and Vercel Web Analytics and Speed Insights.
* **Stripe**, for card and other payments, auto top-up, and fraud prevention.
* **Coinbase** (x402 facilitator) and **PayAI** (Solana facilitator), to verify and settle crypto payments.
* **Resend**, to send email.
* **Google**, for sign-in, the YouTube Data and Analytics APIs when you connect a channel, and Google Analytics and Google Ads measurement.
* **TikTok**, for the TikTok Content Posting API when you connect an account.
* **IPRoyal**, a proxy network that the Media Download step uses to fetch media from the links you provide.
* **Apple** (podcast search), **GIPHY**, and **Pixabay**, which receive search terms when you use features that search them.
* **PayPal**, to pay partner commissions.

When a step in your pipeline sends data to a web address, webhook, cloud bucket, or other service you configure, such as an HTTP Request step or the AWS S3 delivery step, we send that data where you direct it.

We do not control how third-party providers handle data once it is transmitted to them. Some model providers may keep inputs for a limited time, for example to monitor for abuse, under their own policies, and your use of a particular model or integration may be subject to that provider's terms.

***

#### 2.1 YouTube Data (when you connect a channel)

Treza uses YouTube API Services. If you connect a YouTube channel, Treza accesses Google user data through the YouTube Data API v3 and the YouTube Analytics API subject to the [Google API Services User Data Policy](https://developers.google.com/terms/api-services-user-data-policy), including its Limited Use requirements. By using these features you also agree to the [YouTube Terms of Service](https://www.youtube.com/t/terms); the [Google Privacy Policy](http://www.google.com/policies/privacy) describes how Google handles data on its side.

We access and use this data as follows:

* **Channel ID, title, handle, and thumbnail:** to show which channel is connected and let you select a publish target. Stored while the channel remains connected.
* **OAuth refresh token:** to obtain short-lived access tokens when the Service acts on your channel (uploads, comments, statistics). Stored in encrypted form while the channel remains connected.
* **Video statistics and analytics:** view, like, and comment counts, watch time, and estimated revenue for videos published to your channel through the Service, to show a performance dashboard in your account. Stored alongside your publication history.
* **Comments on your published videos:** each public or unlisted video the Service uploads for you receives one comment, posted from your channel, that says the video was made with Treza and links to our site, unless you turn the comment off for that channel in Settings (see Section 4 of our [Terms of Service](/terms-and-privacy/terms-of-service)). When you turn on comment replies, the Service also reads viewer comments on videos it published for you and posts replies from your channel according to reply guidelines you configure. Viewer comments are sent to an AI model to write those replies and are not used for any other purpose. We store the IDs of comments we reply to, not their text.

We use YouTube and Google user data only to provide the connected-account, publishing, reporting, and comment features described here. We do not use it for advertising or analytics, sell it, or use it to train models, and we never send it, including your channel's name, to Google Analytics or any other analytics or advertising service. We share it only with Google as necessary to perform the actions you request, with the AI model providers in Section 2 when the Service writes titles, descriptions, and comment replies, and with infrastructure providers (such as AWS) solely to operate the Service.

You can disconnect a YouTube channel at any time in Settings → Connected accounts, which deletes Treza's stored OAuth credentials and channel details. You can also revoke Treza's access in your [Google Account permissions](https://myaccount.google.com/permissions) or via [Google security settings](https://security.google.com/settings/security/permissions).

***

#### 2.2 TikTok Data (when you connect an account)

If you connect a TikTok account, Treza accesses TikTok user data through the TikTok Content Posting API subject to [TikTok's developer terms](https://developers.tiktok.com/doc/terms-and-conditions) and applicable TikTok policies.

We access and use this data as follows:

* **Open ID, display name, username, and avatar:** to show which TikTok account is connected and let you select a publish target. Stored while the account remains connected.
* **Creator publish settings** (such as allowed privacy levels and interaction toggles): queried from TikTok when you configure or confirm a publish action, so the Service can present only options TikTok allows for your account. Not stored beyond what is needed for the active publish flow.
* **OAuth refresh token:** to obtain short-lived access tokens when you initiate a publish. Stored in encrypted form while the account remains connected. TikTok may rotate refresh tokens; we store the latest token TikTok issues.

We use TikTok user data only to provide the connected-account and video-publishing features you request. We do not use it for advertising or analytics, sell it, or use it to train models, and we never send it to an analytics or advertising service. We share it only with TikTok as necessary to perform publishes you request and with infrastructure providers (such as AWS) solely to operate the Service.

You can disconnect a TikTok account at any time in Settings → Connected accounts, which deletes Treza's stored OAuth credentials for that account. You can also revoke Treza's access in your TikTok account settings or through TikTok's connected-apps controls where available.

***

#### 2.3 AI Assistants You Connect (ChatGPT, Claude, and other MCP clients)

You can connect Treza to an AI assistant, such as the Treza plugin in ChatGPT, a connector in Claude, or another app that supports the Model Context Protocol (MCP). To connect, you sign in to Treza and approve the permissions the assistant asked for. The assistant can then act on your Treza account within those permissions when you ask it to.

* **What we receive.** We receive the information the assistant includes in each request it sends to Treza, such as a video brief or prompt, a pipeline it is building, inputs for a run, the caption and title for a post, and files or links you share with it to add to your library. We do not receive your full conversation, your chat history, or the assistant's memory, except for whatever the assistant includes in a request.
* **What we record.** We record which assistant connected to your account (for example ChatGPT or Claude) and when it was first and last used, so we can show it in your account and help you if something goes wrong. We also keep a log of the tools an assistant calls on your account and their results. For each call, the log keeps a short excerpt of the words in the request, such as a prompt, a voiceover script, or a caption or title, but not the files, links, or media it names. We keep this log for 120 days, and you can ask us to delete it sooner (Section 4).
* **What we send back.** We return the information needed to answer each request, such as your pipelines, the status and results of your runs, links to your media, your credit balance, and the names of your connected channels. Once returned, that information is part of your conversation with the assistant and is handled under the assistant provider's own terms and privacy policy, for example [OpenAI's Privacy Policy](https://openai.com/policies/privacy-policy) for ChatGPT or [Anthropic's Privacy Policy](https://www.anthropic.com/legal/privacy) for Claude.
* **How we use it.** We use information from an assistant's requests to carry them out, the same way we handle a request you make in the Treza app. We also review the request log to fix problems and to learn which requests the Service handles poorly, so we can improve it. What the assistant creates is stored in your account as described in Section 1, for example a pipeline it builds or a file it adds to your library. We do not use this information for advertising, sell it, or use it to train models.
* **Access tokens.** When you approve a connection, Treza issues the assistant an access token that expires after one hour and a refresh token that expires after 90 days. The assistant holds these tokens; Treza verifies them on each request and does not store them.
* **Disconnecting.** You can disconnect Treza at any time in the assistant's settings, which removes the tokens the assistant holds. Pipelines, media, and runs created through the assistant stay in your Treza account until you delete them.

***

#### 3. How We Use Your Information

We use your information to:

* Provide, maintain, and improve the Service
* Execute your pipelines and return generated Outputs
* Connect YouTube channels and TikTok accounts and publish videos you generate, when you choose to use those features
* Carry out requests from AI assistants you connect, and return the results to them
* Process transactions, manage prepaid credits, auto top-up, and payments, and pay partner commissions
* Maintain run history, usage insights, and audit records
* Investigate errors and failed runs, and answer support requests you raise
* Send you service emails and, unless you unsubscribe, product emails (Section 3.2)
* Understand how the Service is used and measure our marketing and advertising, so we can improve them
* Credit partners for the customers they refer
* Monitor usage and security, and detect and prevent fraud, abuse, card testing, and misuse of free credits (for example, by limiting how many accounts created from one IP address receive free credits)
* Comply with legal obligations and enforce our Terms of Service

We do not use your Inputs or Outputs to train our own models.

**Automated checks.** Before the Service publishes text it wrote for you, such as a video title, description, caption, or comment reply, an AI model reviews it against the source material and may correct misspelled names or claims the source does not support. Text you typed yourself is not changed. The Service also screens prompts for certain prohibited requests, such as requests to undress a real person, and refuses them before they reach a model. Model providers apply their own safety filters too.

**Access by our team.** Your pipelines, Inputs, Outputs, and run history belong to you. A limited number of authorised Treza personnel can access them where it is necessary to operate the Service: to investigate a failed run or a billing question, to respond to a support request, to prevent abuse, and to understand which parts of the product work so that we can improve them. We keep that access to what the task requires, we do not use it to build competing content, and we do not share your content, your pipelines, or your connected channels with anyone outside Treza except as described in Section 5. If we would like to feature your work publicly, for example as a case study, we will ask you first.

***

#### 3.1 Cookies and Similar Technologies

Treza stores and accesses information on your device to operate the Service, remember your choices, and understand how the Service is used. We set these first-party cookies:

* `treza_session` keeps you signed in (30 days).
* `treza_oauth` and `treza_onetap` protect the Google sign-in flow against forgery (10 minutes and 24 hours).
* `treza_seen` remembers that this browser has signed in before (1 year).
* `treza_onboarded` remembers that you finished onboarding (1 year).
* `treza_attr` records how you first found us: landing page, referring site, campaign tags, and device type (1 year). Where we ask for consent first (see "Your cookie choices" below), it is set only after you accept.
* `treza_via` records the partner whose link you followed, so the partner can be credited if you sign up or buy credits (60 days).
* `treza_partner` keeps partners signed in to the partner dashboard (90 days).
* `treza_share_<id>` remembers that you entered the password for a password-protected share link (12 hours).
* `treza_consent` remembers your cookie choice (6 months), and `treza_consent_region` records whether visitors from your region are asked before analytics and advertising cookies are used (30 days).
* `treza_youtube_connected_name` and `treza_tiktok_connected_name` carry the name of an account you just connected to the page you return to, so it can say which account was added (2 minutes).

We also use **browser storage** (localStorage and sessionStorage) for interface state, such as in-progress flows, editor preferences, and draft inputs, and, subject to your cookie choices, to remember campaign tags and Google Ads click identifiers from the link that brought you to the site. Those tags and identifiers are attached to our analytics events and to your checkout, so we can tell which campaigns lead to purchases.

Third parties set cookies or collect information through the Service as follows:

* **Google Analytics and Google Ads.** We use Google Analytics on the website and in the app, and Google Ads conversion measurement, which set cookies such as `_ga` and `_gcl_au`. We also report purchases to Google Analytics from our servers, including the campaign tags and ad click identifiers saved at checkout, unless you declined analytics cookies; ad click identifiers are included only if you allowed advertising cookies. See [how Google uses information from sites that use its services](https://policies.google.com/technologies/partner-sites). You can opt out with the [Google Analytics opt-out browser add-on](https://tools.google.com/dlpage/gaoptout) and control ad personalization in [Google's ad settings](https://adssettings.google.com).
* **Vercel Web Analytics and Speed Insights** measure page views and page performance without using cookies.
* **Google sign-in** sets a cookie (`g_state`) to remember whether you dismissed the One Tap prompt.
* **YouTube.** When you preview a connected channel's video in Settings, the embedded YouTube player may set YouTube cookies.
* **Stripe** sets cookies during checkout for fraud prevention, as described in [Stripe's privacy policy](https://stripe.com/privacy).

**Your cookie choices.** If you visit from the European Economic Area, the United Kingdom, or Switzerland, we ask before using analytics and advertising cookies. Until you choose **Accept**, Google Analytics and Google Ads run in a mode that sets no cookies and receives only limited measurement signals without cookie identifiers, and `treza_attr` and the stored campaign tags are not set. Visitors elsewhere can decline the same cookies. You can change your choice at any time with **Cookie settings** at the bottom of our website; declining removes the analytics and advertising cookies and stored campaign data set before. If your browser sends a [Global Privacy Control](https://globalprivacycontrol.org) signal, we treat it as a request to opt out of advertising cookies and ad measurement, wherever you are.

You can also control or delete cookies in your browser settings; blocking the first-party authentication cookies will prevent signing in. We do not allow other third parties to collect information from your device through the Service except as listed above.

***

#### 3.2 Emails We Send

We send **service emails** that relate to your account and the things you asked the Service to do, such as purchase confirmations, failed payment and auto top-up notices, notices that your media is ready, and alerts about scheduled runs that fail or are paused. We also send **product emails**, such as a welcome message, reminders about an unfinished checkout or unused credits, notices that your free credits are used up, and occasional offers and feature announcements. Product emails include an unsubscribe link, and you can choose which notifications you receive in Settings. If a pipeline you build sends email to someone else, for example an approval request, we send it on your behalf to the address you entered.

***

#### 4. Data Retention and Deletion

We retain your information for as long as your account is open or as needed to provide the Service, and afterwards as needed to comply with legal, tax, and accounting obligations, resolve disputes, prevent fraud and abuse, and enforce our agreements. Specifically:

* **Your content.** Pipelines, run history, Outputs, uploads, conversations, and editor projects are kept so you can return to them. You can delete pipelines, chat conversations, editor projects, saved secrets, API keys, and connected accounts yourself. Deleting an item removes it from your account, but related media files and run records may remain in our storage until you ask us to delete your account.
* **Connected accounts.** YouTube and TikTok credentials and profile details are kept until you disconnect the account in Settings → Connected accounts.
* **Share links.** A share link stays active until it expires (if you set an expiry) or you revoke it.
* **Payment and credit records** are kept as long as required for tax, accounting, and fraud-prevention purposes, even after an account is deleted.
* **Short-lived data.** Sign-in sessions expire after 30 days; sign-in and connection codes expire within minutes; rate-limit records, which can include IP addresses, expire automatically shortly after their time window ends; and the temporary working files created while a run is processed are deleted when it finishes. Our worker logs are kept for 14 days, and the log of requests from AI assistants you connect (Section 2.3) for 120 days.
* **Backups.** Our databases and stored media keep backups for up to 35 days, so deleted information can remain in backups for that period.

To delete your account and the content in it, or to request deletion of other personal data, contact [**hello@trezalabs.com**](mailto:hello@trezalabs.com) from the email address on your account. We will delete or de-identify your information, subject to the legal and contractual obligations above.

***

#### 5. Data Sharing and Disclosure

We do not sell your personal data. We share data only as follows:

**Service Providers:** Third-party providers that help us operate the Service, including the model, hosting, payment, email, and analytics providers listed in Sections 2 and 3.1.\
**Platforms and Destinations You Choose:** When you publish to YouTube or TikTok, deliver files to your cloud storage, or send data to a web address or email address from a pipeline, we send it where you direct.\
**AI Assistants You Connect:** At your direction, we send an assistant you connected the account information its requests ask for, as described in Section 2.3.\
**Share Links and Media Links:** Anyone who has a share link you create can view what it shares, unless you protect it with a password. Links to your media files are unlisted but not secret: anyone who has a media link can open that file, so share them with care.\
**Partners:** If you sign up or buy credits after following a partner's link, the partner can see that a referred sign-up or purchase happened and its amount, but not your name or email address.\
**Fraud Prevention:** If we block an account for fraud or abuse, we may add its payment customer ID and email address to Stripe's fraud-prevention block lists.\
**Legal Compliance:** If required by law, we may disclose information to law enforcement or regulatory authorities, or to protect the rights, property, or safety of Treza, our users, or others.\
**Business Transfers:** In the event of a merger, acquisition, or sale of assets, your information may be transferred as part of that transaction.

***

#### 6. Security

We implement reasonable technical and organizational measures to protect your data, including encryption in transit, encryption of stored media and databases, encryption of stored secrets, provider keys, and OAuth refresh tokens for connected YouTube and TikTok accounts, signed links for media delivery, and access controls that limit which Treza personnel and systems can reach your data. However, no system is completely secure, and we cannot guarantee absolute security. You are responsible for keeping your account credentials and Treza API keys confidential and for not embedding them in client-side code.

***

#### 7. Your Content and Generated Output

You retain your rights to your Inputs, and, to the extent permitted by law and the applicable model provider's terms, you own your Outputs. Because of the nature of generative models, Outputs may not be unique. Generative models can also produce inaccurate content, and you should verify Outputs before relying on them. See our [Terms of Service](/terms-and-privacy/terms-of-service) for details on content ownership and acceptable use.

***

#### 8. Your Rights

Depending on where you live, you may have the right to:

* Know what personal information we hold about you and access a copy of it
* Correct, update, or delete your personal information
* Object to or restrict certain processing of your data, including processing based on our legitimate interests
* Request a portable copy of your data
* Withdraw consent where we rely on it
* Opt out of the use of your information for targeted advertising, including with **Cookie settings** on our website or a Global Privacy Control signal (Section 3.1)
* File a complaint with a regulatory authority

To exercise these rights, contact [**hello@trezalabs.com**](mailto:hello@trezalabs.com). We will verify your request using the email address on your account, and you may use an authorized agent where the law allows. We will not discriminate against you for exercising your rights.

**Legal bases (EEA, UK, and Switzerland).** We process your information to perform our contract with you (running the Service, processing payments, publishing to accounts you connect); for our legitimate interests (securing the Service, preventing fraud and abuse, understanding how the Service is used, measuring and improving our marketing, and contacting businesses about Treza); to comply with legal obligations; and with your consent where the law requires it, such as for analytics and advertising cookies for visitors from the EEA, the UK, and Switzerland.

***

#### 9. International Data Transfers

We store data in the United States, and our providers may process it in the United States and in other countries where they operate. Where we transfer personal data across borders, we take steps to ensure it receives an appropriate level of protection consistent with applicable law.

***

#### 10. Children's Privacy

The Service is intended for people who are at least 18 years old (or the age of majority where they live) and is not directed to children. We do not knowingly collect personal information from anyone under 18. If you believe a minor has provided us with personal information, please contact us so we can delete it.

***

#### 11. Changes to This Privacy Policy

We may update this Privacy Policy from time to time. If we make significant changes, we will notify you through the Service or by other means. Your continued use of the Service after any modifications constitutes acceptance of the updated Privacy Policy.

***

#### 12. Contact Information

If you have any questions about this Privacy Policy or how we handle your data, please contact us at [**hello@trezalabs.com**](mailto:hello@trezalabs.com) or by mail:

Treza Labs, Inc.\
1301 N Broadway STE 94446\
Los Angeles, CA 90012

***

By accessing or using Treza, you acknowledge that you have read, understood, and agree to this Privacy Policy.


