当前位置: 首页 > Skill >

Kie Ai Skill

Kie Ai Skill

Kie Ai Skill

通过 kie.ai 统一接入多种 AI 模型,提供图像生成功能(Nano Banana Pro、Flux、4o-image),成本较官方 API 低 30-80%。

1.0.1 2026.11.13 492
获取Skill文件查看使用说明
作 者:顾辰 许可证: 更新时间:2026.11.13
本文目录展开

kie.ai API Wrapper

Unified access to multiple AI models through kie.ai's API. Generate images, videos, and music at 30-80% lower cost than official APIs.

Features

  • 🎨 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

Quick Start

# 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

Installation

Prerequisites

  1. kie.ai API Key:

    • Sign up at https://kie.ai
    • Get API key from dashboard
    • Add to ~/.openclaw/openclaw.json:
      "env": {
        "vars": {
          "KIE_API_KEY": "your-key-here"
        }
      }
      
  2. (Optional) Maton API Key for Google Drive uploads:

    • Sign up at https://maton.ai
    • Get API key from https://maton.ai/settings
    • Set up Google Drive connection at https://ctrl.maton.ai
    • Add to config:
      "MATON_API_KEY": "your-maton-key"
      

Setup

# Clone to ~/src
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

# Create symlink for OpenClaw
ln -s ~/src/kie-ai-skill ~/.openclaw/workspace/skills/kie-ai-skill

# Test it
./kie-ai.sh generate-image "test image"

Configuration

Google Drive Upload (Optional)

# View/edit config
./kie-ai.sh config

# Edit config.json
{
  "drive": {
    "enabled": true,
    "folder_id": "YOUR_GOOGLE_DRIVE_FOLDER_ID"
  }
}

Get your folder ID from the Google Drive URL:

https://drive.google.com/drive/folders/1abc...xyz
                                          ^^^^ this part

Commands

generate-image

Generate images with various models.

./kie-ai.sh generate-image <prompt> [options]

Options:
  --model <name>         Model: nano-banana-pro (default), google/nano-banana, flux-kontext, 4o-image
  --resolution <res>     Resolution: 1K (default), 2K, 4K
  --aspect <ratio>       Aspect ratio: 1:1 (default), 16:9, 9:16, 4:3, etc.
  --upload-drive         Upload to Google Drive after generation (requires config)

Examples:

# Basic generation
./kie-ai.sh generate-image "A red apple on a wooden table"

# High resolution
./kie-ai.sh generate-image "Mountain landscape" --resolution 4K

# Widescreen
./kie-ai.sh generate-image "Cinematic scene" --resolution 2K --aspect 16:9

# 16-bit pixel art
./kie-ai.sh generate-image "Cyberpunk lobster, 16-bit pixel art, no text" --aspect 16:9

# Generate and upload
./kie-ai.sh generate-image "Abstract art" --upload-drive

balance

Check credit usage and remaining balance.

./kie-ai.sh balance

Shows:

  • Link to web UI for actual balance
  • Local task history
  • Estimated credit consumption
  • USD equivalent

status

Show active/pending tasks.

./kie-ai.sh status

models

List available models and pricing.

./kie-ai.sh models

config

View/configure Google Drive upload settings.

./kie-ai.sh config

Pricing

Approximate costs (kie.ai vs official):

Model kie.ai Official Savings
Nano Banana Pro ~18-24 credits ($0.09-$0.12) $0.15 20-40%
Veo 3.1 Variable N/A —
Flux Kontext ~50 credits ($0.25) $0.30 ~17%
Suno V4 Variable $0.10/track Comparable

Credit pricing: ~$0.005 per credit (1,000 credits = $5)

Check exact costs at: https://docs.kie.ai/pricing

File Storage

Generated files are saved to the images/ directory (gitignored):

~/src/kie-ai-skill/images/
  2026-02-11-12-05-01-1.png
  2026-02-11-12-09-56-1.png
  ...

Format: YYYY-MM-DD-HH-MM-SS-{index}.png

Retention:

  • Local: Forever (or until you delete)
  • kie.ai CDN: 14 days
  • Google Drive: Forever (if uploaded)

Task State

Tasks are tracked in:

~/src/kie-ai-skill/.task-state.json

Used for:

  • Resume interrupted tasks
  • Usage tracking
  • Preventing duplicate submissions

Available Models

Image Generation

  • nano-banana-pro - Gemini 3 Pro Image (1K/2K/4K)
  • google/nano-banana - Gemini 2.5 Flash Image (cheaper)
  • flux-kontext - Flux by Black Forest Labs
  • 4o-image - OpenAI GPT-4o Image

Video Generation (coming soon)

  • veo-3.1 - Google Veo 3.1 (cinematic)
  • veo-3.1-fast - Veo 3.1 Fast (cheaper)
  • runway-aleph - Runway Gen-4 Aleph

Music Generation (coming soon)

  • suno-v4 - Suno V4 (up to 8min)
  • suno-v4.5 - Suno V4.5 Plus

See https://docs.kie.ai for full list.

Troubleshooting

"KIE_API_KEY not set"

Add to ~/.openclaw/openclaw.json:

"env": {
  "vars": {
    "KIE_API_KEY": "your-key-here"
  }
}

"Credits insufficient"

Top up at: https://kie.ai/billing

"MATON_API_KEY not set" (Drive upload)

  1. Sign up at https://maton.ai
  2. Add MATON_API_KEY to openclaw.json
  3. Create Google Drive connection at https://ctrl.maton.ai

"Drive upload failed"

  1. Check MATON_API_KEY is set
  2. Verify Google Drive connection is active at https://ctrl.maton.ai
  3. Ensure folder_id in config.json is correct
  4. Try generating without --upload-drive first

Integration with OpenClaw

Use via exec or directly in OpenClaw agent conversations:

# From OpenClaw chat
Generate a cyberpunk city image with kie.ai

# The agent will run:
cd ~/src/kie-ai-skill && ./kie-ai.sh generate-image "cyberpunk city"

Security

Environment Variables

Variable Required Purpose
KIE_API_KEY Yes Authenticates all requests to api.kie.ai
MATON_API_KEY No Authenticates Google Drive uploads via gateway.maton.ai

External Endpoints

Endpoint Method Data Sent Used By
https://api.kie.ai/api/v1/jobs/createTask POST prompt, model, resolution, aspect ratio generate-image.py
https://api.kie.ai/api/v1/jobs/recordInfo GET task ID generate-image.py, watch_task.py
https://api.kie.ai/api/v1/chat/credit GET — (auth header only) balance.py
https://gateway.maton.ai/google-drive/upload/... POST image file bytes, filename upload-drive.py (optional)

Data Leaving This Machine

  • Prompt text is sent to api.kie.ai to generate images.
  • Generated image files are sent to gateway.maton.ai only when --upload-drive is explicitly passed.
  • API keys are transmitted as Authorization: Bearer headers and are never logged or written to disk by this skill.
  • No telemetry, analytics, or usage data is collected by this skill itself.

Trust Statement

This skill sends data to two third-party services: kie.ai for AI generation and maton.ai as an OAuth gateway for Google Drive. Review their respective privacy policies before use. Drive upload is strictly opt-in via --upload-drive.

Autonomous Invocation

This skill can be invoked autonomously by an OpenClaw agent when asked to generate images. It does not execute autonomously on its own — it must be called explicitly. To prevent autonomous invocation, remove the skill symlink from your OpenClaw workspace.

Links

  • kie.ai Dashboard: https://kie.ai
  • Documentation: https://docs.kie.ai
  • Pricing: https://docs.kie.ai/pricing
  • Logs/Balance: https://kie.ai/logs
  • Billing: https://kie.ai/billing
  • Maton (for Drive): https://maton.ai
  • GitHub Repo: https://github.com/jon-xo/kie-ai-skill

License

MIT

Support

Issues: https://github.com/jon-xo/kie-ai-skill/issues

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • kie.ai API Wrapper
    • Features
    • Quick Start
    • Installation
      • Prerequisites
      • Setup
    • Configuration
      • Google Drive Upload (Optional)
    • Commands
      • generate-image
      • balance
      • status
      • models
      • config
    • Pricing
    • File Storage
    • Task State
    • Available Models
      • Image Generation
      • Video Generation (coming soon)
      • Music Generation (coming soon)
    • Troubleshooting
      • "KIE_API_KEY not set"
      • "Credits insufficient"
      • "MATON_API_KEY not set" (Drive upload)
      • "Drive upload failed"
    • Integration with OpenClaw
    • Security
      • Environment Variables
      • External Endpoints
      • Data Leaving This Machine
      • Trust Statement
      • Autonomous Invocation
    • Links
    • License
    • Support
  • 项目或源文件

相关 Skill

更多
nano-banana-pro-openrouter nano-banana-pro-openrouter 使用 Nano Banana Pro(Gemini 3 Pro Image)通过 OpenRouter 生成/编辑图像,适用于图像创建、修改及编辑请求,支持文本生成图像和图像生成图像。
Nano Banana Image Creator Nano Banana Image Creator 使用 Nano Banana Pro API 通过文本提示词生成或编辑图片,支持从草稿到最终分辨率 1K/2K/4K,以及输入图片编辑。
Nano Banana Pro via cheaper grsai.com Nano Banana Pro via cheaper grsai.com 通过 grsai.com API 使用 Nano Banana Pro 生成/编辑图像,适用于图片创建和修改请求,支持文字到图像、图像到图像,可输出 1K/2K 等分辨率。
Poster Maker Poster Maker AI海报大师,提供风格复刻、创意生成、直播预告三种模式,含原图还原方法及生成脚本,支持Nano Banana Pro与Ofox/OpenRouter。
infographics infographics 使用 Nano Banana Pro AI 配合智能迭代精炼创建专业信息图。使用 Gemini 3 Pro 进行质量评审,集成 research-lookup