Open History to see the last commit
1/**
2 * Hand-written wrapper. DO NOT regenerate this file.
3 *
4 * The model data lives in `openrouter.video-models.json` (regenerated by
5 * `fetch-openrouter-models.ts` from `GET /api/v1/videos/models` — video
6 * generation models do not appear in the plain `GET /api/v1/models`
7 * listing). This wrapper re-exports it typed so consumers can keep
8 * `import { videoModels } from './openrouter.video-models'`.
9 *
10 * The data is loaded via `JSON.parse(readFileSync(...))` rather than an
11 * `import ... with { type: 'json' }` attribute so the loader doesn't have
12 * to support JSON import attributes.
13 */
14
15import { readFileSync } from 'node:fs'
16import { dirname, resolve } from 'node:path'
17import { fileURLToPath } from 'node:url'
18
19export interface OpenRouterVideoApiModel {
20 id: string
21 name: string
22 /** Supported clip lengths in seconds; null when the API doesn't report them. */
23 supported_durations: Array<number> | null
24 /** e.g. '480p' | '720p' | '1080p' | '1K' | '2K' | '4K'; null when unreported. */
25 supported_resolutions: Array<string> | null
26 /** e.g. '16:9' | '9:16' | '1:1'; null when unreported. */
27 supported_aspect_ratios: Array<string> | null
28 /** Which `frame_images[].frame_type` values the model accepts; null when unreported. */
29 supported_frame_images: Array<string> | null
30 /** Exact 'WIDTHxHEIGHT' sizes; null when unreported. */
31 supported_sizes: Array<string> | null
32 /** Whether the model can generate audio; null when unknown. */
33 generate_audio: boolean | null
34 /** Whether the model honors a deterministic seed; null when unknown. */
35 seed: boolean | null
36 pricing_skus?: Record<string, string> | null
37 allowed_passthrough_parameters?: Array<string>
38}
39
40const __dirname = dirname(fileURLToPath(import.meta.url))
41const DATA_PATH = resolve(__dirname, 'openrouter.video-models.json')
42
43export const videoModels: Array<OpenRouterVideoApiModel> = JSON.parse(
44 readFileSync(DATA_PATH, 'utf-8'),
45)