> For the complete documentation index, see [llms.txt](https://docs.trezalabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trezalabs.com/pipelines/quickstart.md). Agents can also search and read this documentation through its [MCP server](https://docs.trezalabs.com/~gitbook/mcp).

# 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, and you can top up any time under **Billing** on your **Account** page (click your name at the bottom of the sidebar).

***

## 1. Create a pipeline

Open **Pipelines** in the sidebar. It reopens the pipeline you last had open. Click the folder icon at the left of the toolbar (**Open a saved pipeline or start from a template**), then **New pipeline**, or pick a template like **Product Demo Video** on the **Templates** tab and tweak it.

A new, empty pipeline asks **What do you want to make?** Describe it and the canvas assistant builds the graph for you, pick a template, or choose **Blank canvas** to wire it yourself as below.

***

## 2. Add and wire nodes

Drag nodes from the **Nodes** panel onto the canvas and connect them by dragging an edge from one node's output to the next node's input. Press `/` to search for a node by name. A simple starter graph:

1. **Text Input** - accepts the brief, for example a product description.
2. **Text Generation** - refines the brief into a proper shot prompt.
3. **Video Generation** or **Image Generation** - renders the prompt with a model like Veo 3.1 or a Gemini image model.
4. **Output** - returns the generated asset. Its **Name** becomes the key in the API response.

Pick a model on each generation node. You can change it any time, or type an OpenRouter model id into the node. See [Models](https://docs.trezalabs.com/pipelines/models.md).

***

## 3. Run it

Click **Run**. Treza executes the graph and shows each node's status, output, timing, and token counts. If the run is estimated at $1 or more, the price is shown first and the run waits for you to confirm. Runs happen in the background, so you can keep editing while a video renders. Click the clock icon (**Run history**) to inspect any past run node by node.

Model nodes need no key of yours. If an integration node needs one, such as an HTTP Request to your own API, add it to the [secrets manager](https://docs.trezalabs.com/getting-started/concepts.md#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 restore an earlier one from **Version history** in the **Published** dialog if you need to. See [Publishing & versioning](https://docs.trezalabs.com/pipelines/publishing.md).

***

## 5. Create an API key

Click your name at the bottom of the sidebar to open **Account**, go to **Developer**, and create a key under **API keys**. The **Published** dialog links there too. 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](https://docs.trezalabs.com/api/pipeline-api.md) reference.

***

## Next steps

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