Unified access to multiple AI models through kie.ai's API. Generate images, videos, and music at 30-80% lower cost than official APIs.
- π¨ Image Generation: Nano Banana Pro (Gemini 3 Pro), Flux, 4o-image
- π€ Google Drive Upload: Optional automatic upload to Drive folder
- π Usage Tracking: Local task history and cost estimation
- πΎ Local Storage: All files saved to
images/before optional upload - π¬ Video Generation (coming soon): Veo 3.1, Runway Gen-4 Aleph
- π΅ Music Generation (coming soon): Suno V4/V4.5
# Generate an image
./kie-ai.sh generate-image "A serene Japanese garden at sunset"
# With custom options
./kie-ai.sh generate-image "Cyberpunk city" --resolution 2K --aspect 16:9
# Upload to Google Drive
./kie-ai.sh generate-image "Space nebula" --upload-drive
# Check usage
./kie-ai.sh balance- Python 3.6+ (usually pre-installed on macOS/Linux)
- kie.ai API Key:
- Sign up at https://kie.ai
- Get API key from dashboard
# Clone the repo
cd ~/src
git clone https://github.com/jon-xo/kie-ai-skill.git
cd kie-ai-skill
# Make executable
chmod +x kie-ai.sh lib/*.py
# Set your API key
export KIE_API_KEY="your-key-here"
# Test it
./kie-ai.sh generate-image "test image"If using with OpenClaw:
-
Add API key to
~/.openclaw/openclaw.json:"env": { "vars": { "KIE_API_KEY": "your-key-here" } }
-
Create symlink:
ln -s ~/src/kie-ai-skill ~/.openclaw/workspace/skills/kie-ai-skill
./kie-ai.sh generate-image <prompt> [options]
Options:
--model <name> Model (default: nano-banana-pro)
--resolution <res> 1K, 2K, 4K (default: 1K)
--aspect <ratio> 1:1, 16:9, 9:16, etc. (default: 1:1)
--upload-drive Upload to Google Drive after generationExamples:
# Basic
./kie-ai.sh generate-image "A red apple on a wooden table"
# High resolution widescreen
./kie-ai.sh generate-image "Mountain landscape" --resolution 4K --aspect 16:9
# 16-bit pixel art style
./kie-ai.sh generate-image "Cyberpunk lobster, 16-bit pixel art, no text"
# Generate and upload to Drive
./kie-ai.sh generate-image "Abstract art" --upload-drive./kie-ai.sh balanceShows:
- Local task history
- Estimated credit consumption
- USD equivalent
- Links to web UI for actual balance
./kie-ai.sh models# View config help
./kie-ai.sh config
# Edit config.json
nano config.json
# Set:
# - enabled: true
# - folder_id: "YOUR_GOOGLE_DRIVE_FOLDER_ID"Google Drive Setup:
- Sign up at https://maton.ai (OAuth gateway)
- Add
MATON_API_KEYto environment - Create Google Drive connection at https://ctrl.maton.ai
- Get folder ID from Drive URL
Approximate costs (kie.ai vs official APIs):
| Model | kie.ai | Official | Savings |
|---|---|---|---|
| Nano Banana Pro | $0.09-$0.12 | $0.15 | 20-40% |
| Flux Kontext | $0.25 | $0.30 | ~17% |
Credit pricing: ~$0.005 per credit
Packages: 1,000 credits = $5
nano-banana-pro- Gemini 3 Pro Image (1K/2K/4K)google/nano-banana- Gemini 2.5 Flash (cheaper)flux-kontext- Flux by Black Forest Labs4o-image- OpenAI GPT-4o Image
veo-3.1- Google Veo 3.1 (cinematic)veo-3.1-fast- Veo Fast (cheaper)runway-aleph- Runway Gen-4 Aleph
suno-v4- Suno V4 (up to 8min)suno-v4.5- Suno V4.5 Plus
See https://docs.kie.ai for full list.
Generated files are saved locally to the images/ directory (gitignored):
~/src/kie-ai-skill/images/YYYY-MM-DD-HH-MM-SS-{index}.png
Retention:
- Local: Forever (until deleted)
- kie.ai CDN: 14 days
- Google Drive: Forever (if uploaded)
kie-ai-skill/
βββ kie-ai.sh # Main CLI wrapper
βββ lib/
β βββ generate-image.py # Image generation
β βββ upload-drive.py # Google Drive upload
β βββ balance.py # Balance/usage tracking
β βββ state_manager.py # Task state tracking
β βββ watch_task.py # Task polling
βββ config.json # Configuration (Drive, etc.)
βββ SKILL.md # OpenClaw skill documentation
βββ README.md # This file
Set environment variable:
export KIE_API_KEY="your-key-here"Or add to shell profile (~/.zshrc, ~/.bashrc):
echo 'export KIE_API_KEY="your-key-here"' >> ~/.zshrc
source ~/.zshrcTop up at: https://kie.ai/billing
- Ensure
MATON_API_KEYis set - Create Google Drive connection at https://ctrl.maton.ai
- Verify folder ID in
config.json
- kie.ai Dashboard: https://kie.ai
- Documentation: https://docs.kie.ai
- Logs/Balance: https://kie.ai/logs
- Billing: https://kie.ai/billing
- Maton (Drive): https://maton.ai
MIT License - see LICENSE file
Issues and PRs welcome at https://github.com/jon-xo/kie-ai-skill