← Back to Blog

How to Run an AI Video Generation Agent with OE Runtime

Generate short cinematic video clips from text descriptions automatically. OE Runtime connects to Runway, crafts detailed scene prompts, submits the generation job, polls for completion, and returns the video URL — no video production skills required.

🎬
Step 1
Design Video Prompt
Craft a detailed Runway prompt with scene, motion, style, and camera movement details.
Step 2
Generate Video
Submit to Runway and poll every 15 seconds until generation status is SUCCEEDED.
Step 3
Report
Return the prompt used, generation time, video URL, duration, resolution, and recommended use cases.

The Agent YAML

Create a file called agent.yaml inside a video-generation/ directory:

name: Video Creator
description: Generate short video clips from text prompts
instructions: |
  You are a video generation agent. Create short video clips using Runway.
  Video generation is asynchronous — after submitting, poll for completion before returning the result.
  Complete all steps fully before writing your report.
steps:
  - name: Design Video Prompt
    content: |
      Craft a detailed Runway video prompt for a 5-second product reveal clip.
      Scene: a sleek smartphone emerging from mist on a dark reflective surface.
      Motion: slow upward drift with a rotating reveal.
      Style: cinematic, high contrast, blue accent lighting.
      Camera: slow push-in, shallow depth of field.
  - name: Generate Video
    content: |
      Submit the prompt to the Runway connector.
      POST /image_to_video with body:
      {
        "promptText": "<video prompt from previous step>",
        "model": "gen3a_turbo",
        "duration": 5,
        "ratio": "1280:720"
      }
      Save the id from the response.
      Poll GET /tasks/<id> every 15 seconds until status is "SUCCEEDED".
      Once complete, extract and return the output video URL.
  - name: Report
    content: |
      Summarize the result:
      - Prompt used for generation
      - Generation time taken
      - Output video URL
      - Duration and resolution
connectors:
  - connection_name: Runway
    connection_type: runway

The Config File

Create oe-config.json in the same directory:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "YOUR_OPENAI_API_KEY"
  },
  "server": {
    "enabled": false,
    "port": 3333,
    "apiKey": "your-secret-api-key"
  },
  "connectors": [
    {
      "connection_name": "Runway",
      "connection_type": "runway",
      "bearerToken": "YOUR_RUNWAY_API_KEY",
      "baseUrl": "https://api.dev.runwayml.com/v1"
    }
  ]
}

Get your Runway API key from app.runwayml.com/settings. The model gen3a_turbo is the fastest generation option. The duration field accepts 5 or 10 seconds. Video generation is asynchronous — the agent polls until the job completes before returning the URL.

Download OE Runtime

OE Runtime — Direct Downloads

Run the Agent

Windows

oe-runtime-win.exe video-generation/agent.yaml --config video-generation/oe-config.json

macOS

chmod +x oe-runtime-macos
oe-runtime-macos video-generation/agent.yaml --config video-generation/oe-config.json

Linux

chmod +x oe-runtime-linux
oe-runtime-linux video-generation/agent.yaml --config video-generation/oe-config.json

macOS Gatekeeper: On first run, macOS may block the binary. Go to System Settings → Privacy & Security → click "Allow Anyway" next to oe-runtime-macos.

Running as an API Server

Add --serve to start OE Runtime as an HTTP server on port 3333:

oe-runtime-win.exe --serve --config video-generation/oe-config.json

Then send a request:

curl -X POST http://localhost:3333/run \
  -H "Content-Type: application/json" \
  -d '{"yaml": "video-generation/agent.yaml", "params": {}}'

Or import the Postman collection (download above) to test all endpoints visually.

Use Cases

Build your own agents with OE Runtime

Download OE Runtime and run any AI agent locally or as a server — no cloud required.

Get OE Runtime →
Series OE Runtime Agent Guides — 21 Connectors
Series overview →