Give your LlamaIndex agent images and video
llama-index-tools-treza is a tool spec for LlamaIndex. An agent calls it 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.
Free to add. You pay only for what you make.
Set it up in LlamaIndex
Install the package
Python 3.10 or newer, with llama-index-core 0.12 or newer.
- 1
Install it
Add the package to the environment your agent runs in.
pippip install -U llama-index-tools-treza - 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.
Shellexport TREZA_API_KEY="treza_live_..." - 3
Call one tool
Each tool returns JSON with the file's link, its status, the price and the model.
Pythonfrom llama_index.tools.treza import TrezaToolSpec treza = TrezaToolSpec(max_cost_usd=1.00) print(treza.generate_video("A red fox trots through fresh snow", aspect_ratio="9:16", duration_sec=4)) - 4
Or give them all to an agent
to_tool_list turns the spec into tools. Pass the list to your agent with the model you already use.
Pythonfrom llama_index.tools.treza import TrezaToolSpec tools = TrezaToolSpec(max_cost_usd=1.00).to_tool_list()
What the tools do
- 1
generate_image and generate_video
The model 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
run_pipeline
Starts a pipeline you built in Treza with the inputs the model passes in, and returns everything it made.
- 3
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
get_balance
The credits left on your Treza account. Free.
Agents to start from
Each one is the tool spec plus the model and tools you already use.
A clip from a brief
An agent with generate_video turns "a 4 second vertical clip of a fox in snow" into a finished MP4 link.
A picture, then the clip
The agent makes a picture with generate_image and passes its link as first_frame_url to generate_video.
Illustrate what it retrieved
An agent with a query engine over your documents and generate_image answers a question and makes a picture for the answer.
Only some of the tools
to_tool_list(spec_functions=["generate_image", "get_balance"]) hands over the image tool and the balance check and nothing else.
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 an agent.
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. An agent 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.
Treza in other apps
ChatGPT
In ChatGPT's plugin directory. Add it and mention @Treza in any chat.
Set it up->Claude
A custom connector in the Claude app, or the Treza plugin in Claude Code.
Set it up->Muse
Ask Muse to build a Treza connector, or add Treza to Muse Code.
Set it up->Gemini
A custom app in the Gemini app, or a server in Antigravity CLI.
Set it up->Cursor
One click adds Treza to Cursor's agent.
Set it up->Codex
From the plugin catalog in the ChatGPT app, or one command in Codex CLI.
Set it up->Hermes Agent
A few lines in ~/.hermes/config.yaml and one login command.
Set it up->Blender
An add-on that turns your camera view into AI renders and video clips.
Set it up->n8n
A verified node that makes images and videos inside your workflows.
Set it up->Zapier
Steps that make images and videos in your Zaps. In beta.
Set it up->Dify
A tool plugin that makes images and videos in your workflows and agents.
Set it up->ComfyUI
Nodes that make images and videos in your graphs, with no GPU needed.
Set it up->LangChain
Python tools that let an agent make images and videos, with a price cap.
Set it up->CrewAI
Tools that let the agents in a crew make images and videos, with a price cap.
Set it up->Vercel AI SDK
TypeScript tools that let a model make images and videos, with a price cap.
Set it up->Gumloop
A custom MCP server that lets your agents make images and videos.
Set it up->Any MCP client
One URL for every client that speaks Streamable HTTP MCP.
Set it up->LlamaIndex is a trademark of LlamaIndex. Treza is an independent product and is not affiliated with or endorsed by LlamaIndex.
Setup steps from llama-index-tools-treza on GitHub, LlamaIndex Docs: Tools.