TopRank Skills

Home / Claw Skills / API Integration / aimlapi-media-gen
Official OpenClaw rules 36%

aimlapi-media-gen

Generate images or videos via AIMLAPI from prompts. Use when Codex needs reliable AI/ML API media generation with retries, explicit User-Agent headers, and async video polling.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 aimlapi-media-gen 技能。 若已安装,则直接安装 aimlapi-media-gen 技能。

Overview

Skill Key
aimlapihello/aiml-image-video
Author
aimlapihello
Source Repo
openclaw/skills
Version
-
Source Path
skills/aimlapihello/aiml-image-video
Latest Commit SHA
d78bc42e3755ccc14ee1922d3cfebb42d4f6472a

Extracted Content

SKILL.md excerpt

# AIMLAPI Media Generation

## Overview

Generate images and videos via AIMLAPI with scripts that include retries, API key file fallback, verbose logs, and required `User-Agent` headers on every request.

## Quick start

```bash
export AIMLAPI_API_KEY="sk-aimlapi-..."
python3 {baseDir}/scripts/gen_image.py --prompt "ultra-detailed studio photo of a lobster astronaut"
python3 {baseDir}/scripts/gen_video.py --prompt "slow drone shot of a foggy forest"
```

## Tasks

### Generate images

Use `scripts/gen_image.py` with `/v1/images/generations`.

```bash
python3 {baseDir}/scripts/gen_image.py \
  --prompt "cozy cabin in a snowy forest" \
  --model aimlapi/openai/gpt-image-1 \
  --size 1024x1024 \
  --count 2 \
  --retry-max 4 \
  --user-agent "openclaw-custom/1.0" \
  --out-dir ./out/images
```

### Generate videos (async AIMLAPI flow)

Use `scripts/gen_video.py` with the real async flow:

1. `POST /v2/video/generations` (create task)
2. `GET /v2/video/generations?generation_id=...` (poll status)
3. download `video.url` when status is completed

```bash
python3 {baseDir}/scripts/gen_video.py \
  --model google/veo-3.1-t2v-fast \
  --prompt "time-lapse of clouds over a mountain range" \
  --poll-interval 10 \
  --max-wait 1000 \
  --user-agent "openclaw-custom/1.0" \
  --out-dir ./out/videos
```

## References

- `references/aimlapi-media.md`: endpoint notes, async polling statuses, and troubleshooting.
- `README.md`: changelog-style summary of new instructions.

README excerpt

# aimlapi-media-gen

This skill provides helper scripts for AIMLAPI image and video generation.

## Security & Credentials

- This skill requires an `AIMLAPI_API_KEY` environment variable.
- Be cautious when using the `--apikey-file` flag; ensure the provided path is correct and secure.
- Avoid including sensitive or private data in prompts or parameters sent to the remote API.

## New instructions

- Every HTTP request now sends a `User-Agent` header (configurable via `--user-agent`).
- `gen_image.py` supports retries, API key from `--apikey-file`, and verbose logs.
- `gen_video.py` follows AIMLAPI async flow:
  1. `POST /v2/video/generations`
  2. poll `GET /v2/video/generations?generation_id=...`
  3. download final `video.url`
- Video polling statuses `waiting|active|queued|generating|processing` are treated as in-progress.

See `SKILL.md` for examples.

Related Claw Skills