Skip to content

feat(video): add direct MiniMax (Hailuo) video generation tool - #198

Open
huzy1234 wants to merge 1 commit into
calesthio:mainfrom
huzy1234:feat/minimax-direct-video
Open

feat(video): add direct MiniMax (Hailuo) video generation tool#198
huzy1234 wants to merge 1 commit into
calesthio:mainfrom
huzy1234:feat/minimax-direct-video

Conversation

@huzy1234

Copy link
Copy Markdown

What

Adds minimax_video_direct, a new video_generation provider tool that calls the MiniMax open platform directly instead of routing through fal.ai.

Why

Today the only MiniMax path is minimax_video, which goes through fal.ai and requires FAL_KEY. Users who hold a native MiniMax API key had no way to use it. This tool closes that gap.

How

  • Reads MINIMAX_API_KEY / MINIMAX_API_BASE / MINIMAX_VIDEO_MODEL from the environment.
  • Works against both the China platform (https://api.minimaxi.com, default) and the global platform (https://api.minimax.io).
  • Implements the async generation flow: POST /v1/video_generation → poll GET /v1/query/video_generationGET /v1/files/retrieve → download the mp4.
  • Supports text_to_video and image_to_video (image as a public URL or a local file sent as a base64 data URI).
  • Follows the BaseTool contract, so it is auto-discovered by the registry and surfaced by video_selector with no additional wiring.
  • Documents the new env vars in .env.example.

Notes for reviewers

  • provider is set to minimax (same family as the fal-routed tool); the two coexist and fallback_tools chains to minimax_video and others.
  • Cost/runtime estimates are rough heuristics by resolution/duration.
  • Verified end-to-end against the live China platform API: a 6s/768P MiniMax-Hailuo-02 text-to-video request completed successfully and downloaded a valid mp4.

🤖 Generated with Claude Code

Adds `minimax_video_direct`, a video_generation provider that talks
straight to the MiniMax open platform instead of routing through
fal.ai (the existing `minimax_video` tool requires FAL_KEY).

Why: users with a native MiniMax API key had no way to use it — the
only MiniMax path went through fal.ai. This unlocks direct access.

- Reads MINIMAX_API_KEY / MINIMAX_API_BASE / MINIMAX_VIDEO_MODEL
- Supports both China (api.minimaxi.com) and global (api.minimax.io) bases
- Implements the async flow: submit -> poll query -> retrieve file -> download mp4
- text_to_video and image_to_video (URL or local image as base64)
- Follows the BaseTool contract; auto-discovered by the registry and
  surfaced by video_selector with no further wiring
- Documents the new env vars in .env.example

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@huzy1234
huzy1234 requested a review from calesthio as a code owner June 26, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant