kie-ai/SKILL.md
Execution skill สำหรับ Kie.ai API (Grok Imagine ผ่าน kie.ai proxy) — รับ prompt จาก /art-tech-engineer แล้ว gen ภาพ/วีดีโอผ่าน Kie.ai REST API รองรับ text-to-image, image-to-image, image-to-video, และ upscale ใช้เมื่อถูกระบุให้ใช้ Kie.ai โดยตรง หรือเมื่อ orchestrator delegate มา
npx skillsauth add thepexcel/agent-skills kie-aiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Gen image/video ผ่าน Kie.ai REST API — proxy สำหรับ Grok Imagine models
OUT = D:/ClaudeMediaGen/output-fal # ใช้ร่วมกับ fal output
BASE = https://api.kie.ai/api/v1/jobs
| Var | ที่อยู่ | วิธีอ่าน |
|-----|--------|---------|
| KIE_API_KEY | Windows User Env | os.environ["KIE_API_KEY"] (set via setx หรือ [Environment]::SetEnvironmentVariable) |
| Model ID | Type | Best For | Output |
|----------|------|----------|--------|
| grok-imagine/text-to-image | text2img | Aesthetic/cinematic images, Thai prompt ได้ดี | 3 รูป/request |
| grok-imagine/image-to-image | img2img | แก้ไข/ปรับ style จากรูปต้นแบบ | TBD |
| grok-imagine/image-to-video | img2vid | สร้างวีดีโอจากรูปนิ่ง | TBD |
| grok-imagine/upscale | upscale | เพิ่ม resolution วีดีโอ | TBD |
| veo3_fast | video | Video fast, รองรับ i2v (REFERENCE_2_VIDEO) | video + audio |
| veo3_quality | video | Video quality สูงสุด | video + audio |
| veo3_lite | video | Video ประหยัดสุด | video + audio |
หมายเหตุ: text-to-image + veo3_fast ทดสอบแล้ว ใช้งานได้จริง / model อื่นๆ มีใน docs แต่ยังไม่ได้ทดสอบ Veo3 ใช้คนละ endpoint — ดู section "Veo3 Video Generation" และ "API Endpoints Summary" ด้านล่าง
| Value | ใช้เมื่อ |
|-------|---------|
| 2:3 | Portrait (default สำหรับรูปคน) |
| 3:2 | Landscape |
| 1:1 | Square |
| 16:9 | Wide cinematic |
| 9:16 | Story/Reels format |
POST {BASE}/createTask
Authorization: Bearer <KIE_API_KEY>
Content-Type: application/json
Body:
{
"model": "grok-imagine/text-to-image",
"input": {
"prompt": "...",
"aspect_ratio": "2:3"
}
}
Response: { "code": 200, "data": { "taskId": "..." } }
code == 200 ก่อน ถ้าไม่ใช่ = errortaskId ไว้ pollGET {BASE}/recordInfo?taskId=<taskId>
Authorization: Bearer <KIE_API_KEY>
Task States:
| State | ความหมาย | Action |
|-------|---------|--------|
| waiting | อยู่ในคิว | รอต่อ |
| queuing | อยู่ในคิว | รอต่อ |
| generating | กำลัง gen | รอต่อ |
| success | เสร็จแล้ว | ดึง URL |
| fail | ล้มเหลว | อ่าน failMsg + failCode |
Poll strategy: ทุก 5 วินาที, timeout 5 นาที (60 รอบ)
เมื่อ success:
data.resultJson เป็น JSON string → ต้อง parse อีกรอบresultUrls: [url1, url2, url3] — ได้ 3 รูปต่อ 1 requestสำคัญ: URL ต้องใส่ headers พิเศษ ไม่งั้นจะโดน block
Headers สำหรับ download:
User-Agent: Mozilla/5.0
Referer: https://kie.ai/
Naming convention:
kie_grok_{taskId_last8}_{index}.jpg
Output directory: D:/ClaudeMediaGen/output-fal/
Grok prompt syntax rules have moved to the shared model-card. See grok-image.md for:
- Hybrid prompt strategy (English + Thai)
- Forbidden words
- Subject short / Scene long rule
- ห้ามบอก body size
os.environ["KIE_API_KEY"] (Windows User Env — set ครั้งเดียวทั่วเครื่อง)/createTask → เก็บ taskId/recordInfo?taskId= → วน loop ทุก 5s จนได้ success หรือ faildata.resultJson เป็น string → json.loads() → resultUrlsUser-Agent + Referer headers → save เป็น .jpgrun_in_background: true สำหรับ parallel gen ใน Claude Codecode != 200 จาก createTask → แสดง error ทั้ง responsestate == "fail" → อ่าน data.failMsg + data.failCodeใช้ upload ไฟล์ (เช่น รูปสำหรับ image-to-video) ก่อนส่ง gen
POST https://kieai.redpandaai.co/api/file-stream-upload
Authorization: Bearer <KIE_API_KEY>
Content-Type: multipart/form-data
Parameters:
file: (binary)
uploadPath: (string)
fileName: (string)
Response:
{
"success": true,
"data": {
"downloadUrl": "https://tempfile.redpandaai.co/..."
}
}
หมายเหตุ:
Veo3 ใช้คนละ endpoint กับ Market API (Grok Imagine) — ทั้ง generate และ poll
POST https://api.kie.ai/api/v1/veo/generate
Authorization: Bearer <KIE_API_KEY>
Content-Type: application/json
Body:
{
"prompt": "...",
"imageUrls": ["https://uploaded-url"],
"model": "veo3_fast",
"generationType": "REFERENCE_2_VIDEO",
"aspect_ratio": "9:16"
}
| Parameter | ค่า | หมายเหตุ |
|-----------|-----|---------|
| model | veo3_fast, veo3_quality, veo3_lite | fast รองรับ i2v |
| generationType | TEXT_2_VIDEO, REFERENCE_2_VIDEO | REFERENCE_2_VIDEO ใช้ได้เฉพาะ veo3_fast |
| aspect_ratio | 16:9, 9:16, Auto | — |
| imageUrls | array of URLs | ต้อง upload ก่อนผ่าน file-stream-upload |
Optional: enableTranslation, enableFallback, watermark, callBackUrl, seeds
GET https://api.kie.ai/api/v1/veo/record-info?taskId=<taskId>
Authorization: Bearer <KIE_API_KEY>
| Field | ค่า | ความหมาย |
|-------|-----|---------|
| successFlag | 0 | กำลัง generate |
| successFlag | 1 | สำเร็จ |
| successFlag | 2 | ล้มเหลว |
| successFlag | 3 | ล้มเหลว |
data.response.resultUrls[]hasAudioList: [true])1. Upload image → POST file-stream-upload → ได้ downloadUrl
2. Generate → POST /veo/generate (ใส่ downloadUrl ใน imageUrls) → ได้ taskId
3. Poll → GET /veo/record-info?taskId= → วน loop จน successFlag != 0
4. Download → ดึง video จาก resultUrls[]
| Feature | Market API (Grok Imagine) | Veo3 API |
|---------|--------------------------|----------|
| Create task | POST /api/v1/jobs/createTask | POST /api/v1/veo/generate |
| Poll status | GET /api/v1/jobs/recordInfo | GET /api/v1/veo/record-info |
| File upload | POST kieai.redpandaai.co/api/file-stream-upload | (same) |
| Base URL | https://api.kie.ai | https://api.kie.ai |
/art-engine - upstream: model selection and prompt syntax translation/fal-ai - alternative execution path for Grok (same model, different API - fal.ai direct vs Kie.ai proxy)/art-director - upstream: creative brief crafting/sira-image-prefer - taste DNA for prompt preferencesdata-ai
Shift years in training data files (CSV + XLSX) by +N years — both filenames and content. Supports `--dry-run` for safe preview before destructive run. Use when updating training data for a new year, "เลื่อนปี", "shift year", "update year in training data", "เปลี่ยนปีใน data", or when preparing Power BI / Excel training files for next year's course.
development
--- name: deep-research status: archived replaced_by: deep-research deprecation_reason: superseded deprecated_date: 2026-04-20 description: Fast research that beats plain websearch — discovers what exists before searching specifics (Landscape Scan), catches recent releases within days/weeks (Recency Pulse + upstream supply chain), and runs parallel queries for multi-angle coverage. Good for everyday research and current-info questions. Supports optional `--ingest` flag to flow findings into the
content-media
Universal media gallery — browse images/videos from any local folder with copy-path, enlarge, and video playback. Reusable across all gen projects.
data-ai
Explains difficult concepts using master teaching methodologies (Feynman, Socratic, Cognitive Load, Dual Coding). Use when user asks to explain a concept, "I don't understand X", ELI5 requests, "what is X", "how does X work".