crewai-treza
Treza tools for CrewAI. An agent in your crew can generate AI pictures and video clips and run your saved Treza pipelines. Treza prices every render first, and a max_cost_usd you set stops any render that costs more, with nothing spent.
Install
pip install -U crewai-treza
Create a Treza account at https://www.trezalabs.com, add credits, and make an API key at https://www.trezalabs.com/platform/api-keys with the pipelines:read, pipelines:write and pipelines:run permissions. Then:
export TREZA_API_KEY="treza_live_..."
The package is free. Renders are paid from your prepaid Treza credits; there is no subscription.
Tools
| Class | Name the agent sees | What it does | Cost |
|---|---|---|---|
TrezaGenerateImage |
treza_generate_image |
A picture from a prompt, optionally from reference pictures. | Treza credits |
TrezaGenerateVideo |
treza_generate_video |
A video clip from a prompt, optionally opening or ending on a picture. | Treza credits |
TrezaRunPipeline |
treza_run_pipeline |
Runs one of your saved Treza pipelines, with new inputs if given. | Treza credits |
TrezaGetRun |
treza_get_run |
Looks up a render that was still going when its tool stopped waiting. | Free |
TrezaBalance |
treza_balance |
The credits left on the account. | Free |
A finished render comes back as JSON:
{"url": "https://media.trezalabs.com/...mp4", "status": "success", "finished": true,
"price_usd": 0.28, "model": "google/veo-3.1-lite", "render_seconds": 56.0,
"run_id": "...", "pipeline_id": "pipeline_..."}
Use one tool
from crewai_treza import TrezaGenerateVideo
tool = TrezaGenerateVideo(max_cost_usd=1.00)
print(tool.run(prompt="A red fox trots through fresh snow", aspect_ratio="9:16", duration_sec=4))
Give the tools to an agent
from crewai import Agent, Crew, Task
from crewai_treza import treza_tools
director = Agent(
role="Video director",
goal="Turn a brief into a finished short clip",
backstory="You write tight shot descriptions and deliver a link to the finished file.",
tools=treza_tools(max_cost_usd=1.00),
)
task = Task(
description="Make a 4 second vertical clip of a fox in snow.",
expected_output="The link to the finished video and what it cost.",
agent=director,
)
print(Crew(agents=[director], tasks=[task]).kickoff())
treza_tools(include_pipelines=False) leaves out treza_run_pipeline.
Spending
max_cost_usdis set in your code. The model cannot see or change it, and it cannot see the API key.- With a cap set, Treza prices the render first. If the price is higher, the tool answers "This render costs $X, over the Max cost of $Y. Nothing was spent." and starts nothing.
- With no cap (
None, the default), a render runs at Treza's quoted price as long as the balance covers it. Set a cap on tools you give to an agent. - A render never starts when the balance does not cover its price.
Long renders
Pictures usually take under a minute and videos one to five minutes. Each tool waits up to wait_seconds (300 by default). A render still going after that comes back with "status": "running" and its run_id and pipeline_id, not as an error, and nothing is started twice. The get-run tool returns the file once it is done.
Errors
Refusals (over the cap, low balance, a bad key, a render that broke) go back to the agent as text, so it can react. Pass raise_on_refusal=True to have them raise TrezaError instead.
Network and privacy
The tools call Treza's API over HTTPS at www.trezalabs.com. They send the prompt and settings with your API key, and store nothing. Privacy policy: https://docs.trezalabs.com/terms-and-privacy/privacy
Development
pip install -e . pytest
pytest
The tests run against a scripted stand-in for Treza's API.
Support
Issues: https://github.com/treza-labs/crewai-treza/issues · Email: hello@trezalabs.com
MIT licensed.
Metadata
Release files for crewai-treza 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| crewai_treza-0.1.0.tar.gz | 12.3 kB | With provenance | Details for crewai_treza-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| crewai_treza-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for crewai_treza-0.1.0-py3-none-any.whl |
Total release size: 24.2 kB
Release files / crewai_treza-0.1.0.tar.gz
| Download URL | crewai_treza-0.1.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20d9c7d49e88ba0654203a54c8f9e2c6cea0760d8503d1b92a3a6f8927d51d82
|
|
BLAKE2b-256 checksum How to use checksums |
8b9f404c173b0b219f74394c63819de11f889f2ae7e31737eae9858df756f2fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logRelease files / crewai_treza-0.1.0-py3-none-any.whl
| Download URL | crewai_treza-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
29e5dff4e56824c09a99290a9c9e1bc9776e0b0ea0e180e31f4ca91bcb4b4197
|
|
BLAKE2b-256 checksum How to use checksums |
ff7424f903f82f8dfe414c64f7e082cfeefc8989cc7835c0c6715e4c67f6ebea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logSecurity for crewai-treza 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for crewai_treza-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.