Give your CrewAI crew images and video

crewai-treza is a Python package of tools for CrewAI. An agent in your crew calls them to make a picture, make a video clip or run one of your Treza pipelines, and gets back the finished file's link and what it cost.

crewai-treza on PyPI

Free to add. You pay only for what you make.

Set it up in CrewAI

Install the package

Python 3.10 or newer, with CrewAI 0.100 or newer.

  1. 1

    Install it

    Add the package to the environment your crew runs in.

    pip
    pip install -U crewai-treza
  2. 2

    Add your Treza API key

    Make a key on the Treza API keys page with the pipelines:read, pipelines:write and pipelines:run permissions. It starts with treza_live_. Set it as TREZA_API_KEY, or pass api_key in your code.

    Shell
    export TREZA_API_KEY="treza_live_..."
  3. 3

    Call one tool

    Each tool returns JSON with the file's link, its status, the price and the model.

    Python
    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))
  4. 4

    Or give them all to an agent

    treza_tools builds every tool with one key and one price cap. Pass the list as an agent's tools.

    Python
    from crewai import Agent
    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),
    )

What the tools do

  1. 1

    treza_generate_image and treza_generate_video

    The agent writes the prompt and picks the shape, and for video the length and whether it has sound. Links to pictures in your Treza library can be references for an image, or the first and last frame of a clip.

  2. 2

    treza_run_pipeline

    Starts a pipeline you built in Treza with the inputs the agent passes in, and returns everything it made. Leave it out with treza_tools(include_pipelines=False).

  3. 3

    treza_get_run

    Looks a render up by its IDs. A video that takes longer than the tool waits comes back as still running, not as an error, and this picks it up. Free.

  4. 4

    treza_balance

    The credits left on your Treza account. Free.

Crews to start from

Each one is the Treza tools on one agent, beside the agents you already have.

A writer and a director

A writer agent drafts a shot description, and a director agent with treza_generate_video turns it into a finished clip.

A picture, then the clip

The director makes a picture with treza_generate_image and passes its link as first_frame_url to treza_generate_video.

Your pipeline as a tool

A producer agent calls treza_run_pipeline with the topic from the task, and reports the finished video's link.

A budget keeper

An agent with treza_balance checks the credits left before the crew starts a batch of renders.

Questions

What does it cost?

The package is free and MIT licensed. Renders spend prepaid credits from your Treza balance, with no subscription. Set max_cost_usd in your code: Treza prices the render first, and when the price is higher the tool tells the agent so and nothing is spent.

Can the agent raise the price cap?

No. max_cost_usd and the API key are set in your code and are not part of what the model sees or fills in. With no cap set, a render runs at its quoted price as long as your balance covers it, so set one for a crew.

What about videos that take minutes?

Each tool waits up to wait_seconds, 300 by default. A render still going after that comes back with status running and its IDs, and nothing is started twice. The get-run tool returns the file once it is done.

Do I need an API key?

Yes. A crew runs without you signing in, so it uses a key from the API keys page instead of Google. Delete the key there to cut it off.

Do my videos and credits carry over between apps?

Yes. Every app signs in to the same Treza account, so your library, your pipelines and your balance are the same in ChatGPT, Claude, Muse, Gemini, Cursor, Codex, Hermes Agent, Blender, n8n, Zapier, Dify, Gumloop and on trezalabs.com.

CrewAI is a trademark of CrewAI. Treza is an independent product and is not affiliated with or endorsed by CrewAI.

Setup steps from crewai-treza on GitHub, CrewAI Docs: Tools.