# Generate Video from Text — Google Vertex AI

> Generate a video from a text prompt using Google Vertex AI Veo models. See the documentation

- Key: `google_vertex_ai-generate-video-from-text`
- Type: Action (Write)
- Version: 0.0.2
- App: Google Vertex AI (`google_vertex_ai`) — https://pipedream.com/apps/google-vertex-ai.md
- This page (HTML): https://pipedream.com/apps/google-vertex-ai/actions/generate-video-from-text
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/google_vertex_ai/actions/generate-video-from-text/generate-video-from-text.mjs

## Description

Generate a video from a text prompt using Google Vertex AI Veo models. [See the documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/veo-video-generation)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `projectId` | `string` | Yes | Identifier of a project Options are loaded from the connected account. |
| `model` | `string` | Yes | The model to use for video generation |
| `prompt` | `string` | Yes | The text prompt to guide video generation. For Veo 3, you can include audio cues like dialogue in quotes, sound effects, and ambient noise descriptions. |
| `aspectRatio` | `string` | Yes | The aspect ratio of the generated video |
| `durationSeconds` | `integer` | Yes | The length of the video in seconds. Veo 2: 5-8 seconds, Veo 3: 8 seconds |
| `enhancePrompt` | `boolean` | Yes | Use Gemini to enhance your prompts |
| `generateAudio` | `boolean` | Yes | Generate audio for the video (Veo 3 only) |
| `negativePrompt` | `string` | No | A text string that describes anything you want to discourage the model from generating |
| `personGeneration` | `string` | No | The safety setting that controls whether people or face generation is allowed |
| `resolution` | `string` | No | The resolution of the generated video (Veo 3 models only) |
| `sampleCount` | `integer` | Yes | The number of output videos requested |
| `storageUri` | `string` | No | A Cloud Storage bucket URI to store the output video, in the format gs://BUCKET_NAME/SUBDIRECTORY. If a Cloud Storage bucket isn't provided, base64-encoded video bytes are returned in the response. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "google_vertex_ai",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "google_vertex_ai-generate-video-from-text",
  arguments: {
    projectId: "Project ID",
    model: "Model",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "google_vertex_ai-generate-video-from-text",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_vertex_ai: { authProvisionId: "apn_xxxxxxx" },
    projectId: "Project ID",
    model: "Model",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "google_vertex_ai-generate-video-from-text",
    "configured_props": {
      "google_vertex_ai": { "authProvisionId": "apn_xxxxxxx" },
      "projectId": "Project ID",
      "model": "Model"
    }
  }'
```

---

- App: https://pipedream.com/apps/google-vertex-ai.md · All apps: https://pipedream.com/apps
