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

# Generate Video using Replicate

## Code

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

video_agent = Agent(
    name="Video Generator Agent",
    model=OpenAIChat(id="gpt-4o"),
    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,
    debug_mode=True,
    show_tool_calls=True,
)

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

## Usage

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

**1. Set your API key**

```bash theme={null}
export OPENAI_API_KEY=xxx
export REPLICATE_API_TOKEN=xxx
```

**2. Install libraries**

```bash theme={null}
pip install -U openai replicate agno
```

**3. Run Agent**

```bash Mac theme={null}
python cookbook/agent_concepts/multimodal/generate_video_using_replicate.py
```

```bash Windows theme={null}
python cookbook/agent_concepts/multimodal/generate_video_using_replicate.py
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.