ultimate-ai-media-generator-skill
Generate and monitor CyberBara Public API v1 image and video tasks end-to-end. Use when work involves CyberBara `/api/v1` endpoints for listing models, uploading reference images, quoting credits, creating generation tasks, polling task status, or checking credits balance and usage.
git clone https://github.com/ZeroLu/Ultimate-AI-Media-Generator-Skill
git clone --depth=1 https://github.com/ZeroLu/Ultimate-AI-Media-Generator-Skill ~/.claude/skills/zerolu-ultimate-ai-media-generator-skill-ultimate-ai-media-generator-skill
SKILL.mdUltimate-AI-Media-Generator-Skill
Overview
Use this skill to call CyberBara APIs reliably, create image/video generation tasks, and return final media URLs with credit-aware flow.
Implementation Architecture
The runtime uses a layered Python architecture:
: thin entrypoint onlyscripts/cyberbara_api.py
: command parsing and command routingsrc/cyberbara_cli/cli.py
: flow orchestration (generation + polling)src/cyberbara_cli/usecases/
: safety and policy rules (credits quote + formal confirmation)src/cyberbara_cli/policies/
: raw CyberBara API clientsrc/cyberbara_cli/gateways/
: API key discovery and local persistencesrc/cyberbara_cli/config.py
: fixed base URL and shared constantssrc/cyberbara_cli/constants.py
When extending behavior, keep business rules in
usecases/ or policies/, not in scripts/.
Set Up Runtime Inputs
The script uses fixed base URL:
https://cyberbara.com
API key lookup order:
--api-key- environment variable
CYBERBARA_API_KEY - local cache file
~/.config/cyberbara/api_key - interactive prompt (if running in terminal)
Recommended one-time setup command:
python3 scripts/cyberbara_api.py setup-api-key "<api-key>"
Or save from environment variable:
export CYBERBARA_API_KEY="<api-key>" python3 scripts/cyberbara_api.py setup-api-key --from-env
If API key is missing, the script immediately asks for it and shows where to get one:
https://cyberbara.com/settings/apikeys
When you provide API key via
--api-key or interactive prompt, it is saved to:
~/.config/cyberbara/api_key
Future runs reuse this cached key, so users do not need to provide it every time.
Run The Standard Generation Flow
- Discover available models.
- Upload reference images when task scene needs image inputs.
- Quote credits before creating a generation task.
- Create image or video generation task and wait for final output.
- Automatically save generated media locally and open it.
- Check usage records when needed.
Reference commands:
# 1) List video models python3 scripts/cyberbara_api.py models --media-type video # 2) Upload local reference images python3 scripts/cyberbara_api.py upload-images ./frame.png ./style.jpg # 3) Estimate credits python3 scripts/cyberbara_api.py quote --json '{ "model":"sora-2", "media_type":"video", "scene":"text-to-video", "options":{"duration":"10"} }' # 4) Create a video task (default behavior: wait for success, save outputs to ./media_outputs, auto-open) python3 scripts/cyberbara_api.py generate-video --json '{ "model":"sora-2", "prompt":"A calm drone shot over snowy mountains at sunrise", "scene":"text-to-video", "options":{"duration":"10","resolution":"standard"} }' # 5) Existing task: wait + save/open outputs python3 scripts/cyberbara_api.py wait --task-id <TASK_ID> --interval 5 --timeout 900
Image and video generation are confirmation-gated by default:
# Single image request: script auto-quotes, then asks you to type CONFIRM python3 scripts/cyberbara_api.py generate-image --json '{ "model":"nano-banana-pro", "prompt":"A cinematic portrait under neon rain", "scene":"text-to-image", "options":{"resolution":"1k"} }' # Batch image requests (JSON array): script auto-quotes each request and prints total estimated credits python3 scripts/cyberbara_api.py generate-image --file ./image-requests.json
image-requests.json format:
[ { "model": "nano-banana-pro", "prompt": "A cinematic portrait under neon rain", "scene": "text-to-image", "options": { "resolution": "1k" } }, { "model": "nano-banana-pro", "prompt": "A product still life with dramatic side light", "scene": "text-to-image", "options": { "resolution": "1k" } } ]
Only use
--yes after explicit user approval has been obtained:
python3 scripts/cyberbara_api.py generate-image --file ./image-requests.json --yes python3 scripts/cyberbara_api.py generate-video --json '{ "model":"sora-2", "prompt":"A calm drone shot over snowy mountains at sunrise", "scene":"text-to-video", "options":{"duration":"10","resolution":"standard"} }' --yes
Control auto-save and open behavior:
# keep waiting but do not auto-open media python3 scripts/cyberbara_api.py generate-image --file ./image-requests.json --yes --no-open # custom output directory python3 scripts/cyberbara_api.py generate-video --json '{...}' --yes --output-dir ./downloads # submit only (no wait/save/open) python3 scripts/cyberbara_api.py generate-video --json '{...}' --yes --async
Use Script Capabilities
scripts/cyberbara_api.py supports:
to persist API key into local cachesetup-api-key
to list public models (models
optional)--media-type image|video
to upload local image files toupload-images/api/v1/uploads/images
to estimate credit cost from JSON request bodyquote
to auto-quote credits, compute total for batch requests, require formal confirmation, create task(s), wait, then save/open outputsgenerate-image
to auto-quote credits, compute total for batch requests, require formal confirmation, create task(s), wait, then save/open outputsgenerate-video
to fetch task snapshot by task IDtask
to poll task untilwait
,success
, orfailed
, then save/open outputscanceled
andbalance
to inspect creditsusage
for direct custom endpoint callsraw
Use
--file request.json instead of --json for long payloads.
Enforce API Payload Rules
- Send auth via API key (
orAuthorization: Bearer <key>
).x-api-key - Send public request fields under
only.options.* - Prefer explicit
to avoid inference ambiguity.scene - Include
foroptions.image_input
andimage-to-image
.image-to-video - Include
foroptions.video_input
.video-to-video - Poll
until final status; only/api/v1/tasks/{taskId}
guarantees output URLs.success - Before every image or video generation submission, obtain quote first and get explicit user confirmation.
- For multiple image/video requests, calculate and present total estimated credits before submission.
- Save output files under
by default and auto-open them unless disabled.media_outputs/
Navigate Detailed Model Options
Use the reference file for full model matrices and examples:
references/cyberbara-api-reference.mdx
For fast lookup in large reference:
rg '^## |^### ' references/cyberbara-api-reference.mdx rg 'kling-2.6|sora-2|veo-3.1|seedance' references/cyberbara-api-reference.mdx
Handle Common Failures
orinvalid_api_key
: verify key and headers.api_key_required
: quote first or recharge credits.insufficient_credits
orinvalid_scene
: choose scene supported by model.scene_not_supported
: verifyinvalid_request
andprompt
requirements by model.options
: verify task ID and environment domain.task_not_found