> 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).

# 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/).
* A few credits for model runs. New accounts start with free credits, and you can top up in billing settings any time. See [Plans & Pricing](/ai-gateway/plans-and-pricing.md).

***

## 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.md).

***

## 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.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 roll back from **Publishing & versioning** if you need to. See [Publishing & versioning](/pipelines/publishing.md).

***

## 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.md) reference.

***

## Next steps

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