Repository navigation
feat(video): add OpenRouter video provider - #971
Open
Stevesibilia wants to merge 2 commits into
Open
Stevesibilia wants to merge 2 commits into
Stevesibilia wants to merge 2 commits into
Conversation
Add openrouter_video (provider openrouter, env OPENROUTER_API_KEY), a video_generation tool for OpenRouter's video API. One prepaid key reaches Veo 3.1 (Lite, Fast, standard), Seedance 2.0 and 2.5, MiniMax Hailuo, Wan 3.0, Grok Imagine, Runway Gen-4.5 and the rest of OpenRouter's catalog. - Submit, poll and download from the authenticated content endpoint. The paid submission is never retried; a polling timeout returns resume_job, which polls the same job when passed back. - Durations, resolutions, aspect ratios, frame support, audio, seed and passthrough parameters are validated against the live catalog before any paid call, with a pinned snapshot in tools/provider_contracts/openrouter_video_models.json as the fallback. - Local first/last frames and reference images are sent inline as base64 data URIs. The schema does not advertise image_url, so video_selector does not upload local frames to fal for this tool. - Cost: the estimate comes from the model's pricing_skus (per second, cents per second, or Seedance video tokens with a 5% margin); unknown SKUs raise PriceQuoteRequired. cost_usd is usage.cost from the completed job. - generate_audio defaults to false, since OpenRouter defaults it on and it costs more. exclude_data_collection opts into provider.data_collection=deny. negative_prompt maps to Veo's provider passthrough. - Verified live: Veo 3.1 Lite 4 s 720p image-to-video settled at $0.12 (the catalog rate), also through video_selector with a negative prompt; Seedance 2.0 Mini 4 s 480p settled at $0.142079, matching 864x496 x 97 frames of video tokens. - Contract tests with faked HTTP, a Layer 3 skill, PROVIDERS.md, .env.example and the ai-video-gen skill. Assisted-by: claude-code/claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AdYM4hzKcmypBnbgdcmtW4
When a job fails because the provider filtered the output or blocked the prompt by content policy, report error_code "filtered" and tell the agent to change the keyframe or the model family instead of rewording the prompt. When OpenRouter answers "No endpoints found" for a catalog model, say that no endpoint serves it right now or none matches the provider preferences. Live tests on a violent keyframe: Veo 3.1 Lite filtered it twice, mischief-1 blocked the prompt, Hailuo 3 Max had no endpoint, while Seedance 2.0, Grok Imagine 1.5 Lite and HeyGen Video 1 rendered it. The skill records the cases. Assisted-by: claude-code/claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AdYM4hzKcmypBnbgdcmtW4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
openrouter_video, a video generation provider for OpenRouter's video API. One prepaidOPENROUTER_API_KEYreaches Veo 3.1, Seedance 2.x, MiniMax Hailuo, Wan, Grok Imagine, Runway Gen-4.5 and the rest of OpenRouter's video catalog, often at a lower price than other hosts charge for the same models.Related issue
None.
Changes
video_selectordoes not route them through fal.pricing_skus. Results report the chargedusage.cost.generate_audiois off unless requested.exclude_data_collectionopts intoprovider.data_collection: deny. Paid submissions are never retried, and a polling timeout returnsresume_jobto keep waiting on the same job.openrouter-video, plusPROVIDERS.md,.env.exampleand theai-video-genskill.Testing
mainthere (Remotion adapter, HyperFrames, fal resume webp).video_selector. Seedance 2.0 Mini, Seedance 2.0, Grok Imagine 1.5 Lite and HeyGen Video 1 also completed. A violent keyframe blocked by Veo's filter produced the new filtered-job message.Checklist
make test-contracts/make test) where applicable.🤖 Generated with Claude Code
https://claude.ai/code/session_01AdYM4hzKcmypBnbgdcmtW4