> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate Video (ReplicateTools)

> Generate a video from a text prompt with ReplicateTools and the tencent/hunyuan-video model.

Create an agent that generates videos using the Replicate API with the HunyuanVideo model.

## Code

```python generate_video_using_replicate.py theme={null}
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.replicate import ReplicateTools

"""Create an agent specialized for Replicate AI content generation"""

video_agent = Agent(
    name="Video Generator Agent",
    model=OpenAIResponses(id="gpt-5.2"),
    tools=[
        ReplicateTools(
            model="tencent/hunyuan-video:847dfa8b01e739637fc76f480ede0c1d76408e1d694b830b5dfb8e547bf98405"
        )
    ],
    description="You are an AI agent that can generate videos using the Replicate 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,
)

video_agent.print_response("Generate a video of a horse in the dessert.")
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai replicate
    ```
  </Step>

  <Step title="Export your API keys">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
        export OPENAI_API_KEY="your_openai_api_key_here"
        export REPLICATE_API_KEY="your_replicate_api_key_here"
        export REPLICATE_API_TOKEN="your_replicate_api_key_here"
      ```

      ```bash Windows theme={null}
        $Env:OPENAI_API_KEY="your_openai_api_key_here"
        $Env:REPLICATE_API_KEY="your_replicate_api_key_here"
        $Env:REPLICATE_API_TOKEN="your_replicate_api_key_here"
      ```
    </CodeGroup>

    Set both Replicate variables to the same value. The toolkit reads `REPLICATE_API_KEY` while the `replicate` client authenticates with `REPLICATE_API_TOKEN`.
  </Step>

  <Step title="Run Agent">
    ```bash theme={null}
    python generate_video_using_replicate.py
    ```
  </Step>
</Steps>
