export type CreateApiV1OpenaiVideosGenerationsArgs = {body: {prompt?: string | undefined, model: string, response_format?: ('url' | 'b64_json' | 'b64_ephemeral') | undefined, quality?: ('auto' | 'low' | 'medium' | 'high') | undefined, size?: string | undefined, seconds?: ('auto' | number) | undefined}}; export type CreateApiV1OpenaiVideosGenerationsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/openai/videos/generations */ export const createApiV1OpenaiVideosGenerations = async (args: CreateApiV1OpenaiVideosGenerationsArgs, options?: CreateApiV1OpenaiVideosGenerationsOptions) => { const {baseUrl = "https://api.imagerouter.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/openai/videos/generations${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };