Skip to content

现在好像不支持对接三方视频模型,大佬能支持下吗 #1944

Description

@wolp6635236

比如grok sd

今天对接失败后ai给我的答复

明白了,现在我理解问题了。

根本原因:路径不兼容

你的上游 (xx.xxxx.com) 的视频接口路径是:

  • POST /v1/videos

但 TokenRouter 代码硬编码了转发到上游的路径为:

  • POST /videos/generations(这是 xAI 官方原生路径)

所以最终请求发到了 https://xx.xxxx.com/v1/videos/generations,你的上游不认识这个路径,返回 404。

解决方案有两个:

  1. 直接用 xAI 官方 API Key — 如果你有 xAI 付费账号,直接用 api.x.ai/v1 作为 base URL,路径完全兼容
  2. 修改代码适配你上游的路径 — 让 TokenRouter 对非官方 base URL 使用 /videos 而不是 /videos/generations

你的上游文档明确说了"请勿照抄上游文档里的 /v1/videos/generations/async",说明它封装了自己的路由。TokenRouter 的设计是直连 xAI 官方的。

你想要哪种方案?如果选方案 2,我可以帮你改代码让它兼容你上游的路径格式。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions