| name | ultimate-ai-media-generator-skill |
| description | Generate and monitor CyberBara Public API v1 image, video, audio, and music tasks end-to-end. Use when work involves CyberBara `/api/v1` endpoints for listing models, uploading reference media, quoting credits, creating generation tasks, polling task status, checking credits balance and usage, or saving final media outputs. |
Ultimate-AI-Media-Generator-Skill
Overview
Use this skill to call CyberBara APIs reliably, create image, video, audio, and music generation tasks, and return final media URLs with credit-aware flow.
Implementation Architecture
The runtime uses a layered Python architecture:
scripts/cyberbara_api.py: thin entrypoint only
src/cyberbara_cli/cli.py: command parsing and command routing
src/cyberbara_cli/usecases/: flow orchestration (generation + polling)
src/cyberbara_cli/policies/: safety and policy rules (credits quote + formal confirmation)
src/cyberbara_cli/gateways/: raw CyberBara API client
src/cyberbara_cli/config.py: API key discovery and local persistence
src/cyberbara_cli/constants.py: fixed base URL and shared constants
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 or videos when task scene needs local media 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:
python3 scripts/cyberbara_api.py models --media-type video
python3 scripts/cyberbara_api.py models --media-type audio
python3 scripts/cyberbara_api.py models --media-type music
python3 scripts/cyberbara_api.py upload-images ./frame.png ./style.jpg
python3 scripts/cyberbara_api.py upload-videos ./clip.mp4
python3 scripts/cyberbara_api.py quote --json '{
"model":"sora-2",
"media_type":"video",
"scene":"text-to-video",
"options":{"duration":"10"}
}'
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"}
}'
python3 scripts/cyberbara_api.py wait --task-id <TASK_ID> --interval 5 --timeout 900
Image and video generation are confirmation-gated by default:
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"}
}'
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
python3 scripts/cyberbara_api.py generate-audio --json '{
"model":"suno-sound-v5-5",
"prompt":"A short cinematic whoosh with soft digital sparkle",
"scene":"text-to-audio",
"options":{"loop":false}
}' --yes
python3 scripts/cyberbara_api.py generate-music --json '{
"model":"suno-music-v5",
"prompt":"Warm lo-fi study music with mellow keys",
"scene":"text-to-music",
"options":{"instrumental":true}
}' --yes
Control auto-save and open behavior:
python3 scripts/cyberbara_api.py generate-image --file ./image-requests.json --yes --no-open
python3 scripts/cyberbara_api.py generate-video --json '{...}' --yes --output-dir ./downloads
python3 scripts/cyberbara_api.py generate-video --json '{...}' --yes --async
Use Script Capabilities
scripts/cyberbara_api.py supports:
setup-api-key to persist API key into local cache
models to list public models (--media-type image|video|audio|music optional)
upload-images to upload local image files to /api/v1/uploads/images
upload-videos to upload local video files to /api/v1/uploads/videos
quote to estimate credit cost from JSON request body
generate-image to auto-quote credits, compute total for batch requests, require formal confirmation, create task(s), wait, then save/open outputs
generate-video to auto-quote credits, compute total for batch requests, require formal confirmation, create task(s), wait, then save/open outputs
generate-audio to auto-quote credits, compute total for batch requests, require formal confirmation, create task(s), wait, then save/open outputs
generate-music to auto-quote credits, compute total for batch requests, require formal confirmation, create task(s), wait, then save/open outputs
task to fetch task snapshot by task ID
wait to poll task until success, failed, or canceled, then save/open outputs
balance and usage to inspect credits
raw for direct custom endpoint calls
Use --file request.json instead of --json for long payloads.
Enforce API Payload Rules
- Send auth via API key (
Authorization: Bearer <key> or x-api-key).
- Send public request fields under
options.* only.
- Prefer explicit
scene to avoid inference ambiguity.
- Include
options.image_input for image-to-image and image-to-video.
- Include
options.video_input for video-to-video.
- Poll
/api/v1/tasks/{taskId} until final status; only success guarantees output URLs.
- Before every image, video, audio, or music generation submission, obtain quote first and get explicit user confirmation.
- For multiple image/video/audio/music requests, calculate and present total estimated credits before submission.
- Save output files under
media_outputs/ by default and auto-open them unless disabled.
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
invalid_api_key or api_key_required: verify key and headers.
insufficient_credits: quote first or recharge credits.
invalid_scene or scene_not_supported: choose scene supported by model.
invalid_request: verify prompt and options requirements by model.
task_not_found: verify task ID and environment domain.