PiAPI CLI Quick Start: สร้าง AI images และ videos จาก terminal

PiAPI CLI terminal workflow สำหรับ multimodal AI generation
PiAPI
PiAPI

PiAPI CLI คือ command line interface อย่างเป็นทางการของ PiAPI ใช้เรียก multimodal AI models สำหรับรูปภาพ วิดีโอ เสียง 3D และ LLM ได้โดยตรงจาก terminal

Quick start นี้ครอบคลุมการติดตั้ง การยืนยันตัวตนด้วย API key การสร้างรูปภาพแรก การเริ่ม async video task และการดู models ที่ใช้งานได้

PiAPI CLI คืออะไร?

คำอธิบายสั้น

PiAPI CLI คือเครื่องมือ command line บน Node.js สำหรับเรียกใช้ PiAPI models โดยไม่ต้องเปิด web dashboard

AI CLI มีประโยชน์เมื่อ workflow เริ่มจาก terminal: คุณบันทึก command, รันซ้ำ, เปลี่ยน parameters และนำไปใช้ใน scripts หรือ AI agents ได้

  • สร้าง assets จาก prompts ที่รันซ้ำได้
  • ทดสอบเร็วระหว่างสร้าง app หรือ prototype
  • Upload local files จากโฟลเดอร์โปรเจกต์
  • บันทึก outputs ในโฟลเดอร์ที่กำหนดได้
  • ส่งคืน JSON ให้ scripts, CI หรือ agents

PiAPI CLI แบบย่อ

Packagepiapi-cli
Commandpiapi
RuntimeNode.js 18+
Use case หลักTerminal-based multimodal AI generation
เหมาะสำหรับDevelopers, automation workflows และ AI agents

สิ่งที่ต้องมี

  • Node.js 18 หรือใหม่กว่า
  • PiAPI API key
  • Terminal app

ติดตั้ง PiAPI CLI

ติดตั้ง package piapi-cli ด้วย JavaScript package manager ที่คุณใช้

Terminal
npm install -g piapi-cli
Terminal
pnpm add -g piapi-cli
Terminal
bun add -g piapi-cli
Terminal
yarn global add piapi-cli
Terminal
npx piapi-cli@latest --help

ยืนยันตัวตนด้วย PiAPI API key

หลังติดตั้ง ให้เชื่อม CLI กับบัญชี PiAPI ของคุณ

Terminal
piapi auth login --api-key sk-xxxxx
Terminal
piapi auth status
Terminal
export PIAPI_API_KEY=sk-...

สร้าง AI image แรกจาก terminal

หลังยืนยันตัวตนแล้ว คุณสร้าง AI image จาก terminal ได้ด้วย piapi run

Terminal
piapi run flux-dev prompt="a corgi in space"
Terminal
piapi run gpt-image-2 prompt="a corgi in space" size=1024x1024

Flux API

สร้าง AI video แรกจาก terminal

การสร้างวิดีโอมักใช้เวลานานกว่ารูปภาพ จึงควรเริ่ม video models เป็น async task

Terminal
piapi run sora2-pro prompt="ocean waves" --async
Terminal
piapi task get <id>

Sora 2 API / Kling API

Upload local files และ download results

PiAPI CLI สามารถ upload local files เมื่อ input value ขึ้นต้นด้วย @ แล้ว download results ไปยังโฟลเดอร์ที่เลือก

Terminal
piapi run remove-bg image=@./photo.png --download --out-dir ./out

ดู models และตรวจ quota

ใช้ model commands เพื่อดู models, schema และ quota

Terminal
piapi model list
Terminal
piapi model list --type video
Terminal
piapi model schema flux-dev
Terminal
piapi quota

PiAPI CLI flags ที่มีประโยชน์

Flags ที่มีประโยชน์สำหรับ automation:

--asyncCLI workflow option
--downloadCLI workflow option
--out-dir <path>CLI workflow option
--streamCLI workflow option
--dry-runCLI workflow option
--output jsonJSON output for scripts and automation
--webhook <url>CLI workflow option
--quietCLI workflow option
--non-interactiveCLI workflow option

ใช้ PiAPI CLI กับ AI agents และ automation

PiAPI CLI ใช้ได้ใน AI agents, shell scripts, CI jobs และ automation workflows

Terminal
npx skills add PiAPI-1/piapi-cli
Terminal
piapi run flux-dev prompt="a product photo on a white background" --output json

Midjourney n8n integration guide

แก้ปัญหา PiAPI CLI ที่พบบ่อย

ถ้า command แรกไม่ทำงาน ให้ตรวจปัญหาทั่วไปเหล่านี้ก่อนเปลี่ยน prompt หรือ model

ไม่พบ command piapi

npx piapi-cli@latest --help

API key ไม่ถูกต้องหรือไม่มี

piapi auth status

Video command ส่งคืน task ID แทน file

piapi task get <id>

ควรใช้ PiAPI CLI แทน Web UI เมื่อไร?

ใช้ PiAPI CLI เมื่อคุณต้องการ workflow ที่รันซ้ำได้ ทำเป็น script ได้ หรือส่งต่อให้ AI agent ได้ Web UI เหมาะกับการสำรวจแบบ visual; CLI เหมาะกับ automation

FAQ

PiAPI CLI คืออะไร?

PiAPI CLI คือเครื่องมือ command line บน Node.js สำหรับเรียกใช้ PiAPI models โดยไม่ต้องเปิด web dashboard

ติดตั้ง PiAPI CLI อย่างไร?

npm install -g piapi-cli / npx piapi-cli@latest --help

สร้าง AI images และ videos จาก terminal ได้ไหม?

piapi run flux-dev prompt="a corgi in space" / piapi run sora2-pro prompt="ocean waves" --async

เริ่มสร้างด้วย PiAPI CLI

PiAPI CLI ช่วยให้ developers และ AI agents สร้างรูปภาพ วิดีโอ เสียง 3D assets และ LLM responses จาก command line ได้อย่าง practical

PiAPI CLI PiAPI docs

More Stories

Why Your AI Face Rating Changes: Photo Tips for More Consistent Face Scores

June 5, 2026

AI face ratings can change based on lighting, camera angle, expression, filters, blur, and face visibility. Learn the best selfie tips for more consistent AI face scores.

PiAPI
PiAPI

AI Face Rating Explained: What Face Scores and PSL Ratings Mean

June 4, 2026

Learn what AI face rating means, how PSL face scores became a social-media trend, what face rating AI tools measure, and how to interpret scores safely.

PiAPI
PiAPI