Metadata-Version: 2.5
Name: openai-agents-videogen
Version: 2.5.4
Summary: Official OpenAI Agents SDK tools for the VideoGen API. Generate videos, images, voiceovers, sound effects, music, and avatars from any OpenAI Agents SDK agent.
Project-URL: Homepage, https://videogen.io
Project-URL: Documentation, https://github.com/video-gen/video-workflow-recipes/tree/main/integrations/openai-agents-videogen#readme
Project-URL: Repository, https://github.com/video-gen/video-workflow-recipes
License: MIT
Keywords: agents,ai,ai-video-generation,image-generation,openai-agents,openai-agents-sdk,text-to-speech,text-to-video,tools,videogen
Requires-Python: >=3.10
Requires-Dist: openai-agents>=0.1.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: videogen>=2.5.3
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# openai-agents-videogen

Official [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/) tools for the [VideoGen API](https://docs.videogen.io). Give any OpenAI Agents SDK agent the ability to turn a script into a finished narrated video, plus generate standalone images, video clips, voiceovers, sound effects, music, and talking-head avatars.

Every tool wraps the official [`videogen`](https://pypi.org/project/videogen/) SDK and runs as the team that owns your API key.

## Install

```bash
pip install openai-agents-videogen
```

## Setup

Get an API key from [app.videogen.io/api](https://app.videogen.io/api) and set it as `VIDEOGEN_API_KEY`:

```bash
export VIDEOGEN_API_KEY="your_api_key"
```

## Usage

```python
import asyncio

from agents import Agent, Runner
from openai_agents_videogen import create_videogen_tools

agent = Agent(
    name="Video Producer",
    instructions="You produce short narrated videos with VideoGen when asked.",
    tools=create_videogen_tools(),
)


async def main() -> None:
    result = await Runner.run(
        agent,
        "Make a short narrated video explaining why staying hydrated matters.",
    )
    print(result.final_output)


asyncio.run(main())
```

By default each tool blocks until the workflow or tool execution finishes and returns the completed result.

## Options

```python
from videogen import VideoGen
from openai_agents_videogen import create_videogen_tools

tools = create_videogen_tools(
    # Provide a pre-configured client, or pass api_key / base_url, or rely on env.
    client=VideoGen(api_key="your_api_key"),

    # Return the run/execution id immediately instead of waiting.
    wait=False,

    # Only expose a subset of tools to the agent.
    include=["script_to_video", "generate_image", "text_to_speech"],
)
```

| Option | Default | Description |
| --- | --- | --- |
| `client` | — | A pre-configured `VideoGen` client. |
| `api_key` | `VIDEOGEN_API_KEY` | API key used to build a client when `client` is omitted. |
| `base_url` | `VIDEOGEN_BASE_URL` or production | Override the API base URL. |
| `wait` | `True` | Block until the operation finishes and return the result. |
| `poll_interval_ms` | SDK default | Poll interval while waiting. |
| `timeout_ms` | SDK default | Maximum time to wait before giving up. |
| `include` | all tools | Restrict the returned tool set to these tool names. |

## Tools

<!-- BEGIN GENERATED PYTHON AGENT TOOLS -->
- Workflows: `cancel_workflow_run`, `get_workflow_run`, `list_workflow_runs`, `prompt_to_video_clip`, `script_to_video`, `slideshow_to_video`, `storyboard_to_video`, `video_to_video`, `voiceover_to_video`.
- Media generation: `cancel_tool_execution`, `generate_avatar`, `generate_image`, `generate_motion_graphic`, `generate_music`, `generate_sound_effect`, `generate_video_clip`, `get_tool_execution`, `image_3d_effect`, `list_tool_executions`, `remove_image_background`, `remove_video_background`, `text_to_speech`, `upscale_image`, `upscale_video`, `vectorize_image`.
- Projects: `export_project`, `get_project`, `list_project_remix_actions`, `list_projects`, `remix_project`.
- Files: `get_file`, `list_files`, `upload_file`.
- Resources and account: `get_me`, `list_languages`, `list_tts_voices`.

Avatar generation and supported video workflows use reusable actor entities. Pass `actor_entity_id` and set `avatar_quality` to `LOW`, `STANDARD`, `HIGH`, or `MAX`. Narrator changes are passed in `remix_actions` as `CHANGE_NARRATOR` action dictionaries.
<!-- END GENERATED PYTHON AGENT TOOLS -->

## Documentation

- [Use with AI agents](https://docs.videogen.io/use-with-ai-agents)
- [MCP server](https://docs.videogen.io/libraries/mcp)
- [API reference](https://docs.videogen.io)

## License

MIT

## Account and permissions

Generation and editing use VideoGen account credits. Obtain user approval before credit-consuming calls, and restrict the `include` list for agents that only need read access. Keep API keys in environment variables and out of shared transcripts.

[VideoGen](https://videogen.io/) · [MCP setup](https://videogen.io/videogen-mcp)

## 2.5.4

Fix polling after workflow, media-tool and export starts to use the Python SDK’s normalized response keys. No API capabilities or dependency requirements changed.
