Pipeline API

Integrate in minutes

Every published pipeline is a versioned HTTP endpoint. Call it with the typed/invokeAPI, or point any OpenAI SDK at the OpenAI-compatible/chat/completionsendpoint. Change one base URL and generate from your product, scripts, or agents.

  1. Step 01

    Build and publish a pipeline

    On the canvas, wire your models, prompts, and guardrails into a pipeline and run it. When it works, click Publish. Publishing snapshots the graph and assigns a version, and API traffic always runs the published version, never your draft.

  2. Step 02

    Create an API key

    On the API keys page, generate a key. The key (treza_live_...) is shown once, so store it in a secrets manager. A key can only invoke pipelines owned by the same account.

  3. Step 03

    Call your pipeline

    Send your input keys to the typed /invoke endpoint for JSON in and JSON out, or point any OpenAI SDK at the OpenAI-compatible /chat/completions endpoint. That is the only code change.

Drop it into your client

The /chat/completions endpoint has the same request shape as the OpenAI API. No SDK rewrite, no refactor.

Python (OpenAI SDK)
from openai import OpenAI

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

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

# The output node's value, e.g. a URL to the generated asset
print(completion.choices[0].message.content)
Node.js (OpenAI SDK)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "treza_live_...",
  baseURL: "https://trezalabs.com/api/pipelines/YOUR_PIPELINE_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);
curl (typed /invoke)
curl https://trezalabs.com/api/pipelines/YOUR_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"
    }
  }'
POST/invoke

Typed JSON in, JSON out. Send your pipeline’s input keys and get back each output node’s value, plus the run id, published version, and usage.

Response
// POST returns immediately with a runId (202):
{
  "runId": "2026-07-10T18:30:00.000Z#a1b2c3d4",
  "status": "running",
  "version": 3,
  "statusUrl": "https://trezalabs.com/api/pipelines/YOUR_PIPELINE_ID/invoke?runId=..."
}

// Poll GET .../invoke?runId=... until status is not "running":
{
  "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
}
POST/chat/completions

OpenAI-compatible. The latest user message is fed into the pipeline’s entry node, and the output node’s value is returned as the assistant message. Set stream: true for Server-Sent Events.

  • Returns a standard chat.completion object.
  • Any OpenAI SDK’s streaming mode works unchanged.

Required headers

  • AuthorizationBearer treza_live_... (your Treza API key)
  • Content-Typeapplication/json

The pipeline must be published, and the key must own it.

Runs and versioning

Every request is recorded in run history. The typed endpoint returns the version that served it; the chat endpoint returns x-treza-run-id and x-treza-pipeline-version headers so you can tie any completion back to a run. Re-publish to cut a new version; roll back any time.

Ship your first pipeline endpoint

Build a pipeline, publish it, and call it from your code. Prepaid credits, no subscription.

Start free trial->