API Keys
Treza API keys authenticate programmatic access to the platform: calling a published pipeline and connecting AI assistants over the MCP server. A key looks like treza_live_..., is scoped to your account, and is sent as a bearer token.
Create a key
In the dashboard, open the API keys page and create a key.
Use a key
Send the key in the Authorization header as a bearer token on every request:
Authorization: Bearer treza_live_...For example, invoking a published pipeline:
curl https://trezalabs.com/api/pipelines/<id>/invoke \
-H "Authorization: Bearer treza_live_..." \
-H "Content-Type: application/json" \
-d '{ "inputs": { "brief": "A 6-second product demo" } }'The same key works with the OpenAI-compatible endpoint. Point any OpenAI SDK at your pipeline and pass the key as the api_key. See the Pipeline API.
Ownership and scope
Account-scoped. A key can only act on resources owned by the same account. In particular, a key can only invoke pipelines your account owns; calls to another account's pipeline return
403.Published only. Pipeline endpoints serve the published snapshot. An unpublished pipeline returns
409.Credits. Calls that run a pipeline draw from your account's prepaid credit balance. If the balance is empty, requests return
402.
Scopes
Keys carry scoped permissions that gate access per feature. Grant only the scopes a key needs.
pipelines:read
List pipelines and read run history over the MCP server, and poll runs with GET .../invoke on the Pipeline API
pipelines:run
Start pipeline runs: /invoke and /chat/completions on the Pipeline API, and over the MCP server
pipelines:write
Author and publish pipelines, and add to or edit your media library, over the MCP server
keys:provision
Mint new keys with create_api_key over an OAuth connection. A key can never mint another key
Invoking a published pipeline requires a valid key that owns the pipeline and carries pipelines:run.
Manage and rotate
Revoke a key from the API keys page the moment you suspect it is exposed.
Rotate keys periodically: create a new key, move your integrations over, then delete the old one.
Never embed a key in client-side code or a public repository. Call Treza from your backend, where the key stays secret.
Related
Pipeline API - call a published pipeline with your key.
MCP Server - connect Claude and other AI assistants with
pipelines:*scopes.Build your first pipeline - end-to-end, including creating a key.
Last updated