Skip to content

duration causes 400 error in interactions #1808

Description

@JamesDerrickHH

Platform: node with typescript (in an azure function)
Package version: 2.13.0
I am trying to call the new omni flash preview model but am getting a 400 error returned if I include the duration argument in the response format.
"400 Invalid input at 'response_format'."
An example of the code I've written

    const ai = new GoogleGenAI({
        vertexai: true,
        project: projectId,
        location: location,
        googleAuthOptions: authOptions,
        httpOptions: { headers: { 'Api-Revision': '2026-05-20' } },
    })

        const interaction = await ai.interactions.create({
            model: 'gemini-omni-flash-preview',
            input: [
                {
                    type: 'user_input',
                    content: [
                        { type: 'text', text: "a propellor plane flying along a river, under bridges, with a city scape in the background" }
                    ]
                }
            ],
            generation_config: {
                video_config: {
                    task: 'text_to_video'
                }
            },
            response_format: {
                type: 'video',
                aspect_ratio: '16:9',
                duration: 6
            }
        });

If I comment out duration it works fine, I have also tried including it as a string (which is what the package says it should be) and as a number, but get the same outcome

Metadata

Metadata

Assignees

Labels

api: vertex-aiIssues related to the Vertex AI API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions