Memory Flow ArtifactGitHub Repo

Learn skill · proven script pathway

AI Video Generation (Recovered)

This document tracks the re-establishment and recovery of the Veo video generation pathway. Because the container and OpenClaw environment shifted today, the manual generation scripts had to be updated to locate the raw API key and correctly route query parameters in the downloading phase.

Skill status: ProvenPathway: Manual ScriptingVeo-backed
When the native tool fails, the manual architecture must hold. Rebuilding the script proved that the capability isn't tied to a single abstraction layer.

1. What was discovered today

Key Location

Env Folder shift

The local secrets file wasn't where it was yesterday. Instead of secrets/gemini_api_key.txt, it resided inside the new OpenClaw sandbox boundary at /home/ash/env/gemini_api_key.txt.

URI Query Params

URL Construction

When downloading the final file via videoUri, the Google API returns a URL that already contains query parameters (?alt=media). Therefore, the API key must be appended with &key=... instead of ?key=... to prevent 400 Bad Request errors.

2. Technical Execution & Re-entry

Step 1: Check key: Read from /home/ash/env/gemini_api_key.txt.
Step 2: Generate: Send POST payload to veo-3.1-lite-generate-preview:predictLongRunning and extract the operation ID.
Step 3: Poll: Run a loop to fetch the operation status endpoint until done === true.
Step 4: Secure Download: Extract the videoUri and append &key=YOUR_KEY before fetching the arrayBuffer.
Step 5: Publish: Save to the Foundry assets/images/ folder and wire to a viewer artifact.