使用 skills.video 的 OpenAPI 接口构建和执行 AI 图片生成请求,支持一键调用各类图片生成模型。
Build and execute skills.video image generation REST requests from OpenAPI specs.
# 安装 Skill(会下载 SKILL.md 到 .claude/skills/) claw install skills-video/ai-image # 之后直接对 Claude 说"用 AI Image 帮我…"即可
# 同样的安装命令,兼容所有支持 SKILL.md 的 AI 编程工具 claw install skills-video/ai-image
此 Skill 兼容 OpenClaw 标准。 安装后自动生成 SKILL.md 文件,任何支持 OpenClaw 协议的 AI Agent(Claude Code、Cursor、Windsurf 等)均可直接调用。
skills.video.
Prefer deterministic extraction from openapi.json instead of guessing fields.https://skills.video/dashboard/developerSKILLS_VIDEO_API_KEY before using the skill.ai-imageSKILLS_VIDEO_API_KEY{
"skills": {
"entries": {
"ai-image": {
"enabled": true,
"env": {
"SKILLS_VIDEO_API_KEY": "your_api_key_here"
}
}
}
}
}
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.python scripts/ensure_api_key.py
ok is false, tell the user to:Prerequisitesexport SKILLS_VIDEO_API_KEY="<YOUR_API_KEY>"
/v1/openapi.json under a model namespace).openapi.json.references/open-platform-api.md for base URL, auth, and async lifecycle.docs.json exists, derive image endpoints from the Images 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
docs.json is unavailable, pass a known endpoint directly (for example /generation/sse/google/nano-banana-pro).
Use references/image-model-endpoints.md as a snapshot list.python scripts/inspect_openapi.py \
--openapi /abs/path/to/openapi.json \
--endpoint /generation/sse/google/nano-banana-pro \
--include-template
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.python scripts/create_and_wait.py \
--sse-endpoint /generation/sse/google/nano-banana-pro \
--payload '{"prompt":"Minimal product photo of a matte black coffee grinder on white background"}' \
--poll-timeout 900 \
--poll-interval 3
IN_QUEUE or IN_PROGRESS.
Return only after terminal result.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"
COMPLETEDFAILEDCANCELEDpython scripts/wait_generation.py \
--generation-id <GENERATION_ID> \
--timeout 900 \
--interval 3
event=terminal.400: request format issue401: missing/invalid API key402: possible payment/credits issue in runtime404: endpoint or generation id not found422: schema validation failedpython scripts/handle_runtime_error.py \
--status <HTTP_STATUS> \
--body '<RAW_ERROR_BODY_JSON_OR_TEXT>'
insufficient_credits, tell the user to recharge:https://skills.video/dashboard and go to Billing/Creditscurl -X GET "https://open.skills.video/api/v1/credits" \
-H "Authorization: Bearer $SKILLS_VIDEO_API_KEY"
5xx).
Use bounded exponential backoff (for example 1s, 2s, 4s, max 16s, then fail).
Do not retry unchanged payloads after 4xx validation errors.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/image-model-endpoints.md: current image endpoint snapshot from docs.json