Install
openclaw skills install ai-videoBuild and execute skills.video video generation REST requests from OpenAPI specs. Use when user needs to create, debug, or document video generation calls on open.skills.video.
openclaw skills install ai-videoRequired env vars: SKILLS_VIDEO_API_KEY. Store the key in OpenClaw skill env or shell env and do not hardcode it in files.
Use this skill to turn OpenAPI definitions into working video-generation API calls for skills.video.
Prefer deterministic extraction from openapi.json instead of guessing fields.
https://skills.video/dashboard/developerSKILLS_VIDEO_API_KEY before using the skill.Preferred OpenClaw setup:
ai-videoSKILLS_VIDEO_API_KEYEquivalent config shape:
{
"skills": {
"entries": {
"ai-video": {
"enabled": true,
"env": {
"SKILLS_VIDEO_API_KEY": "your_api_key_here"
}
}
}
}
}
Other valid ways to provide the key:
export SKILLS_VIDEO_API_KEY="your_api_key_here"SKILLS_VIDEO_API_KEYPOST /generation/sse/... as default and keep the stream open.GET /generation/{id} to terminal status.COMPLETED/SUCCEEDED/FAILED/CANCELED), never IN_PROGRESS.Run this check before any API call.
python scripts/ensure_api_key.py
If ok is false, tell the user to:
PrerequisitesExample:
export SKILLS_VIDEO_API_KEY="<YOUR_API_KEY>"
Load the most specific OpenAPI first.
/v1/openapi.json under a model namespace).openapi.json.references/open-platform-api.md for base URL, auth, and async lifecycle.If docs.json exists, derive video endpoints from the Videos navigation group.
Use default_endpoints from the script output as the primary list (SSE first).
python scripts/inspect_openapi.py \
--openapi /abs/path/to/openapi.json \
--docs /abs/path/to/docs.json \
--list-endpoints
When docs.json is unavailable, pass a known endpoint directly (for example /generation/sse/kling-ai/kling-v2.6).
Use references/video-model-endpoints.md as a snapshot list.
Inspect endpoint details and generate a request template from required/default fields.
python scripts/inspect_openapi.py \
--openapi /abs/path/to/openapi.json \
--endpoint /generation/sse/kling-ai/kling-v2.6 \
--include-template
Use the returned request_template as the starting point.
Do not add fields not defined by the endpoint schema.
Use default_create_endpoint from output unless an explicit override is required.
Prefer the helper script. It creates via SSE and keeps streaming; if stream ends before terminal completion, it automatically switches to polling fallback.
python scripts/create_and_wait.py \
--sse-endpoint /generation/sse/kling-ai/kling-v2.6 \
--payload '{"prompt":"A cinematic dolly shot of neon city rain at night"}' \
--poll-timeout 900 \
--poll-interval 3
Treat SSE as the default result channel.
Do not finish the task on IN_QUEUE or IN_PROGRESS.
Return only after terminal result.
Use polling only if SSE cannot be established, disconnects early, or does not reach a terminal state.
Use GET /generation/{id} (or model-spec equivalent path if the OpenAPI uses /v1/...).
curl -X GET "https://open.skills.video/api/v1/generation/<GENERATION_ID>" \
-H "Authorization: Bearer $SKILLS_VIDEO_API_KEY"
Stop polling on terminal states:
COMPLETEDFAILEDCANCELEDRecommended helper:
python scripts/wait_generation.py \
--generation-id <GENERATION_ID> \
--timeout 900 \
--interval 3
Return to user only after helper emits event=terminal.
Handle these response codes for create, SSE, and fallback poll operations:
400: request format issue401: missing/invalid API key402: possible payment/credits issue in runtime404: endpoint or generation id not found422: schema validation failedClassify non-2xx runtime errors with:
python scripts/handle_runtime_error.py \
--status <HTTP_STATUS> \
--body '<RAW_ERROR_BODY_JSON_OR_TEXT>'
If category is insufficient_credits, tell the user to recharge:
https://skills.video/dashboard and go to Billing/CreditsOptional balance check:
curl -X GET "https://open.skills.video/api/v1/credits" \
-H "Authorization: Bearer $SKILLS_VIDEO_API_KEY"
Apply retries only for transient conditions (network failure or temporary 5xx).
Use bounded exponential backoff (for example 1s, 2s, 4s, max 16s, then fail).
Do not retry unchanged payloads after 4xx validation errors.
Treat rate limits and server-side timeout windows as unknown unless documented in the active OpenAPI or product docs. If unknown, explicitly note this in output and choose conservative client defaults.
scripts/ensure_api_key.py: validate SKILLS_VIDEO_API_KEY and show first-run setup guidancescripts/handle_runtime_error.py: classify runtime errors and provide recharge guidance for insufficient creditsscripts/inspect_openapi.py: extract SSE/polling endpoint pair, contract, and payload templatescripts/create_and_wait.py: create via SSE and auto-fallback to polling when stream does not reach terminal statusscripts/wait_generation.py: poll generation status until terminal completion and return final responsereferences/open-platform-api.md: SSE-first lifecycle, fallback polling, retry baselinereferences/video-model-endpoints.md: current video endpoint snapshot from docs.jsonConfigure API key: export SKILLS_VIDEO_API_KEY="your_api_key_here" Verify: python scripts/ensure_api_key.py