← 返回 Skills 市场
🔌

AI Image

作者 skills-video · GitHub ↗ · v1.0.3 · MIT-0
linuxdarwin ✓ 安全检测通过
165
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install ai-image
功能描述
Build and execute skills.video image generation REST requests from OpenAPI specs. Use when user needs to create, debug, or document image generation calls on...
使用说明 (SKILL.md)

ai-image

Overview

Use this skill to turn OpenAPI definitions into working image-generation API calls for skills.video. Prefer deterministic extraction from openapi.json instead of guessing fields.

Prerequisites

  1. Obtain an API key at: https://skills.video/dashboard/developer
  2. Configure SKILLS_VIDEO_API_KEY before using the skill.

Preferred OpenClaw setup:

  • Open the skill settings for ai-image
  • Add an environment variable named SKILLS_VIDEO_API_KEY
  • Paste the API key as its value

Equivalent config shape:

{
  "skills": {
    "entries": {
      "ai-image": {
        "enabled": true,
        "env": {
          "SKILLS_VIDEO_API_KEY": "your_api_key_here"
        }
      }
    }
  }
}

Other valid ways to provide the key:

  • Shell: export SKILLS_VIDEO_API_KEY="your_api_key_here"
  • Tool-specific env config: any runtime that injects SKILLS_VIDEO_API_KEY

Workflow

  1. Check API key and bootstrap environment on first use.
  2. Identify the active spec.
  3. Select the SSE endpoint pair for an image model.
  4. Extract request schema and generate a payload template.
  5. Execute POST /generation/sse/... as default and keep the stream open.
  6. If SSE does not reach terminal completion, poll GET /generation/{id} to terminal status.
  7. Return only terminal result (COMPLETED/SUCCEEDED/FAILED/CANCELED), never IN_PROGRESS.
  8. Apply retry and failure handling.

0) Check API key (first run)

Run this check before any API call.

python scripts/ensure_api_key.py

If ok is false, tell the user to:

  • Follow the setup in Prerequisites

Example:

export SKILLS_VIDEO_API_KEY="\x3CYOUR_API_KEY>"

1) Identify the spec

Load the most specific OpenAPI first.

  • Prefer model-specific OpenAPI when available (for example /v1/openapi.json under a model namespace).
  • Fall back to platform-level openapi.json.
  • Use references/open-platform-api.md for base URL, auth, and async lifecycle.

2) Select an image endpoint

If 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

When 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.

3) Extract schema and build payload

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/google/nano-banana-pro \
  --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.

4) Execute SSE request (default) with automatic fallback

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/google/nano-banana-pro \
  --payload '{"prompt":"Minimal product photo of a matte black coffee grinder on white background"}' \
  --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.

5) Fall back to polling

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/\x3CGENERATION_ID>" \
  -H "Authorization: Bearer $SKILLS_VIDEO_API_KEY"

Stop polling on terminal states:

  • COMPLETED
  • FAILED
  • CANCELED

Recommended helper:

python scripts/wait_generation.py \
  --generation-id \x3CGENERATION_ID> \
  --timeout 900 \
  --interval 3

Return to user only after helper emits event=terminal.

6) Handle errors and retries

Handle these response codes for create, SSE, and fallback poll operations:

  • 400: request format issue
  • 401: missing/invalid API key
  • 402: possible payment/credits issue in runtime
  • 404: endpoint or generation id not found
  • 422: schema validation failed

Classify non-2xx runtime errors with:

python scripts/handle_runtime_error.py \
  --status \x3CHTTP_STATUS> \
  --body '\x3CRAW_ERROR_BODY_JSON_OR_TEXT>'

If category is insufficient_credits, tell the user to recharge:

  • Open https://skills.video/dashboard and go to Billing/Credits
  • Recharge or purchase additional credits
  • Retry after recharge

Optional 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.

Rate limits and timeouts

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.

Resources

  • scripts/ensure_api_key.py: validate SKILLS_VIDEO_API_KEY and show first-run setup guidance
  • scripts/handle_runtime_error.py: classify runtime errors and provide recharge guidance for insufficient credits
  • scripts/inspect_openapi.py: extract SSE/polling endpoint pair, contract, and payload template
  • scripts/create_and_wait.py: create via SSE and auto-fallback to polling when stream does not reach terminal status
  • scripts/wait_generation.py: poll generation status until terminal completion and return final response
  • references/open-platform-api.md: SSE-first lifecycle, fallback polling, retry baseline
  • references/image-model-endpoints.md: current image endpoint snapshot from docs.json
安全使用建议
This skill is internally consistent for calling skills.video image-generation APIs and asks only for the SKILLS_VIDEO_API_KEY and standard tools (python3, curl). Before installing: 1) Confirm you trust the skills.video service and the skill's source (homepage and repository links are present). 2) Store SKILLS_VIDEO_API_KEY securely (environment or platform secrets) and avoid hardcoding it; be mindful that the scripts print and log events which may include generation IDs and messages but do not appear to exfiltrate the key. 3) Review the included scripts if you have concerns about logging or network targets — they default to https://open.skills.video/api/v1 but accept alternate base_url/endpoint arguments. 4) Be aware of a minor bug in inspect_openapi.py (undefined variable 'pr') which may cause failures when summarizing field descriptions; consider reviewing/fixing that file if you plan to use the OpenAPI inspection features. 5) If you allow autonomous agent invocation, remember the agent could run these scripts which will make outbound requests to skills.video using your API key; restrict or audit key scope and monitor usage if needed.
功能分析
Type: OpenClaw Skill Name: ai-image Version: 1.0.3 The skill bundle is a legitimate tool for interacting with the skills.video image generation API. It includes scripts for validating API keys (ensure_api_key.py), inspecting OpenAPI specifications (inspect_openapi.py), and managing the asynchronous generation lifecycle via Server-Sent Events (SSE) and polling (create_and_wait.py, wait_generation.py). No evidence of data exfiltration, malicious execution, or prompt injection was found; the code logic is consistent with the stated purpose of generating images through a documented REST API.
能力评估
Purpose & Capability
The skill name/description (image generation helper for skills.video) matches the declared requirements: SKILLS_VIDEO_API_KEY as the primary credential, python3 and curl as required binaries, and scripts that build/inspect OpenAPI payloads and call the skills.video endpoints. There are no unrelated credentials or binaries requested.
Instruction Scope
SKILL.md and bundled scripts instruct the agent to read OpenAPI/docs JSON files, construct request payloads, open SSE connections to skills.video endpoints, and fall back to polling. This scope is appropriate for an OpenAPI-driven image-generation helper. Note: the scripts accept arbitrary openapi.json/docs.json paths and endpoints (expected for this tool). Also the inspect_openapi.py appears to contain a small coding bug (an undefined variable 'pr' when assigning a field description) which may cause runtime failures — this is a functionality issue, not an obvious malicious behavior.
Install Mechanism
No install spec is present (instruction-only install), so nothing is downloaded or installed at install time. The skill includes Python scripts that will run locally; that's expected for a python-based helper. No network downloads, obscure URLs, or archive extraction are present in the package.
Credentials
The only environment variable required is SKILLS_VIDEO_API_KEY (declared as primaryEnv) which is appropriate for a bearer-auth REST client. The scripts and README reference only that key; no unrelated secrets (AWS, GCP, etc.) are requested.
Persistence & Privilege
always is false and the skill does not request persistent system-wide privileges. It suggests stateDirs (~/.openclaw) for storing state but does not attempt to modify other skills or system credentials. Agent autonomous invocation is allowed (default) but not combined with elevated privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ai-image
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ai-image 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.3
- Added MIT license information. - Included author, supported operating systems, and required binaries in metadata. - Expanded CLI help and configuration guidance in metadata. - Linked to repository and homepage in metadata. - No code changes; documentation and metadata enhancements only.
v1.0.2
- Added requirements and configuration instructions for the SKILLS_VIDEO_API_KEY environment variable in the skill metadata and documentation. - Updated "Prerequisites" section to clarify API key setup for both OpenClaw and shell environments. - Removed redundant API key setup instructions in favor of referencing the new prerequisites. - No functional changes to the workflow or runtime behavior. - Improved documentation for user setup and configuration consistency.
v1.0.1
- Skill renamed from "image-generation" to "ai-image". - Description updated to match new skill name. - No changes to workflow, API usage, or implementation details. - No file changes detected; documentation update only.
v1.0.0
- Initial release of the image-generation skill for building and executing REST image generation requests via OpenAPI specs on skills.video. - Automates endpoint extraction, payload building, and handles SSE vs. polling for terminal image generation results. - Integrates helper scripts for setup, API key validation, OpenAPI inspection, runtime error handling, and terminal status polling. - Implements error classification, retry/backoff logic, and credit/billing guidance for common runtime issues. - Includes documentation and references for setup, supported endpoints, and workflow step-by-step.
元数据
Slug ai-image
版本 1.0.3
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

AI Image 是什么?

Build and execute skills.video image generation REST requests from OpenAPI specs. Use when user needs to create, debug, or document image generation calls on... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 165 次。

如何安装 AI Image?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ai-image」即可一键安装,无需额外配置。

AI Image 是免费的吗?

是的,AI Image 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

AI Image 支持哪些平台?

AI Image 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux, darwin)。

谁开发了 AI Image?

由 skills-video(@skills-video)开发并维护,当前版本 v1.0.3。

💬 留言讨论