> 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/getting-started/concepts.md).

# 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](https://docs.trezalabs.com/pipelines/models.md) 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](https://docs.trezalabs.com/api/pipeline-api.md) 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**](https://docs.trezalabs.com/pipelines/quickstart.md) → *Go from a prompt to a published API*
* [**Models**](https://docs.trezalabs.com/pipelines/models.md) → *The model catalog and how to use any model id*
* [**Pipeline API**](https://docs.trezalabs.com/api/pipeline-api.md) → *Call a published pipeline over HTTP*
* [**Publishing & versioning**](https://docs.trezalabs.com/pipelines/publishing.md) → *Publish, version, and roll back*

***
