export type GetApiAiVideoOmniFlashArgs = {prompt: string, ratio: '16:9' | '9:16', type?: ('text-to-video' | 'image-to-video') | undefined, imageUrl?: string | undefined}; export type GetApiAiVideoOmniFlashOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Generate video with Omni Flash * * GET /ai-video/omni-flash */ export const getApiAiVideoOmniFlash = async (args: GetApiAiVideoOmniFlashArgs, options?: GetApiAiVideoOmniFlashOptions) => { const {baseUrl = "https://api.paxsenix.org", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.prompt != null) query.append("prompt", String(args.prompt)) if (args.ratio != null) query.append("ratio", String(args.ratio)) if (args.type != null) query.append("type", String(args.type)) if (args.imageUrl != null) query.append("imageUrl", String(args.imageUrl)) const url = `${baseUrl.replace(/\/+$/, '')}/ai-video/omni-flash${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };