> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vlm.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate & Edit

> Create and edit videos with AI-powered tools for content creation and manipulation

Create and edit videos with AI-powered tools for content creation and manipulation. Perfect for content marketing, educational video creation, entertainment production, and training content generation.

<Frame caption="Video generation example showing AI-generated videos from text prompts with creative control">
  <video src="https://storage.googleapis.com/vlm-data-public-prod/web/videos/videogen-image-to-image.mp4" width="100%" controls autoplay loop muted playsinline alt="Video generation example showing AI-generated videos from text prompts with creative control" />
</Frame>

## Example Usage

<Tip>
  For best results, we recommend using the [Structured Outputs API](/agents/structured-responses) to get responses in a structured and validated data format.
</Tip>

### Text-to-Video

Generate videos from text descriptions with creative control over style, composition, and motion.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  from vlmrun.client import VLMRun

  # Initialize the VLMRun client
  client = VLMRun(api_key="<VLMRUN_API_KEY>")

  # Generate the video
  response = client.agent.completions.create(
      model="vlmrun-orion-1:auto",
      messages=[
          {
              "role": "user",
              "content": "Generate a video of a serene mountain landscape with flowing clouds, cinematic wide shot, golden hour lighting, 4K, 20 seconds"
          }
      ]
  )

  print(response.choices[0].message.content)
  # >>> {"url": "https://.../video.mp4"}
  ```

  ```python Python - Structured Outputs theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  from vlmrun.client import VLMRun
  from pydantic import BaseModel, Field

  # Define the response schema
  class VideoGenerationResponse(BaseModel):
    url: str = Field(..., description="The URL of the generated video")

  # Initialize the VLMRun client
  client = VLMRun(api_key="<VLMRUN_API_KEY>")

  # Generate the video with structured output
  response = client.agent.completions.create(
      model="vlmrun-orion-1:auto",
      messages=[
          {
              "role": "user",
              "content": "Generate a video of a serene mountain landscape with flowing clouds, cinematic wide shot, golden hour lighting, 4K, 20 seconds"
          }
      ],
      response_format={"type": "json_schema", "schema": VideoGenerationResponse.model_json_schema()}
  )

  # Validate the response
  result = VideoGenerationResponse.model_validate_json(response.choices[0].message.content)
  # >>> VideoGenerationResponse(url="https://.../video.mp4")
  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  import { VlmRun } from "vlmrun";

  const client = new VlmRun({
    apiKey: "<VLMRUN_API_KEY>",
    baseURL: "https://api.vlm.run/v1"
  });

  const response = await client.agent.completions.create({
    model: "vlmrun-orion-1:auto",
    messages: [
      {
        role: "user",
        content: "Generate a video of a serene mountain landscape with flowing clouds, cinematic wide shot, golden hour lighting, 4K, 20 seconds"
      }
    ]
  });

  console.log(response.choices[0].message.content);
  ```

  ```typescript Node.js - Structured Outputs [expandable] theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  import { VlmRun } from "vlmrun";
  import { z } from "zod";
  import { zodToJsonSchema } from "zod-to-json-schema";

  // Define the response schema with Zod
  const VideoGenerationResponseSchema = z.object({
    url: z.string().describe("The URL of the generated video")
  });

  // Initialize the VLMRun client
  const client = new VlmRun({
    apiKey: "<VLMRUN_API_KEY>",
    baseURL: "https://api.vlm.run/v1"
  });

  // Generate the video with structured output
  const response = await client.agent.completions.create({
    model: "vlmrun-orion-1:auto",
    messages: [
      {
        role: "user",
        content: "Generate a video of a serene mountain landscape with flowing clouds, cinematic wide shot, golden hour lighting, 4K, 20 seconds"
      }
    ],
    response_format: {
      type: "json_schema",
      schema: zodToJsonSchema(VideoGenerationResponseSchema)
    }
  });

  const result = VideoGenerationResponseSchema.parse(JSON.parse(response.choices[0].message.content));
  ```
</CodeGroup>

## FAQ

<AccordionGroup>
  <Accordion title="What video styles are supported for generation?" icon="palette">
    * **Cinematic**: High-end film quality with dramatic lighting and professional camera work
    * **Realistic**: Ultra-realistic videos with natural motion and fine details
    * **Artistic**: Watercolor, oil painting, sketch, and digital art styles
    * **Creative**: Cyberpunk, fantasy, abstract, and minimalist designs
  </Accordion>

  <Accordion title="What are some tips for creating effective video prompts?" icon="lightbulb">
    * **Scene Description**: Clearly describe the setting, characters, and actions
    * **Camera Movement**: Specify camera angles, movements, and framing
    * **Lighting & Mood**: Include lighting conditions and emotional tone
    * **Technical Details**: Specify resolution, duration, and quality requirements
    * **Motion Consistency**: Describe desired motion patterns and temporal flow
  </Accordion>

  <Accordion title="What video formats and resolutions are supported?" icon="video">
    * **Resolutions**: Up to 1080p (1920x1080) for high-quality output
    * **Frame Rates**: 24fps
    * **Formats**: MP4
    * **Duration**: Typically 30-60 seconds for optimal quality and processing time
  </Accordion>
</AccordionGroup>

<Card title="Try Video Generation" icon="play" href="https://chat.vlm.run">
  Experience video generation with live examples in our interactive chat interface
</Card>
