Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

OpenRouter video: POST /api/v1/videos returns 200, but the official SDK only accepts 202

クローズ 初心者向け
#491 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@tombeckenham がすでに取り組んでいます。

2026年10月3日 から。

  • #492 @tombeckenham による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, openapi, typescript
領域
api, backend

調査の方向性

dist/openrouter-video.js の handleOpenRouterVideoCreate から始め、fixture のパスと、それを模倣する record/proxy のパスを調べてください。@openrouter/sdk で呼び出しを再現し、動画の作成が既存のレスポンスボディとともに 202 を返し、ポーリングとダウンロードは変更されないことを確認してください。

索引モデルが issue の本文から書いたものです。

説明

Summary

The OpenRouter video mock added for #261 answers job creation (POST /api/v1/videos) with HTTP 200. The official @openrouter/sdk accepts only 202 for that call, so every job created through the real SDK fails before polling starts.

Poll (GET /api/v1/videos/{id}) and download (GET /api/v1/videos/{id}/content) work correctly.

Versions

  • @copilotkit/aimock 1.43.0
  • @openrouter/sdk 0.13.20 and 1.4.21 (same behavior in both)

Reproduce

import { LLMock } from '@copilotkit/aimock'
import { OpenRouter } from '@openrouter/sdk'

const mock = new LLMock({ port: 4099, host: '127.0.0.1' })
mock.onVideo('a guitar being played in a store', {
  video: { id: 'job-1', status: 'completed', url: 'https://example.com/v.mp4' },
})
await mock.start()

const client = new OpenRouter({
  apiKey: 'test',
  serverURL: 'http://127.0.0.1:4099/api/v1',
})
await client.videoGeneration.generate({
  videoGenerationRequest: {
    model: 'google/veo-3.1-lite',
    prompt: 'a guitar being played in a store',
  },
})

Actual

The SDK throws:

OpenRouterDefaultError: Unexpected Status or Content-Type: Status 200
Body: {"id":"e8c64b76-…","polling_url":"http://127.0.0.1:4099/api/v1/videos/e8c64b76-…","status":"pending"}

The body is correct. Only the status code is rejected.

Expected

202 Accepted with the same body.

Why 202

The SDK is generated from OpenRouter's OpenAPI spec, and its response matcher for this operation lists 202 as the only success status (esm/funcs/videoGenerationGenerate.js):

M.match(
  M.json(202, models.VideoGenerationResponse$inboundSchema),
  M.jsonErr(400, …), M.jsonErr(401, …), M.jsonErr(402, …),
  M.jsonErr(404, …), M.jsonErr(429, …), M.jsonErr(500, …),
  M.fail("4XX"), M.fail("5XX"),
)

This is unchanged between SDK 0.13.20 and 1.4.21.

Where

In dist/openrouter-video.js, the create handler (handleOpenRouterVideoCreate) ends with res.writeHead(200, { "Content-Type": "application/json" }). The fixture path and, if it mirrors the upstream status, the record/proxy path should both send 202.

Impact

TanStack AI cannot add openrouter to its video-gen e2e matrix with the built-in handler. The adapter uses the official SDK, so creation fails on the status code. We are keeping OpenRouter video on unit tests until this is fixed (TanStack/ai#1541).

主要言語
TypeScript
スター
979
フォーク
84
平均マージ
1日 5時間
マージ済み PR(30日)
58

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CopilotKit/aimock のほかの issue

CopilotKit/aimock の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。