Fal

FalTools enable an Agent to generate and transform images and videos using the Fal AI platform.

FalTools enable an Agent to perform media generation tasks.

Prerequisites

The following example requires the fal_client library and an API key which can be obtained from Fal.

uv pip install -U agno fal_client openai
export FAL_KEY=***

FalTools checks the FAL_API_KEY environment variable and logs an error when it is missing. Authentication still works with FAL_KEY alone because fal_client reads it directly. Set both variables to avoid the log message.

Example

The following agent will use FAL to generate any video requested by the user.

cookbook/91_tools/fal_tools.py
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.fal import FalTools

fal_agent = Agent(
    name="Fal Video Generator Agent",
    model=OpenAIResponses(id="gpt-5.2"),
    tools=[FalTools(model="fal-ai/hunyuan-video")],
    description="You are an AI agent that can generate videos using the Fal API.",
    instructions=[
        "When the user asks you to create a video, use the `generate_media` tool to create the video.",
        "Return the URL as raw to the user.",
        "Don't convert video URL to markdown or anything else.",
    ],
    markdown=True,
    debug_mode=True,
)

fal_agent.print_response("Generate video of balloon in the ocean")

Toolkit Params

ParameterTypeDefaultDescription
api_keystrNoneStored by Agno; not forwarded to the module-level Fal client. Set FAL_KEY for SDK authentication.
modelstrfal-ai/hunyuan-videoThe model to use for the media generation.
enable_generate_mediaboolTrueEnable the generate_media functionality.
enable_image_to_imageboolFalseEnable the image_to_image functionality.
allboolFalseEnable all functionality.

Toolkit Functions

FunctionDescription
generate_mediaGenerate media using the configured model; the model determines the output type.
image_to_imageTransform an input image using the fixed Flux image-to-image endpoint, independently of the constructor model.

Developer Resources