Treza Pipelines API

The Pipelines API from Treza — 2 operation(s) for pipelines.

GitHub OpenAPI

Operations 3

POST /api/pipelines/{id}/invoke Invoke a published pipeline #
GET /api/pipelines/{id}/invoke Poll a pipeline run #
POST /api/pipelines/{id}/chat/completions OpenAI-compatible pipeline endpoint #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/trezalabs-com:trezalabs-com-pipelines-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

trezalabs-com-pipelines-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Treza Pipelines API
  description: 'Treza builds video pipelines from a description. Build pipelines that chain the best AI models (Veo 3.1, Seedance 2.5, Gemini Image, Llama, and any open model) with voiceover, captions, sequencing, and publishing, then call any published pipeline as an API.


    Two ways to call a published pipeline:

    - Typed invoke: POST /api/pipelines/{id}/invoke with JSON inputs matching the pipeline''s input contract. Returns a runId (HTTP 202); poll GET /api/pipelines/{id}/invoke?runId=... for status and outputs.

    - OpenAI-compatible: POST /api/pipelines/{id}/chat/completions works as a drop-in for any OpenAI SDK, streaming included. The latest user message feeds the pipeline and the output returns as the assistant message.


    Authentication uses scoped API keys (Bearer treza_live_...) created in the Treza platform or minted over MCP (create_api_key). The key must own the pipeline and the pipeline must be published. Starting a run needs the pipelines:run permission; polling one takes pipelines:read or pipelines:run. Billing is prepaid credits that work across every model; check the balance at GET /api/account/balance, and top up either via a human at the dashboard or, on deployments with x402 enabled, agent-natively at POST /api/billing/credits/x402.


    An MCP server is also available at https://www.trezalabs.com/api/mcp (streamable HTTP, OAuth 2.1) exposing tools to list, author, and publish pipelines, inspect runs, trigger new runs, check the credit balance, estimate run cost, and mint scoped API keys (create_api_key, for OAuth connections). Every one of those tools is also plain HTTP with an API key, listed below under /api/v1/tools/{name}: POST the tool''s arguments as the JSON body, with the same key. They list your pipelines, runs and media library, author and publish pipelines, run them, and assemble or edit media.'
  version: 3.0.0
  contact:
    name: Treza Support
    url: https://www.trezalabs.com/support
    email: hello@trezalabs.com
servers:
- url: https://www.trezalabs.com
  description: Production
security:
- bearerAuth: []
tags:
- name: Pipelines
paths:
  /api/pipelines/{id}/invoke:
    post:
      operationId: invokePipeline
      summary: Invoke a published pipeline
      description: 'Starts a run of the deployed pipeline snapshot with the given inputs. Returns a runId immediately (202); poll the GET variant of this path for status and outputs. Needs the pipelines:run permission. inputs is the only field read: there is no callback URL or price cap here (POST /api/v1/tools/run_pipeline takes callbackUrl and quoteId). Limits: 60 requests a minute per account, shared with chat/completions, and no new run while 10 runs of the pipeline are in progress. If the background queue cannot take the run, it runs in place and the call answers 200 with the finished run.'
      parameters:
      - name: id
        in: path
        required: true
        description: Pipeline id
        schema:
          type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                inputs:
                  type: object
                  description: Values keyed by the pipeline's input contract (an input node's id also works). Keys the pipeline does not have are ignored.
                  additionalProperties: true
      responses:
        '200':
          description: The queue could not take the run, so it ran in place; this is the finished run.
          content:
            application/json:
              schema:
                type: object
                properties:
                  runId:
                    type: string
                  status:
                    type: string
                    enum:
                    - success
                    - error
                    - partial
                    - cancelled
                  version:
                    type: integer
                  outputs:
                    type: object
                    additionalProperties: true
                  usage:
                    type: object
                    properties:
                      prompt:
                        type: integer
                      completion:
                        type: integer
                      total:
                        type: integer
                      costUsd:
                        type: number
                        description: Provider cost in USD before markup, when reported (not the credits charged).
                  durationMs:
                    type: integer
        '202':
          description: Run accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunAccepted'
        '401':
          description: Missing, invalid or deactivated API key
        '402':
          description: The balance does not cover the run's estimated charge plus what is already committed to runs still rendering. Nothing is charged. code is INSUFFICIENT_CREDITS; relay topUpUrl to a human, or top up from a wallet at x402TopUpUrl.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
                    enum:
                    - INSUFFICIENT_CREDITS
                  balanceUsd:
                    type: number
                  topUpUrl:
                    type: string
                    format: uri
                    description: Where a person buys credits.
                    example: https://www.trezalabs.com/platform/settings#billing
                  x402TopUpUrl:
                    type: string
                    format: uri
                    description: Agent-native top-up with an x402 payment; present when x402 is on.
                    example: https://www.trezalabs.com/api/billing/credits/x402
        '403':
          description: The key's account does not own this pipeline, or the key lacks pipelines:run (code MISSING_SCOPE)
        '404':
          description: Pipeline not found
        '409':
          description: Pipeline is not published
        '429':
          description: Rate limit (code RATE_LIMITED, with retryAfter in seconds and Retry-After and X-RateLimit-* headers) or 10 runs of this pipeline already in progress (code TOO_MANY_CONCURRENT_RUNS)
        '500':
          description: Internal server error
      tags:
      - Pipelines
    get:
      operationId: getInvokeRunStatus
      summary: Poll a pipeline run
      description: Returns the status of a run started via invoke, including outputs once it has finished. Needs pipelines:read or pipelines:run. A failed run is status error here, not an HTTP error.
      parameters:
      - name: id
        in: path
        required: true
        description: Pipeline id
        schema:
          type: string
      - name: runId
        in: query
        required: true
        description: Run id returned by the invoke call (URL-encode it)
        schema:
          type: string
      responses:
        '200':
          description: Run status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunStatus'
        '400':
          description: runId is required
        '401':
          description: Missing, invalid or deactivated API key
        '403':
          description: The key's account does not own this pipeline, or the key has neither pipelines:read nor pipelines:run (code MISSING_SCOPE)
        '404':
          description: Pipeline not found, or run not found
        '500':
          description: Internal server error
      tags:
      - Pipelines
  /api/pipelines/{id}/chat/completions:
    post:
      operationId: pipelineChatCompletions
      summary: OpenAI-compatible pipeline endpoint
      description: 'Drop-in replacement for the OpenAI chat completions API. Point any OpenAI SDK at https://www.trezalabs.com/api/pipelines/{id} with a Treza API key carrying pipelines:run. The text of the latest user message is fed into every input node and the output node''s value is returned as the assistant message. The request stays open until the run finishes and gives up after about five minutes, so call video pipelines with invoke. With stream true the finished answer is sent as chat.completion.chunk server-sent events ending in data: [DONE]. Shares invoke''s 60 requests a minute per account; it has no concurrent-run limit. Every error is OpenAI-shaped: { error: { message, type, code? } }.'
      parameters:
      - name: id
        in: path
        required: true
        description: Pipeline id
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - messages
              properties:
                model:
                  type: string
                  description: Accepted and echoed back; the pipeline's nodes choose the models.
                messages:
                  type: array
                  minItems: 1
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                      content:
                        description: A string, or an array of parts whose text parts are joined (others are dropped).
                        oneOf:
                        - type: string
                        - type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                              text:
                                type: string
                stream:
                  type: boolean
      responses:
        '200':
          description: Chat completion (JSON, or SSE when stream is true). x-treza-run-id names the recorded run and x-treza-pipeline-version the published version that served it.
          headers:
            x-treza-run-id:
              schema:
                type: string
            x-treza-pipeline-version:
              schema:
                type: string
        '400':
          description: The messages array is missing or empty (type invalid_request_error)
        '401':
          description: Missing, invalid or deactivated API key (type authentication_error)
        '402':
          description: The balance does not cover the run's estimated charge. The error object has type billing_error and carries code INSUFFICIENT_CREDITS, balanceUsd, topUpUrl (relay it to a human) and, when x402 is on, x402TopUpUrl.
        '403':
          description: The key's account does not own this pipeline (type permission_error), or the key lacks pipelines:run (code MISSING_SCOPE)
        '404':
          description: Pipeline not found (type not_found_error)
        '409':
          description: Pipeline is not published
        '422':
          description: The pipeline has no input node or no output node
        '429':
          description: 'Rate limit: type rate_limit_error, code RATE_LIMITED and retryAfter (seconds), with Retry-After and X-RateLimit-* headers'
        '500':
          description: Internal server error (type server_error)
        '502':
          description: 'The pipeline ran and failed: type pipeline_error, code pipeline_failed, and the failed node''s message'
      tags:
      - Pipelines
components:
  schemas:
    RunStatus:
      type: object
      properties:
        runId:
          type: string
        status:
          type: string
          enum:
          - running
          - success
          - error
          - partial
          - cancelled
          description: cancelled is a run stopped before it finished (cancel_run or the dashboard), or one Treza closed after its worker was lost.
        version:
          type: integer
          description: The published version that ran.
        startedAt:
          type: string
          format: date-time
        finishedAt:
          type: string
          format: date-time
          description: Present once the run has finished.
        durationMs:
          type: integer
          description: Present once the run has finished.
        usage:
          type: object
          description: Token counts summed over the run's model steps, and the provider cost when reported.
          properties:
            prompt:
              type: integer
            completion:
              type: integer
            total:
              type: integer
            costUsd:
              type: number
              description: Provider cost in USD before markup (not the credits charged).
        outputs:
          type: object
          description: Values keyed by the output contract of the version that ran, present once the run has finished. Media URLs are returned verbatim; long text values are truncated.
          additionalProperties: true
    RunAccepted:
      type: object
      properties:
        runId:
          type: string
          example: 2026-07-10T18:30:00.000Z#a1b2c3d4
        status:
          type: string
          enum:
          - running
        version:
          type: integer
          description: The published version serving the run.
        statusUrl:
          type: string
          format: uri
          description: Ready-made URL to poll (GET this path with runId).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Scoped API key created in the Treza platform (treza_live_...)
    WalletAuth:
      type: apiKey
      in: header
      name: SIGN-IN-WITH-X
      x-agentcash-auth-kind: siwx
      description: 'Sign-In-With-X (the x402 sign-in-with-x extension, CAIP-122): a wallet''s signed proof of itself, for the free purchases list. Answer the 402 challenge; no payment.'