diff --git a/src/types.ts b/src/types.ts index a2f7f3a..42dcf26 100644 --- a/src/types.ts +++ b/src/types.ts @@ -496,6 +496,24 @@ export interface VideoGenerateOptions { imageUrl?: string; /** Duration to bill for (defaults to model's default duration) */ durationSeconds?: number; + /** Output aspect ratio. Token360 / Seedance only — silently ignored by xAI Grok. */ + aspectRatio?: "adaptive" | "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "9:21"; + /** Output resolution. Token360 / Seedance only. */ + resolution?: "360p" | "480p" | "540p" | "720p" | "1080p" | "1K" | "2K" | "4K"; + /** + * Whether the model should produce an audio track. Token360 / Seedance only. + * When omitted, the gateway does not send the flag — Token360 then applies + * its own upstream default (typically off, occasionally on depending on + * model variant / prompt). Audio generation is usually a paid surcharge, + * so callers should expose this as a visible toggle to their users. + */ + generateAudio?: boolean; + /** Reproducibility seed when supported by the model. */ + seed?: number; + /** Embed the upstream watermark on the output. Defaults to false at the gateway. */ + watermark?: boolean; + /** Return the last frame as an image alongside the clip — useful for chaining. */ + returnLastFrame?: boolean; } // Search options for standalone search endpoint diff --git a/src/video.ts b/src/video.ts index 737d16a..ad5cf74 100644 --- a/src/video.ts +++ b/src/video.ts @@ -115,6 +115,13 @@ export class VideoClient { }; if (options?.imageUrl) body.image_url = options.imageUrl; if (options?.durationSeconds !== undefined) body.duration_seconds = options.durationSeconds; + // ── Token360 / Seedance passthroughs (gateway silently ignores for xAI) ─ + if (options?.aspectRatio) body.aspect_ratio = options.aspectRatio; + if (options?.resolution) body.resolution = options.resolution; + if (options?.generateAudio !== undefined) body.generate_audio = options.generateAudio; + if (options?.seed !== undefined) body.seed = options.seed; + if (options?.watermark !== undefined) body.watermark = options.watermark; + if (options?.returnLastFrame) body.return_last_frame = true; const budgetMs = options?.budgetMs ?? DEFAULT_GENERATE_BUDGET_MS; return this.submitAndPoll(body, budgetMs);