QuantumNous / QuantumNous/new-api-plugins
feature: 增加 xAI Grok Imagine Video 官方任务插件
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 14
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
提交前必读(请勿删除本节)
- 文档:https://docs.newapi.ai/
- 使用问题先看或先问:https://deepwiki.com/QuantumNous/new-api
- 开启透传后的转发相关反馈不接受 issue;透传模式会直接转发请求,请自行确认上游行为。
- 不接受 Coding Plan、逆向渠道、第三方封装接口,以及将 Codex 接口反代为通用 API 后产生的兼容性问题;Codex API 自身特有的协议或行为也不应被当作标准 OpenAI API 行为,相关问题请先向渠道或接口提供方确认。
- 警告:删除本模板、删除小节标题或随意清空内容的 issue,可能会被直接关闭;重复恶意提交者可能会被 block。
您当前的 newapi 版本
v1.0.0-rc.34-3-gbfe718e4(基于 NewAPI fork 构建)
提交确认
- 非重复 issue: 我已搜索本仓库现有 Issues,确认目前没有相同的 xAI Grok Imagine Video 插件请求。NewAPI 核心仓库的 #6358 和 #7251 已作为相关背景引用。
- 提交前必读: 我已完整阅读上方“提交前必读”,并已查看文档、项目 README 且向 AI 提问,确认这不是使用、配置或接入类问题,且现有版本无法满足需求。
- 模板完整: 我未删除此模板中的任何引导内容或小节标题,并会按要求完整填写。
- 维护成本: 我理解项目维护者精力有限,不遵循模板要求的 issue 可能会被无视或直接关闭。
功能描述
希望在官方 new-api-plugins 市场增加 xAI Grok Imagine Video 任务插件。
xAI 官方视频接口为异步任务流程:
- 创建任务:
POST /v1/videos/generations - 查询任务:
GET /v1/videos/{request_id} - 状态:
pending、done、failed、expired - 支持文生视频和图生视频
- 完成后通过临时 URL 返回视频文件
建议插件声明 channel type 48,支持以下模型:
grok-imagine-videogrok-imagine-video-1.5grok-imagine-video-1.5-preview
理想功能包括:
- 创建视频任务并返回任务 ID;
- 自动轮询任务状态;
- 支持文生视频和图生视频;
- 支持时长、比例和分辨率参数校验;
- 处理
failed、expired等终态; - 完成后返回或代理临时 MP4 视频 URL;
- 不在插件中硬编码 xAI 价格,计费继续使用 NewAPI 渠道配置。
与此前 NewAPI 核心仓库中的旧 Go TaskAdaptor、Sora 专用实现及较早 Grok 视频尝试相比,当前验证实现:
- 基于 NewAPI 当前 sandboxed JS task-plugin runtime;
- 使用 xAI 当前文档化的
/v1/videos/generations和/v1/videos/{request_id}; - 仅把
grok-imagine-video*路由到视频插件,普通 Grok 文本模型保持原有路由; - 覆盖文生视频、图生视频、轮询、失败/过期状态和临时 MP4 URL 代理;
- 已补充插件 lint、Go 测试、控制器端点测试和真实任务验证。
参考实现:
https://github.com/SakuraPuare/new-api/tree/dev
应用场景
通过 NewAPI 插件市场统一调用 Grok Imagine Video,下游客户端无需单独适配 xAI 异步任务 API,同时复用 NewAPI 的渠道管理、鉴权、日志、额度和任务状态能力。
我们已在测试环境和生产环境完成真实调用验证:
- 任务成功创建;
- 任务成功进入
done; - 视频成功通过 NewAPI 返回;
- 返回文件类型为
video/mp4; - 未影响普通 Grok 文本模型路由。
希望维护者讨论:
- 该插件是否符合官方市场的收录方向?
- 是否接受以单文件插件形式提交?
- 插件的
allowedHosts、模型声明、临时文件代理和计费字段是否有推荐规范? - 如果方向确定,我们可以按官方插件目录、版本不可变和
index.json生成规则整理后续贡献。
参考资料:
感谢维护和指导。
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the repository's current plugin-market conventions, sandboxed JavaScript task-plugin runtime, and index.json generation rules before comparing the referenced implementation. Confirm the expected allowedHosts, model declarations, temporary-file proxy behavior, and billing fields with maintainers. Done means an accepted plugin can create and poll video tasks, support text-to-video and image-to-video, handle terminal failures, and return the completed MP4.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100