# https://piapi.ai llms-full.txt ## Generative AI APIs # Leverage ourAI APIsfor your AI application developments! Integrate our generative AI APIs and transform text into captivating visuals, images to realistic videos, prompts into impressive music, and more! [Trellis 3D Gen](https://piapi.ai/trellis-3d-api) [Luma Dream Machine](https://piapi.ai/dream-machine-api) [Faceswap AI](https://piapi.ai/faceswap-api) [Flux Image Gen](https://piapi.ai/flux-api) [Kling Video Gen](https://piapi.ai/kling-api) [DeepSeek LLM](https://piapi.ai/deepseek) [Udio Music Gen](https://piapi.ai/docs/music-api/create-task) [Hailuo Video Gen](https://piapi.ai/hailuo) ## Ignite your generative AI applications and workflows! Ace-step API Embrace the Future of Music with Ace-step API Generate astounding music from any prompt. Our Ace-step API propels your applications into a future with limitless creative possibilities. ```python payload = json.dumps({ "custom_mode": False, "input": { "style_prompt": "guitar and piano", "prompt": "[verse] Sunshine on the boulevard the beach is calling loud Waves are dancing golden sand under a cotton cloud Electric heartbeat pounding fast the tide is on our side Catch a wave and feel alive we’ll take it for a ride", } }) headers = { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` Faceswap API Bridge the gap between reality and unique visuals with our FaceSwap API Our FaceSwap API allows seamless integration of face-swapping functionalities — offering unlimited possibilities for photo editing, augmented reality applications, gaming and more. ![An illustration of Leonardo Dicaprio's face swapped with Justin Bieber's face](https://piapi.ai/images/homepage/original_leonardo_dicaprio.webp) Ace-step API Embrace the Future of Music with Ace-step API Generate astounding music from any prompt. Our Ace-step API propels your applications into a future with limitless creative possibilities. ```python payload = json.dumps({ "custom_mode": False, "input": { "style_prompt": "guitar and piano", "prompt": "[verse] Sunshine on the boulevard the beach is calling loud Waves are dancing golden sand under a cotton cloud Electric heartbeat pounding fast the tide is on our side Catch a wave and feel alive we’ll take it for a ride", } }) headers = { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` Faceswap API Bridge the gap between reality and unique visuals with our FaceSwap API Our FaceSwap API allows seamless integration of face-swapping functionalities — offering unlimited possibilities for photo editing, augmented reality applications, gaming and more. ![An illustration of Leonardo Dicaprio's face swapped with Justin Bieber's face](https://piapi.ai/images/homepage/original_leonardo_dicaprio.webp) Dream Machine API (unofficial) Seamlessly Generate Videos from Text/Image input with Dream Machine API! Enhance your applications with the ability to generate dynamic videos from simple text or image inputs, allowing your users to create video contents easily using Dream Machine API ![A video of a futuristic ship generated by PiAPI's Dream Machine API](https://piapi.ai/images/homepage/Dream-Machine-Homepage-image.webp) A futuristic fighter jet with a sleek yet tough armor soaring through the clouds, with a scene of an alien pilot in a futuristic suit, expressing a cautious face Ace-step API Embrace the Future of Music with Ace-step API Generate astounding music from any prompt. Our Ace-step API propels your applications into a future with limitless creative possibilities. ```python payload = json.dumps({ "custom_mode": False, "input": { "style_prompt": "guitar and piano", "prompt": "[verse] Sunshine on the boulevard the beach is calling loud Waves are dancing golden sand under a cotton cloud Electric heartbeat pounding fast the tide is on our side Catch a wave and feel alive we’ll take it for a ride", } }) headers = { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ## Our Generative AI APIs [Ace-step API](https://piapi.ai/ace-step) Text-to-Music Convert texts into stunning music with our Ace-step API. [Faceswap API](https://piapi.ai/faceswap-api) Faceswap Easily swap faces from one image onto another. ## Designed for developers Our API is compatible with all technology stacks, offers fast setup upprocess, and requires no prior AI experience! Check out our [documentations](https://piapi.ai/docs), and start integrating our state-of-the-art APIs into your application in just a few clicks! Python ```python 1 2 import requests 3 4 endpoint = 'YOUR_ENDPOINT_URL' 5 headers = { 6 'X-API-Key': 'YOUR_API_KEY', 7 } 8 9 data = { 10 "prompt": "a cute cat", 11 "aspect_ratio": "4:3", 12 "process_mode": "fast", 13 "webhook_endpoint": "", 14 "webhook_secret": "" 15 } 16 17 response = requests.post(endpoint, headers=headers, json=data) 18 19 print(response.status_code) 20 print(response.json()) 21 ``` Easy Integration Built for smooth and fast integration. Get started on your journey to easy-free integration in just a few clicks / lines of code. Consistent Results Regardless of image, music or faceswap generation, Our APIs are designed to produce high-quality results for your applications and user needs. Hassle-free Convenience As easy as turning on a switch, our API quickly enables comprehensive features, bringing convenience and ease to your workflow. Rapid Scalability "With our [cost-effective price offering](https://piapi.ai/pricing), you can improve your load-response at your own pace with flexible payment options. Our enterprise-level API is geared to scale according to your growth trajectory.", ## Our Team Who are we? At the intersection of tech and creativity, we are a group of dedicated tech aficionados who believe in the transformative power of AI. Why us? We are driven by our passion for simplifying AI and making it accessible to developers around the globe! What do we do? We provide developers with API access to generative AI models including , and FaceSwap API, helping to develop scalable and innovative applications! ## Let’s talk Have a question or require support? Feel free to contact us! Official Support Channel Contact us via Discord and join our channel for fast support and assistance! [Join our Discord!](https://discord.gg/qRRvcGa7Wb) Try Telegram Reach out to us on Telegram, we'd love to hear from you. It's easier and faster! Telegram (coming soon) Want to collaborate? Looking for collaborative opportunities? We are too! Email us at support@piapi.ai! (Note: all support emails will not be answered!) [Email us!](mailto:support@piapi.ai) ## PiAPI API Documentation ``` # PiAPI ## Docs - Get Started [PiAPI Documentation - the technical doc for APIs provided by PiAPI!PiAPI Documentation - the technical doc for APIs provided by PiAPI!](https://piapi.ai/docs/overview.md): An introduction to PiAPI's documentation, the key features (including Unified API, and Webhooks), and the list of available APIs include, Flux, Kling, Dream Machine, LLM, etc. - Get Started [Quick Start - PiAPI docs](https://piapi.ai/docs/quickstart.md): Getting started quickly with PiAPI, generate your API Key, set base url, and make your first API call! - Get Started [PiAPI/Make Instruction of Flux API](https://piapi.ai/docs/piapi-make/make-insturcution.md): Recently, to help more content creators easily use PiAPI for their projects, Flux by PiAPI has officially launched on the Make platform! - [Endpoints](https://piapi.ai/docs/endpoints.md): - Endpoints > Song(Udio) [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples.md): - Endpoints > Song(Udio) [[Udio] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend.md): - Endpoints > Kling [Lipsync With PiAPI Kling API](https://piapi.ai/docs/kling-api/lipsync-examples.md): - Endpoints > Kling [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples.md): - Endpoints > Kling [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements.md): - Endpoints > Kling [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects.md): - Endpoints > Hailuo [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode.md): - Endpoints > Flux [Flux with LoRA and ControlNet - PiAPI docs](https://piapi.ai/docs/flux-with-lora-and-controlnet.md): How to use LoRA and ControlNet models with Flux? Check out this PiAPI docs for more! - Endpoints > Flux [Available LoRA and ControlNet - PiAPI docs ](https://piapi.ai/docs/available-lora-and-controlnet.md): This page has a list of all available LoRA and ControlNet models compatible with the Flux API. - Endpoints > Flux [Flux API with Redux and Fill](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint.md): - Endpoints > LLM [PiAPI/Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case.md): This article explores the model's image-generation capabilities through practical use cases, demonstrating its potential to transform creative artworks. - Endpoints > LLM [PiAPI/How to Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout.md): PiAPI/How To Avoid Timeouts in Completion API - Endpoints > LLM [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api.md): - Endpoints > WanX [PiAPI/WanX&LoRA Tutorial](https://piapi.ai/docs/wanx_lora/tutorial.md): To help users optimize WanX task creation, we've provided practical examples demonstrating how to construct proper API calls for better information reference. - Endpoints > WanX [PiAPI/Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type.md): We have updated various LoRA models for Wanx available for PiAPI users. - Endpoints > WanX [PiAPI/Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case.md): In this article, we will introduce PiAPI's LoRA use cases for Wanx, providing API call references. - Endpoints > WanX [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control.md): - Endpoints > Hunyuan Video [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc.md): - Endpoints > Tools [File Upload API](https://piapi.ai/docs/tools/file-upload.md): - Resources [Change Log - PiAPI docs](https://piapi.ai/docs/changelog.md): The Change Log of PiAPI's API service, read about the latest updates and fixes on here! - Resources [Output Storage - PiAPI docs](https://piapi.ai/docs/output-storage.md): The output storage policy of PiAPI's API service, read about the how long we will store the outputs for. - Resources [Unified API schema - PiAPI docs](https://piapi.ai/docs/unified-api-schema.md): The Unified API schema of PiAPI - allows users to call all of our AI Model with just two endpoints. - Resources [Unified Webhook - PiAPI docs](https://piapi.ai/docs/unified-webhook.md): The Unified Webhook of PiAPI - allows users to receive timely task updates and notifications - Resources [Bulk Generation - PiAPI docs](https://piapi.ai/docs/bulk-generation.md): Bulk Generation Services offered by PiAPI - perfect for generating a large amount of out using Luma Dream Machine, Kling and/or Flux, - Resources [Billings - PiAPI docs](https://piapi.ai/docs/billings.md): PiAPI's billing info - learn how to choose usage modes and sucscription plans that suit you best. - Resources [PiAPI MCP Server](https://piapi.ai/docs/mcp-server.md): How to use PiAPI MCP server in your LLM mcp client - Resources > Workspace Manual [Host-your-account using back-up account](https://piapi.ai/docs/hya-backup-account.md): Using back up account to increase service reliability - Resources > Workspace Manual [Host-your-account Debug Checklist](https://piapi.ai/docs/hya-debug-checklist.md): This checklist helps users to debug potential issues when connecting their accounts to their HYA seats. - Resources > Workspace Manual [Host-your-account Status of your Connected Accounts](https://piapi.ai/docs/hya-connected-account-status.md): This page is used to debug the different status of your hosted account. - Resources > Announcements [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update.md): ## API Docs - Endpoints > Song(Udio) [Create Task](https://piapi.ai/docs/music-api/create-task.md): :::info - Endpoints > Song(Udio) [[Udio] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics.md): Uses Udio to synthesize lyrics. - Endpoints > Kling > Cancel Task [Cancel Multiple Tasks - Kling API - PiAPI docs](https://piapi.ai/docs/kling-api/cancel-tasks.md): The Cancel Multiple Tasks Endpoint of Kling API from PiAPI - Endpoints > Kling > Cancel Task [Cancel Single Task - Kling API - PiAPI docs](https://piapi.ai/docs/kling-api/cancel-task.md): The Cancel Single Task Endpoint of Kling API from PiAPI - Endpoints > Kling [Get Task - Kling API - PiAPI docs](https://piapi.ai/docs/kling-api/get-task.md): The Get Task Endpoint of Kling API from PiAPI - Endpoints > Kling [Create Task - Kling API - PiAPI docs](https://piapi.ai/docs/kling-api/create-task.md): The Create Task Endpoint of Kling API from PiAPI - Endpoints > Kling [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api.md): This is the api for Kling's Virtual Try On, $0.07 for each output image for PAYG. You can also use this endpoint in HYA mode. - Endpoints > Kling [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api.md): This is the api for Kling's Effects, $0.26(std mode)/$0.46(pro mode) for each output video for for PAYG. - Endpoints > Kling [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api.md): This is the api for Kling's Sound, $0.07 for each generation(4 outputs) for PPU. - Endpoints > Hailuo [Hailuo API Generate Video - PiAPI](https://piapi.ai/docs/hailuo-api/generate-video.md): Hailuo API Generate Video - PiAPI - Endpoints > Hailuo [PiAPI/Hailuo API-Get Task](https://piapi.ai/docs/hailuo-api/get-task.md): This endpoint from PiAPI's Hailuo API retrieves the output of the Hailuo task. - Endpoints > Flux > Create Task [Create text-to-image task - Flux API - PiAPI docs](https://piapi.ai/docs/flux-api/text-to-image.md): The Create text-to-image endpoint of the Flux API - Endpoints > Flux > Create Task [Create image-to-image task - Flux API - PiAPI docs](https://piapi.ai/docs/flux-api/image-to-image.md): The Create image-to-image endpoint of the Flux API - Endpoints > Flux > Create Task [Create kontext task - Flux API - PiAPI docs](https://piapi.ai/docs/flux-api/kontext.md): The Create kontext endpoint of the Flux API - Endpoints > Flux [Get Task - Flux API - PiAPI docs](https://piapi.ai/docs/flux-api/get-task.md): The Get Task endpoint of the Flux API - Endpoints > AI Hug [Get task - AI Hug API - PiAPI docs](https://piapi.ai/docs/ai-hug-api/get-task.md): The Get Task endpoint of the AI Hug API - Endpoints > AI Hug [AI HUG API Create Task - PiAPI](https://piapi.ai/docs/ai-hug-api/create-task.md): AI HUG API Create Task - PiAPI - Endpoints > LLM [Completions - LLM API - PiAPI docs](https://piapi.ai/docs/llm-api/completions.md): The Completion Endpoint of LLM API from PiAPI - Endpoints > LLM [PiAPI/Get Task](https://piapi.ai/docs/llm-get-task.md): - Endpoints > Faceswap [PiAPI/Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task.md): This async endpoint from swaps the face from the swap_image to the target_image. - Endpoints > Faceswap [Create Task - Faceswap API - PiAPI docs](https://piapi.ai/docs/faceswap-api/create-task.md): The Create Task Endpoint of Faceswap API from PiAPI - Endpoints > Faceswap [Video Faceswap API](https://piapi.ai/docs/faceswap-api/video-faceswap.md): PiAPI's Video Face Swap service enables face replacement in videos using advanced facial recognition and swapping technology. - Endpoints > Faceswap [Get Task - Faceswap API - PiAPI docs](https://piapi.ai/docs/faceswap-api/get-task.md): The Get Task Endpoint of Faceswap API from PiAPI - Endpoints > TTS [F5 TTS Zeroshot TTS API](https://piapi.ai/docs/tts-api/f5-tts.md): # PiAPI Text-to-Speech API Documentation - Endpoints > TTS [PiAPI/TTS/Get Task](https://piapi.ai/docs/tts-get-task.md): Retrieve the output of a TTS task. - Endpoints > Trellis [Create Task - Trellis API](https://piapi.ai/docs/trellis-api/create-task.md): Create Task - Trellis of PiAPI - Endpoints > Trellis [Trellis/PiAPI-Get Task](https://piapi.ai/docs/trellis-api/get-task.md): This endpoint from PiAPI's Trellis API retrieves the output of a Trellis 3D model generation task. - Endpoints > Luma Dream Machine > Cancel Task [Cancel Multiple Tasks - Dream Machine API - PiAPI docs](https://piapi.ai/docs/dream-machine/cancel-tasks.md): The Cancel Multiple Tasks Endpoint of gDream Machine API from PiAPI - Endpoints > Luma Dream Machine > Cancel Task [Cancel Single Task - Luma API - PiAPI docs](https://piapi.ai/docs/dream-machine/cancel-task.md): The Cancel Single Task Endpoint of Luma API from PiAPI - Endpoints > Luma Dream Machine [Create Task - Luma API - PiAPI docs](https://piapi.ai/docs/dream-machine/create-task.md): The Create Task Endpoint of Luma API from PiAPI - Endpoints > Luma Dream Machine [Get Task - Dream Machine API - PiAPI docs](https://piapi.ai/docs/dream-machine/get-task.md): The Get Task Endpoint of Dream Machine API from PiAPI - Endpoints > WanX [Create Task](https://piapi.ai/docs/wanx-api/create-task.md): ## Overview - Endpoints > WanX [PiAPI/Wanx-Get Task](https://piapi.ai/docs/wanx-api/get-task.md): This endpoint from PiAPI's Wanx API retrieves the output of the Wanx task. - Endpoints > Skyreels [Skyreels API Create Task - PiAPI](https://piapi.ai/docs/skyreels-api/create-task.md): Skyreels API Create Task - PiAPI - Endpoints > Skyreels [PiAPI/Skyreels-Get Task](https://piapi.ai/docs/skyreels-api/get-task.md): This endpoint from PiAPI's Skyreels API retrieves the output of the Skyreels task. - Endpoints > Framepack [Framepack API Create Task - PiAPI](https://piapi.ai/docs/framepack-api/create-task.md): Framepack API Create Task - PiAPI - Endpoints > Framepack [PiAPI/Framepack-Get Task](https://piapi.ai/docs/framepack-api/get-task.md): This endpoint from PiAPI's Framepack API retrieves the output of the Framepack task. - Endpoints > Hunyuan Video [Hunyuan API-Get Task](https://piapi.ai/docs/hunyuan-api/get-task.md): This endpoint from PiAPI's Hunyuan API retrieves the output of the Hunyuan task for users. - Endpoints > Hunyuan Video [Hunyuan txt2video API](https://piapi.ai/docs/hunyuan-video/txt2video-api.md): # Hunyuan Video Generation API Documentation - Endpoints > Mmaudio [Mmaudio API-Get Task](https://piapi.ai/docs/mmaudio-api/get-task.md): This endpoint from PiAPI's mmaudio API retrieves the output of the mmaudio task where users could check their task output. - Endpoints > Mmaudio [Mmaudio API-Generate Audio based on Video](https://piapi.ai/docs/mmaudio-api/create-task.md): This endpoint from PiAPI's mmaudio API can generate audio based on video and prompt provided. - Endpoints > DiffRhythm [PiAPI/DiffRhythm-Create Task](https://piapi.ai/docs/diffrhythm-api/create-task.md): This endpoint from PiAPI's DiffRhythm API can generate audio based on prompt or reference audio with lyrics. - Endpoints > DiffRhythm [PiAPI/DiffRhythm-Get Task](https://piapi.ai/docs/diffrhythm/get-task.md): This endpoint from PiAPI's DiffRhythm API retrieves the output of the DiffRhythm task where users could check their task output. - Endpoints > Ace Step > Create Task [PiAPI/Ace Step-Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio.md): This endpoint from PiAPI's Ace Step API can generate audio based on prompt with lyrics. - Endpoints > Ace Step > Create Task [PiAPI/Ace Step-Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio.md): This endpoint from PiAPI's Ace Step API can generate audio based on prompt with lyrics. - Endpoints > Ace Step > Create Task [PiAPI/Ace Step-Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit.md): This endpoint from PiAPI's Ace Step API can edit audio based on prompt with lyrics. - Endpoints > Ace Step > Create Task [PiAPI/Ace Step-Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend.md): This endpoint from PiAPI's Ace Step API can extend audio based on prompt with lyrics. - Endpoints > Ace Step [PiAPI/Ace Step-Get Task](https://piapi.ai/docs/ace-step-api/get-task.md): This endpoint from PiAPI's Ace Step API retrieves the output of the Ace Step task where users could check their task output. - Endpoints > Joycaption [PiAPI/Joycaption-Create Task](https://piapi.ai/docs/joycaption-api/create-task.md): This endpoint from PiAPI's Joycatipn API can generate prompt/tag list based on image. - Endpoints > Joycaption [PiAPI/Joycaption-Get Task](https://piapi.ai/docs/joycaption/get-task.md): This endpoint from PiAPI's Joycaption API retrieves the output of the Joycaption task where users could check their task output. - Endpoints > Tools [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api.md): ## Overview - Endpoints > Tools [PiAPI/Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale.md): This endpoint from PiAPI's Video Upscale API retrieves the output of the Video Upscale task where users could check their task output. - Endpoints > Tools [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api.md): Pricing: $0.001/generation - Endpoints > Tools [PiAPI/Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task.md): This endpoint from PiAPI's Remove Background API retrieves the output of the Remove Background task where users could check their task output. - Endpoints > Tools [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api.md): | Model | Price (USD) | - Endpoints > Tools [PiAPI/Segment With Prompt-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task.md): This endpoint from [PiAPI's Segment With Prompt API] retrieves the output of the Segment With Prompt task where users could check their task output. - Endpoints > Tools [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api.md): ## Pricing - Endpoints > Tools [PiAPI/Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task.md): This endpoint from PiAPI's Image-Upscale API retrieves the output of the Image Upscale task where users could check their task output. - Endpoints > PiAPI Account Management [PiAPI Account Info](https://piapi.ai/docs/account-info-api.md): Use the following endpoint to retrieve information such as account_name, account_id, remaining credits based on an API KEY. - Endpoints > PiAPI Account Management [Task List Info](https://piapi.ai/docs/task-list-api.md): Get all your running jobs on PiAPI - Endpoints > PiAPI Account Management [PiAPI/User History Query API](https://piapi.ai/docs/piapi-user-history-query.md): To enable users to access their history more conveniently and efficiently, we have provided a User History Query API. - Legacy Documentation > Face Swap [Faceswap Endpoint - Legacy Faceswap API - PiAPI Docs ](https://piapi.ai/docs/legacy/faceswap-api/faceswap.md): The Legacy Faceswap Endpoint of Faceswap API of PiAPI's docs - Legacy Documentation > Face Swap [Multi-face-swap](https://piapi.ai/docs/15210914e0.md):

Overview

- Legacy Documentation > Face Swap [Fetch Endpoint - Legacy Faceswap API - PiAPI Docs ](https://piapi.ai/docs/faceswap-api/fetch.md): The Legacy Fetch Endpoint of Faceswap API of PiAPI's docs - Legacy Documentation > Dream Machine [Video Creation Endpoint - Legacy Dream Machine API - PiAPI Docs ](https://piapi.ai/docs/legacy/dream-machine/video-creation.md): The Legacy Video Creation Endpoint of Dream Machine API of PiAPI's docs - Legacy Documentation > Dream Machine [Video Extend Endpoint - Legacy Dream Machine API - PiAPI Docs ](https://piapi.ai/docs/legacy/dream-machine/video-extend.md): The Legacy Video Extend Endpoint of Dream Machine API of PiAPI's docs - Legacy Documentation > Dream Machine [Get Video Endpoint - Legacy Dream Machine API - PiAPI Docs ](https://piapi.ai/docs/legacy/dream-machine/get-video.md): The Legacy Get Video Endpoint of Dream Machine API of PiAPI's docs - Legacy Documentation > Kling [Video Generation Endpoint - Legacy Kling API - PiAPI Docs ](https://piapi.ai/docs/legacy/kling-api/video-generation.md): The Legacy Video Creation Endpoint of Kling API of PiAPI's docs - Legacy Documentation > Kling [Video Extend Endpoint - Legacy Kling API - PiAPI Docs ](https://piapi.ai/docs/legacy/kling-api/video-extend.md): The Legacy Video Extend Endpoint of Kling API of PiAPI's docs - Legacy Documentation > Kling [Get Video Endpoint - Legacy Kling API - PiAPI Docs ](https://piapi.ai/docs/kling-api/get-video.md): The Legacy Get Video Endpoint of Kling API of PiAPI's docs ``` ## Image Generation [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - Create Task - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - Create Task - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - Face Swap - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - Dream Machine - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - Kling - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page ## PiAPI Quickstart Guide [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/quickstart) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/quickstart) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/quickstart) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/quickstart) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog "Change Log") - [Output Storage](https://piapi.ai/docs/output-storage "Output Storage") - [Unified API Schema](https://piapi.ai/docs/unified-api-schema "Unified API Schema") - [Webhook](https://piapi.ai/docs/unified-webhook "Webhook") - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation "Bulk Generation Service") - [Billings](https://piapi.ai/docs/billings "Billings") - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server "PiAPI MCP Server") - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/quickstart) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/quickstart) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/quickstart) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Quickstart Let's make your first API call to access AI functionalities using the service from [PiAPI](https://piapi.ai/ "")! ## Generate an API key [\#](https://piapi.ai/docs/quickstart\#generate-an-api-key) 💡_**What is API key?**_ An API key is a secure credential that allows your code to interact with our API. Never share your API key with anyone, as it can be exploited without your knowledge. 1. **Create an account** : Go to [PiAPI workspace](https://app.piapi.ai/ "") and log in with your github account. 2. **Create an API key**: After logged in, navigate to the API key in workspace and generate one. ## Set Base URL [\#](https://piapi.ai/docs/quickstart\#set-base-url) This is the URL to be used for all of our API calls: [https://api.piapi.ai](https://api.piapi.ai/ "") ## Make your first API call [\#](https://piapi.ai/docs/quickstart\#make-your-first-api-call) Let's take **Flux API** for an example. 1. **Set URL endpoint**: With our [Unified API Schema](https://piapi.ai/docs/unified-api-schema ""), users could interact with all models and services through just two endpoints: `create task` and `get task`. Here we want to create a Flux `text-to-image` task, so the endpoint should be: [https://api.piapi.ai/api/v1/task](https://api.piapi.ai/api/v1/task "") 2. **Set the header**: In most cases, you will need an _**API key**_ for authorization. Remember to replace the `YOUR_API_KEY` with your own API key. The headers look like this: ```_code_4jcsy_1 hljs hljs-python headers = { 'x-api-key': 'YOUR_API_KEY', } ``` 3. **Set the request Body**: APIs of Unified API schema share the same request and response format. you will need to specify three main components: `model`: The specific model you wish to interact with. Here we set to `Qubico/flux1-schnell`. `task_type`: The type of task. Here we set to `txt2img`. `input`: The inputs specific to the task and model. `prompt` is required, Let's set to "a bear" for example. ```_code_4jcsy_1 hljs hljs-json { "model": "flux1-schnell", "task_type": "txt2img", "input": { "prompt": "a bear", } } ``` TIP For the introduction of params needed in request body, refer to the documentation of specific endpoint you want to interact with. You can check [Flux Text to Image endpoint doc](https://piapi.ai/docs/flux-api/text-to-image "") about the params above. 4. **Send the request**: ```_code_4jcsy_1 hljs hljs-python import requests import json url = "https://api.piapi.ai/api/v1/task" payload = json.dumps({ "model": "Qubico/flux1-schnell", "task_type": "txt2img", "input": { "prompt": "a bear", } }) headers = { 'X-API-Key': 'Your API key', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` And you will get a response in unified response schema. Now you have made your first API call. Happy intergrating! ## Alternate Domains [\#](https://piapi.ai/docs/quickstart\#alternate-domains) Here are the available domains for all of our API endpoints. we recommend you to experiment with them and change the domains as needed: 1. **api.piapi.ai** \- the primary domain for all API endpoints Modified at7 months ago [Previous\\ \\ Overview](https://piapi.ai/docs/overview) [Next\\ \\ Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) On this page [Generate an API key](https://piapi.ai/docs/quickstart#generate-an-api-key "") [Set Base URL](https://piapi.ai/docs/quickstart#set-base-url "") [Make your first API call](https://piapi.ai/docs/quickstart#make-your-first-api-call "") [Alternate Domains](https://piapi.ai/docs/quickstart#alternate-domains "") ## Song API Task Examples ```` # Song API Task Creation Examples This document provides examples and descriptions for tasks supported by the Song API. Below are the available modes and configurations for `music-u`. ## Music-u (Udio API) Currently, the `music-u` model supports only the `generate_music` task. Below are the task examples for different use cases: ### Request Body Example of Udio Simple Promptn mode. ```json { "model": "music-u", "task_type": "generate_music", "input": { "gpt_description_prompt": "night breeze, piano", "negative_tags": "", "lyrics_type": "generate", "seed": -1 }, "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "" } } } ``` ### Request Body Example of Udio Instrumental This mode generates instrumental music. ```json { "model": "music-u", "task_type": "generate_music", "input": { "gpt_description_prompt": "night breeze", "negative_tags": "", "lyrics_type": "instrumental", "seed": -1 }, "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "" } } } ``` ### Request Body Example of Udio Full Lyrics This mode generates music using user-provided lyrics. ```json { "model": "music-u", "task_type": "generate_music", "input": { "lyrics": "[Verse]\nIn the gentle evening air,\nWhispers dance without a care.\nStars ignite our dreams above,\nWrapped in warmth, we find our love.\n[Chorus]\n", "gpt_description_prompt": "jazz, pop", "negative_tags": "", "lyrics_type": "user", "seed": -1 }, "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "" } } } ``` --- ```` ## Motion Brush Examples [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples "Lipsync With PiAPI Kling API Examples") - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples "Motion Brush With PiAPI Kling API Example") - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements "Kling Elements Video Generation API") - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects "Kling Effects Video Generation") - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task\\ \\ GET](https://piapi.ai/docs/kling-api/get-task "Get Task") - [Create Task\\ \\ POST](https://piapi.ai/docs/kling-api/create-task "Create Task") - [Kling Virtual Try-On\\ \\ POST](https://piapi.ai/docs/kling-api/virtual-try-on-api "Kling Virtual Try-On") - [Kling Effects\\ \\ POST](https://piapi.ai/docs/kling-api/kling-effects-api "Kling Effects") - [Kling Sound\\ \\ POST](https://piapi.ai/docs/kling-api/kling-sound-api "Kling Sound") - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/kling-api/motion-brush-examples) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Motion Brush With PiAPI Kling API Example The `motion_brush` parameter is used for tasks that involve generating videos from images. It has specific requirements: This only works in kling v1.0. The task must be an image-to-video generation task. The `image_tail_url` must not be present. For pay-as-you-go users, the plan must be **Pro**. For host-your-account users, the plan must be at least **Creator**. There are no additional charges other than plain image-to-video task. ## Structure of the `motion_brush` [\#](https://piapi.ai/docs/kling-api/motion-brush-examples\#structure-of-the) ```_code_4jcsy_1 hljs hljs-json "motion_brush": { "mask_url": "https://example.com/example.png", "static_masks": [\ {"points": []}\ ], "dynamic_masks": [\ {"points": [\ {"x": 510, "y": 309},\ {"x": 512.8890686035156, "y": 305.3799133300781},\ {"x": 515.9701843261719, "y": 301.5237731933594},\ {"x": 518.5692138671875, "y": 297.9819030761719},\ ...\ {"x": 587.5043334960938, "y": 107.7113037109375},\ {"x": 588.9964904785156, "y": 103.77008056640625},\ {"x": 590.7432556152344, "y": 99.7882080078125},\ {"x": 592.4257507324219, "y": 95.93536376953125},\ {"x": 594.3355407714844, "y": 92.24978637695312},\ {"x": 596.1476440429688, "y": 88.53536987304688},\ {"x": 598.1287841796875, "y": 85.0318603515625},\ {"x": 600.0324401855469, "y": 81.4693603515625},\ {"x": 602, "y": 78}\ ]}\ ] } ``` **mask\_url**: This is the URL of the mask image for the `motion_brush`. Use a transparent PNG image with the same dimensions as the `image_url`. **static\_masks**: This defines the moving direction of the image that do not require motion. You can have at most one static mask. **dynamic\_masks**: This defines the moving directions of corresponding image areas. You can have up to six dynamic masks (consistent with web interface limits). At least one of the two mask types must be present. **points**: This array contains the motion path points for the specified areas. In `static_masks`, this parameter can be left empty. For `dynamic_masks`, at least two points are required, with a recommendation of ten or more. The origin (0,0) is the top-left corner of the image, with the x-axis extending to the right and the y-axis extending downward. ### Color Indexing for Masks [\#](https://piapi.ai/docs/kling-api/motion-brush-examples\#color-indexing-for-masks) The index of each mask corresponds to specific fixed color regions in the mask image. The relationship is as follows: ```_code_4jcsy_1 hljs hljs-json { "1": {"r": 114, "g": 229, "b": 40}, "2": {"r": 171, "g": 105, "b": 255}, "3": {"r": 0, "g": 170, "b": 255}, "4": {"r": 240, "g": 38, "b": 173}, "5": {"r": 255, "g": 225, "b": 29}, "6": {"r": 255, "g": 34, "b": 0}, "0": {"r": 0, "g": 0, "b": 0} } ``` ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/347095/image-preview?onlineShareType=apidoc&locale=en-US) `"0"` represents `static_masks`. `"1"` represents the first mask in `dynamic_masks`, and so on. Users must ensure that the colors in the mask image match the specified RGB values exactly. The colored areas need to be fully **opaque**. The uncolored areas need to be fully transparent. ### Full Example of Image-to-video Task with Motion Brush [\#](https://piapi.ai/docs/kling-api/motion-brush-examples\#full-example-of-image-to-video-task-with-motion-brush) ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "video_generation", "input": { "prompt": "the boat fly to the sky", "negative_prompt": "", "cfg_scale": 0.5, "duration": 5, "image_url": "https://i.ibb.co/MNX5JVP/boat.jpg", "image_tail_url": "", "mode": "std", "version": "1.0", "motion_brush": { "mask_url": "https://i.ibb.co/WB6YqtH/mask.png", "static_masks": [\ {"points": []}\ ], "dynamic_masks": [\ {"points": [\ {"x": 510, "y": 309},\ {"x": 512.8890686035156, "y": 305.3799133300781},\ {"x": 515.9701843261719, "y": 301.5237731933594},\ {"x": 518.5692138671875, "y": 297.9819030761719},\ {"x": 521.7066345214844, "y": 293.7148132324219},\ {"x": 523.9982299804688, "y": 290.197509765625},\ {"x": 527.0696716308594, "y": 285.4500427246094},\ {"x": 529.1102600097656, "y": 281.9802551269531},\ {"x": 532.0352783203125, "y": 276.8209533691406},\ {"x": 533.900146484375, "y": 273.4161376953125},\ {"x": 536.6403503417969, "y": 267.9842834472656},\ {"x": 538.3750915527344, "y": 264.6147766113281},\ {"x": 540.9106750488281, "y": 259.0498352050781},\ {"x": 542.5351257324219, "y": 255.64447021484375},\ {"x": 544.8347473144531, "y": 250.0723876953125},\ {"x": 546.3829345703125, "y": 246.52072143554688},\ {"x": 548.3993225097656, "y": 241.0670166015625},\ {"x": 549.939453125, "y": 237.21255493164062},\ {"x": 551.6444396972656, "y": 231.99563598632812},\ {"x": 553.2495422363281, "y": 227.67388916015625},\ {"x": 554.6771850585938, "y": 222.77197265625},\ {"x": 556.3735656738281, "y": 217.91738891601562},\ {"x": 557.6281127929688, "y": 213.328857421875},\ {"x": 559.3721313476562, "y": 208.071533203125},\ {"x": 560.5928649902344, "y": 203.70278930664062},\ {"x": 562.2971496582031, "y": 198.332763671875},\ {"x": 563.603515625, "y": 194.04888916015625},\ {"x": 565.1891479492188, "y": 188.83755493164062},\ {"x": 566.6304321289062, "y": 184.55484008789062},\ {"x": 568.065673828125, "y": 179.58285522460938},\ {"x": 569.5950622558594, "y": 175.3140869140625},\ {"x": 570.8982238769531, "y": 170.45913696289062},\ {"x": 572.3914489746094, "y": 166.26303100585938},\ {"x": 573.6038818359375, "y": 161.33819580078125},\ {"x": 574.9257202148438, "y": 157.24008178710938},\ {"x": 576.082275390625, "y": 152.14614868164062},\ {"x": 577.1692810058594, "y": 148.11874389648438},\ {"x": 578.2933349609375, "y": 142.902099609375},\ {"x": 579.2005920410156, "y": 138.90301513671875},\ {"x": 580.3246154785156, "y": 133.71231079101562},\ {"x": 581.2021484375, "y": 129.71713256835938},\ {"x": 582.3867797851562, "y": 124.717041015625},\ {"x": 583.3997192382812, "y": 120.72256469726562},\ {"x": 584.7251586914062, "y": 116.02908325195312},\ {"x": 585.9737854003906, "y": 112.0469970703125},\ {"x": 587.5043334960938, "y": 107.7113037109375},\ {"x": 588.9964904785156, "y": 103.77008056640625},\ {"x": 590.7432556152344, "y": 99.7882080078125},\ {"x": 592.4257507324219, "y": 95.93536376953125},\ {"x": 594.3355407714844, "y": 92.24978637695312},\ {"x": 596.1476440429688, "y": 88.53536987304688},\ {"x": 598.1287841796875, "y": 85.0318603515625},\ {"x": 600.0324401855469, "y": 81.4693603515625},\ {"x": 602, "y": 78}\ ]}\ ] } } } ``` Modified at2024-11-01 07:19:15 [Previous\\ \\ Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) [Next\\ \\ Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) ## Face Swap API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/faceswap-api/create-task) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/faceswap-api/create-task) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap\\ \\ POST](https://piapi.ai/docs/multi-face-swap/create-task "Multi Faceswap") - [Image Faceswap\\ \\ POST](https://piapi.ai/docs/faceswap-api/create-task "Image Faceswap") - [Video Faceswap\\ \\ POST](https://piapi.ai/docs/faceswap-api/video-faceswap "Video Faceswap") - [Get Task\\ \\ GET](https://piapi.ai/docs/faceswap-api/get-task "Get Task") - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/faceswap-api/create-task) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/faceswap-api/create-task) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/faceswap-api/create-task) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/faceswap-api/create-task) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/faceswap-api/create-task) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/faceswap-api/create-task) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Image Faceswap POST https://api.piapi.ai/api/v1/task Try it This async endpoint from [PiAPI's Faceswap API](https://piapi.ai/faceswap-api "") swaps the face from the `swap_image` to the `target_image`. INFO This async endpoint from [PiAPI's Faceswap API](https://piapi.ai/faceswap-api "") swaps the face from the `swap_image` onto the `target_image`. ### Format & Constraints [\#](https://piapi.ai/docs/faceswap-api/create-task\#format--constraints) 1. Size & Resolution: both swap\_image and target\_image should be under 2048 x 2048 resolution each. 2. Input Format: both swap\_image and target\_image should be passed in as urls (ending in jpg/jpeg/png/webp) or in base64 string. ### Pricing [\#](https://piapi.ai/docs/faceswap-api/create-task\#pricing) | Task-type | Price (USD) | | --- | --- | | face-swap | $0.01 per generation | ### Param Details [\#](https://piapi.ai/docs/faceswap-api/create-task\#param-details) The Face-Swap API enables transferring faces from reference images to target images. When multiple faces are detected, the API automatically selects and replaces the largest face in the image. ## Request Header Params Generate Code x-api-key string required Your API Key used for request authorization Body Params application/json Generate Code model string required task\_type string required input object required target\_image string required swap\_image string required config object optional webhook\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](https://piapi.ai/docs/unified-webhook "") for detail. service\_mode enum optional This allows users to choose whether this specific task will get processed under PAYG or HYA mode. If unspecified, then this task will get processed under whatever mode (PAYG or HYA) the user chose on the workspace setting of your account. `public` means this task will be processed under PAYG mode. `private` means this task will be processed under HYA mode. Allowed values: publicprivate Example ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/image-toolkit", "task_type": "face-swap", "input": { "target_image": "https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg", "swap_image": "https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg" } } ``` ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request POST 'https://api.piapi.ai/api/v1/task' \ --header 'x-api-key;' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "Qubico/image-toolkit", "task_type": "face-swap", "input": { "target_image": "https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg", "swap_image": "https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg" } }' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code code integer required data object required task\_id string required model string required task\_type string required status enum required Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged Allowed values: CompletedProcessingPendingFailedStaged input object required output object required meta object required detail null required logs array\[object\] required error object required message string required If you get non-null error message, here are some steps you chould follow: Check our [common error message](https://climbing-adapter-afb.notion.site/Common-Error-Messages-6d108f5a8f644238b05ca50d47bbb0f4 "") Retry for several times If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon. Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "data": { "task_id": "90efd2db-bcfc-413f-a0be-c893850c9d68", "model": "Qubico/image-toolkit", "task_type": "face-swap", "status": "pending", "config": { "webhook_config": { "endpoint": "", "secret": "" } }, "input": {}, "output": null, "meta": {}, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` Modified at4 months ago [Previous\\ \\ Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) [Next\\ \\ Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) ## Kling AI Video Generation # Kling AI & Kling API / remarkable image and video generation at your fingertips! PiAPI's Kling AI & API supports [Kling's 1.0, 1.5, 1.6, 2.0, 2.1 Video Model](https://kling.kuaishou.com/en)(by Kuaishou), allows users to try and integrate the exceptional video generation (from text, from images, or from videos) & virtual try on capabilities into your platform! [Get Started!](https://piapi.ai/workspace/kling) [API Docs](https://piapi.ai/docs/kling-api/video-generation) [Join Discord](https://discord.gg/qRRvcGa7Wb) [Kling 2.0 Master!](https://piapi.ai/kling-api/v2) [Kling 2.1 Standard](https://piapi.ai/kling-api/v2.1/standard) [Kling 2.1 Pro](https://piapi.ai/kling-api/v2.1/pro) [Kling 2.1 Master](https://piapi.ai/kling-api/v2.1/master) ## Features Image-to-Video Supported! Kling AI 1.6, 2.0, & 2.1 are the most powerful AI model suite that transforms your imagination into dynamic videos based on the original image, while adhering to textual prompts controls. Professional Camera Movement State of the art 3D spatio-temporal attention modules are capable of various camera movements to generate immersive and engaging video content with complex cinematic relations Video Continuation Our API allows for multiple video extensions based on original videos. Each extension adds 4.5 seconds of additional content while being finely controlled by the users textual prompts. Kling AI Virtual Try on Powered by Kling AI Image generator, the virtual try on API supports single and multiple garments as inputs; you can upload a picture of the model to wear the garments as well!. Accurate Physics Simulation By leveraging Kuaishou proprietary model architecture and extensive training dataset, Kling can accurately simulate real world physics, producing videos aligned within realistic constraints. Asynchronous API Calls Our API is designed to be called asynchronously with callback function, so that users can submit tasks and be notified upon their completion, avoiding program interruptions. Powerful Conceptual Illustration Through superb semantic understanding and the privately-trained Diffusion Transformer model, Kling can translate user imagination into specific visuals, generating scenes which would be difficult to recreate in the real world. Cinematic Experience in Every Frame Using our in-house three dimensional Variational Autoencoder, it is capable of creating 1080p resolution videos with stunning visual quality, covering from large, majestic landscapes to finely detailed close-ups. Adjustable Aspect Ratios Whether you are using our API for systematic content creation for social media, entertainment, or other goals, our technology can generate various aspect ratios meeting a broad spectrum of video usage scenarios. ## Our Pricing Plans ### "Pay-as-you-go" Option ### Standard - 5s The output will be 5 seconds long and processed under standard mode. $0.16/video ### Standard - 10s The output will be 10 seconds long and processed under standard mode. $0.32/video ### Pro - 5s The output will be 5 seconds long and processed under professional mode. $0.56/video ### Pro - 10s The output will be 10 seconds long and processed under professional mode. $1.12/video ### "Host-your-account" Option Flat Pricing What’s included - Connect your own Kling accounts! - Access to all our Kling API features - Hosting multiple accounts supported - Load Balancer for multi-accounts Stable and Safe $10/seat/month ### Check our Pricing page for more information [Detailed Kling Pricing](https://piapi.ai/pricing) [Get Started!](https://piapi.ai/workspace/kling) ## Our blog Check out our blog for related contents! ![Kling and Popal](https://piapi.ai/images/kling/kling_and_popal.webp) Kling API ### [Using Kling API to animate toys like Popal](https://piapi.ai/blogs/using-kling-api-to-animate-toys-like-popal) In this blog we will be using Kling API to animate toys like Popal ![Kling API vs Pika API](https://piapi.ai/images/kling/kling_vs_pika.webp) Kling API ### [Kling API vs Pika API (Kling Effects vs Pikaffects)](https://piapi.ai/blogs/kling-api-vs-pika-api) In this blog we will be comparing Kling's Kling Effects with Pika Art's Pikaffects! ![Bring Historical Figures to life using AI like Kling API](https://piapi.ai/images/kling/kling_and_historical.webp) Kling API ### [Bring Historical Figures to life using AI like Kling API](https://piapi.ai/blogs/bring-historical-figures-to-life-using-ai-like-kling-api) In this blog we use Kling API to bring historical figures to life! ![kling Elements through Kling API](https://piapi.ai/images/kling/kling_elements.webp) Kling API ### [Kling Elements through Kling API](https://piapi.ai/blogs/kling-elements-through-kling-api) Using the Kling Elements Feature through Kling API ![An image of Kling 1.6 Model](https://piapi.ai/images/kling/kling_1_6.webp) Kling API ### [Kling 1.6 Model through Kling API](https://piapi.ai/blogs/kling-1-6-model-through-kling-api) Use the Kling 1.6 API through PiAPI, in this blog we will compare the differences between Kling 1.5 and Kling 1.6 ![An image of Kling API & Luma API](https://piapi.ai/images/kling/sora_vs_kling.webp) Kling API ### [Sora API vs Kling API - a comparison of AI video generation Models](https://piapi.ai/blogs/sora-api-vs-kling-api-a-comparison-of-ai-video-generation-models) OpenAI's Sora just released, and PiAPI is investigating whether or not we want to launch Sora API, as part of this investigation we will be comparing Sora API to Kling API ![An image of Kling API & Luma API](https://piapi.ai/images/Lumalab/kling_api_and_luma_api.webp) Kling API ### [Crush it Melt it through Pika API , Kling API & Luma API](https://piapi.ai/blogs/crush-it-melt-it-through-pika-api-kling-api-and-luma-api) In this blog we will be exploring the new Crush It Melt It trend and see if Luma API and Kling API can do as well as Pika API! ![An image of Kling API](https://piapi.ai/images/kling/kling_blog.webp) Kling API ### [The Motion Brush Feature through Kling API](https://piapi.ai/blogs/the-motion-brush-feature-through-kling-api) Interested about the newly released Kling Motion Brush Feature? Want to use Motion Brush through Kling API? Check out our comparison blog for more! ![An image of Kling And MJ](https://piapi.ai/images/kling/kling_and_mj.webp) Kling API ![An image of Kling 1.5 vs 1.0](https://piapi.ai/images/kling/kling_vs.webp) Kling API ### [Kling 1.5 vs 1.0 - A Comparison through Kling API](https://piapi.ai/blogs/kling-1-5-vs-1-0-a-comparison-through-kling-api) A detailed comparison between Kling 1.5 and it's predecessor Kling 1.0, using Kling API to generate the videos compared. ![An image of Luma Dream Machine vs Kling](https://piapi.ai/images/Lumalab/Luma_vs_Kling.webp) Kling API ### [Luma Dream Machine vs Kling - A brief comparsion using APIs](https://piapi.ai/blogs/luma-dream-machine-vs-kling-a-brief-comparsion-using-apis) Comparing the same-prompt-outputs of Luma's Dream Machine and Kuaishou's Kling, results are generated using their respective APIs ## Other APIs from us! We are the **all-in-one generative AI API provider** on the market, delivering all the AI APIs you need for your generative AI applications! And, we also provide custom model deployment solutions! ![A screenshot of a video of a beautiful eye generated using our Dream Machine API](https://piapi.ai/images/Lumalab/Luma-Dream-Machine-API.webp) ### [Luma Dream Machine API](https://piapi.ai/dream-machine-api) While you are waiting for the Kling API, check out our powerful Luma Dream Machine API, enabling state of the art video generation from texts or images, and bring the best video generation capabilities to your users! We support both Pay-as-you-go and Host-your-account options for this API! ## Frequently asked questions What is Kling? [Kling](https://kling.kuaishou.com/en) is the state of the art video generation AI model developed by Kuaishou, which is one of the world's largest video-based social network with a user base over 400 million users. This model allows users to create high quality, realistic videos from user-input text prompts, static images, or existing videos. The generated videos can be extended up to minutes in length, are physically accurate, and allows for various aspect ratios. What is the Kling API? Since Kuaishou currently does not offer API for their Kling model, therefore PiAPI took on initiative and created the unofficial Kling API for developers worldwide, allowing you to integrate text-to-video, image-to-video, and video-to-video capabilities into your application or platform! When will you release the API? Our team has already started working on the API and it is estimated to be out in two weeks time! Meanwhile, you are welcome to try our [Dream Machine API](https://piapi.ai/dream-machine-api)! What type of videos can I make with Kling API? Our Kling API can help users generate cinematic videos all types. Our API also enables the creation of video extensions from original videos. Each extension introduces an additional 4.5 seconds of content, precisely controlled by user text prompts! What are the current limitations with regarding to the Kling Model? Sometimes the generated resolution is not as high as users would hope for (i.e. 1080p), but with time and as inference infrastructure become more robust from Kuaishou, it will most likely solved with more computing power. Can I use videos generated from the Kling API for commercial purposes? We'd recommend waiting for more information from Kuaishou regarding this issue. Currently all videos generated will have the Kling watermark, and some users might try to remove the watermark with third-party tools. However, to avoid potential copyright issues, it would be more prudent to adhere to existing and future copyright terms from Kuaishou. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you will be given free credits to try our Kling API (specifically the "Pay-as-you-go" service) before making payments! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to talk more regarding our product offering! ## Kling Effects [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples "Lipsync With PiAPI Kling API Examples") - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples "Motion Brush With PiAPI Kling API Example") - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements "Kling Elements Video Generation API") - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects "Kling Effects Video Generation") - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task\\ \\ GET](https://piapi.ai/docs/kling-api/get-task "Get Task") - [Create Task\\ \\ POST](https://piapi.ai/docs/kling-api/create-task "Create Task") - [Kling Virtual Try-On\\ \\ POST](https://piapi.ai/docs/kling-api/virtual-try-on-api "Kling Virtual Try-On") - [Kling Effects\\ \\ POST](https://piapi.ai/docs/kling-api/kling-effects-api "Kling Effects") - [Kling Sound\\ \\ POST](https://piapi.ai/docs/kling-api/kling-sound-api "Kling Sound") - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/kling-api/kling-effects) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/kling-api/kling-effects) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/kling-api/kling-effects) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/kling-api/kling-effects) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/kling-api/kling-effects) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/kling-api/kling-effects) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/kling-api/kling-effects) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Kling Effects Video Generation ## Pricing [\#](https://piapi.ai/docs/kling-api/kling-effects\#pricing) std mode: $0.26/generationpro mode: $0.46/generation ## Available Kling Effects Options [\#](https://piapi.ai/docs/kling-api/kling-effects\#available-kling-effects-options) | Effect Name | Kling Name | std mode | pro mode | require prompt | | --- | --- | --- | --- | --- | | squish | MochiMochi | √ | × | × | | expansion | BoomBoom | √ | × | × | | jellycat\_oversea | FuzzyFuzzy | √ | × | × | | spinoff | DizzyDizzy | × | √ | × | | rocket | RocketRocket | √ | √ | √ | | hearting | Hand Heart | √ | √ | √ | | fighting | Fight | √ | √ | √ | | kissing | Kiss | √ | √ | √ | | hugging | Hug | √ | √ | √ | | figure | Anime Figure | √ | × | × | | vstack | Yesterday | √ | √ | × | | surfing | SurfSurf | √ | √ | × | | birthday | Celebration | √ | √ | √ | | water | SplashSplash | √ | √ | √ | **Note** Default mode is _std mode_, use `professional_mode = true` in param to switch to _pro mode_. Some of the effects require prompt param to gain better performance. For birthday effect, input image should contain one human/dog/cat. For water effect, input image should contain one human. ## Kling Effects Example [\#](https://piapi.ai/docs/kling-api/kling-effects\#kling-effects-example) ### squish [\#](https://piapi.ai/docs/kling-api/kling-effects\#squish) ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "effects", "input": { "image_url": "https://wesportfish.com/wp-content/uploads/Main-Columbia-River-Fly-Fishing.jpg", "effect": "squish" } } ``` ### rocket [\#](https://piapi.ai/docs/kling-api/kling-effects\#rocket) ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "effects", "input": { "image_url": "https://i.ibb.co/9k86wD01/tower.jpg", "effect": "rocket", "prompt": "emits dazzling white smoke and orange Mach rings from the bottom, and it begins to rise into the air. During the launch process, the appearance remains unchanged, rising quickly, staying in the middle of the camera, capturing details and changes in the surrounding environment. The details are clear, the colors are saturated, and the picture presents a movie-level visual effect", "professional_mode": true } } ``` ### hearting [\#](https://piapi.ai/docs/kling-api/kling-effects\#hearting) ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "effects", "input": { "image_url": "https://i.ibb.co/vvjR9wKX/couple.jpg", "effect": "hearting", "prompt": "There are two people in the picture, they are standing close together, smiling and looking at the camera. Each person extends a hand (one person's left hand and the other person's right hand), and they meet in the middle to elegantly form a heart-shaped gesture. Only one complete heart-shaped gesture is allowed in the video, and no other additional heart-shaped gestures are allowed. The camera slowly zooms in, always keeping the two people and the only heart-shaped gesture intact, while the background is clear and natural, creating a warm and peaceful atmosphere.", "professional_mode": false } } ``` ### fighting [\#](https://piapi.ai/docs/kling-api/kling-effects\#fighting) ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "effects", "input": { "image_url": "https://i.ibb.co/vvjR9wKX/couple.jpg", "effect": "fighting", "prompt": "Two characters are punching and kicking fiercely, with momentary sparks, explosion smoke and flying dust effects at the contact of their bodies. The special effects flash by at each blow and do not persist. The camera gradually pulls away to show a wider fighting scene, ensuring that only the two characters in the picture are in continuous motion, with fast and powerful movements. The background is a dynamic outdoor or indoor environment with moderate light, highlighting the characters' movements, surrounded by natural elements or scene props, and the changes in light and shadow enhance the atmosphere. The special effects are synchronized with the blows to enhance the impact and dynamics of the scene.", "professional_mode": false } } ``` ### kissing [\#](https://piapi.ai/docs/kling-api/kling-effects\#kissing) ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "effects", "input": { "image_url": "https://i.ibb.co/vvjR9wKX/couple.jpg", "effect": "kissing", "prompt": "The two people are very close and quickly turn their heads to look at each other. One of them raises a hand and gently touches the other's cheek, the action is natural. The two then kiss, lips touching and staying for a few seconds. The camera slowly zooms in to focus on the intimate details, the picture is real and romantic, and the emotions are strong.", "professional_mode": false } } ``` ### hugging [\#](https://piapi.ai/docs/kling-api/kling-effects\#hugging) ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "effects", "input": { "image_url": "https://i.ibb.co/vvjR9wKX/couple.jpg", "effect": "hugging", "prompt": "The two characters stand together, as if they have just met, and slowly turn their heads to look at each other with gentle eyes. Then they move closer and embrace each other tenderly. The hugging posture is maintained for several seconds, and the camera stays steady, with sincere and moving emotions.", "professional_mode": false } } ``` Modified at2025-06-25 14:03:59 [Previous\\ \\ Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) [Next\\ \\ Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) ## Account Info API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/account-info-api) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/account-info-api) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/account-info-api) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/account-info-api) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info\\ \\ GET](https://piapi.ai/docs/account-info-api "PiAPI Account Info") - [Task List Info\\ \\ GET](https://piapi.ai/docs/task-list-api "Task List Info") - [User Task History\\ \\ GET](https://piapi.ai/docs/piapi-user-history-query "User Task History") - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/account-info-api) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/account-info-api) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/account-info-api) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/account-info-api) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/account-info-api) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # PiAPI Account Info GET https://api.piapi.ai/account/info Try it Use the following endpoint to retrieve information such as account\_name, account\_id, remaining credits based on an API KEY. `equivalent_in_usd` stands for the actually valid balance value in US dollar. ## Request Header Params Generate Code x-api-key string required you piapi key ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request GET 'https://api.piapi.ai/account/info' \ --header 'x-api-key;' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code object{0} Example ```_code_4jcsy_1 hljs hljs-json {} ``` Modified at2024-12-12 10:31:22 [Previous\\ \\ Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) [Next\\ \\ Task List Info](https://piapi.ai/docs/task-list-api) ## Video Face Swap [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap\\ \\ POST](https://piapi.ai/docs/multi-face-swap/create-task "Multi Faceswap") - [Image Faceswap\\ \\ POST](https://piapi.ai/docs/faceswap-api/create-task "Image Faceswap") - [Video Faceswap\\ \\ POST](https://piapi.ai/docs/faceswap-api/video-faceswap "Video Faceswap") - [Get Task\\ \\ GET](https://piapi.ai/docs/faceswap-api/get-task "Get Task") - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/faceswap-api/video-faceswap) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Video Faceswap POST https://api.piapi.ai/api/v1/task Try it # Video Face Swap API Documentation [\#](https://piapi.ai/docs/faceswap-api/video-faceswap\#video-face-swap-api-documentation) ## Overview [\#](https://piapi.ai/docs/faceswap-api/video-faceswap\#overview) PiAPI's Video Face Swap service enables face replacement in videos using advanced facial recognition and swapping technology. The service supports both single and multiple face swapping operations within MP4 videos. The face-swapping sequence is determined by the model's algorithmic detection of faces. The model assigns order labels to detected faces, and users can generally expect the API to sort faces **from left to right** by default. However, if faces in a photo/video are positioned diagonally (e.g., one at the **top-left** and another at the **bottom-right**), the model may prioritize them as follows: **Top-left face** → Labeled `1` **Bottom-right face** → Labeled `0` Conversely, if one face is at the **bottom-left** and another at the **top-right**: **Bottom-left face** → Labeled `0` **Top-right face** → Labeled `1` ### Examples: How Face Indexing Affects Results [\#](https://piapi.ai/docs/faceswap-api/video-faceswap\#examples-how-face-indexing-affects-results) #### Case 1 [\#](https://piapi.ai/docs/faceswap-api/video-faceswap\#case-1) swap\_faces\_index: 0 1 target\_faces\_index: 1 0 **Action**: The left face in the source image replaces the right face in the target video, and the right face in the source replaces the left face in the target. #### Case 2 [\#](https://piapi.ai/docs/faceswap-api/video-faceswap\#case-2) swap\_faces\_index: 0 1 target\_faces\_index: 0 1 **Action**: The left face in the source replaces the left face in the target; the right face in the source replaces the right face in the target. * * * ## Pricing [\#](https://piapi.ai/docs/faceswap-api/video-faceswap\#pricing) Cost per frame: $0.004 Pricing is calculated based on the total number of frames processed ## Model Information [\#](https://piapi.ai/docs/faceswap-api/video-faceswap\#model-information) **Model Name**: Qubico/video-toolkit **Task Type**: face-swap **Capabilities**: Single and multiple face swapping Support for indexed face selection in both source and target Processing of standard MP4 videos ## Technical Limitations [\#](https://piapi.ai/docs/faceswap-api/video-faceswap\#technical-limitations) **File Format**: MP4 only **File Size**: Maximum 10MB **Resolution**: Maximum 720p **Frame Limit**: Maximum 600 frames per video **Image Size Limit**: Maximum 2048 x 2048 resolution ## Request Header Params Generate Code x-api-key string optional your api key Body Params application/json Generate Code model enum required Model name for face swapping Allowed value: Qubico/video-toolkit task\_type enum required Task type for face swapping Allowed value: face-swap input object required swap\_image string required URL of the image containing the face(s) to swap target\_video string required URL of the target MP4 video for face swapping swap\_faces\_index string optional Index(es) of faces to use from the swap image (e.g., "0" or "1,0") target\_faces\_index string optional Index(es) of faces to replace in the target video (e.g., "0" or "0,1") Example ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/video-toolkit", "task_type": "face-swap", "input": { "swap_image": "http://example.com", "target_video": "http://example.com", "swap_faces_index": "string", "target_faces_index": "string" } } ``` ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request POST 'https://api.piapi.ai/api/v1/task' \ --header 'x-api-key;' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "Qubico/video-toolkit", "task_type": "face-swap", "input": { "swap_image": "http://example.com", "target_video": "http://example.com", "swap_faces_index": "string", "target_faces_index": "string" } }' ``` ## Responses 🟢200OK application/json Successful response Body Generate Code code enum required Response status code Allowed value: 200 message string required Response message data object required task\_id string required Unique task identifier status string required Current status of the task output object optional Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "message": "string", "data": { "task_id": "736fde4d-9029-4915-8189-01353d6982cb", "status": "string", "output": { "video_url": "http://example.com" } } } ``` Modified at2025-03-26 17:20:25 [Previous\\ \\ Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) [Next\\ \\ Get Task](https://piapi.ai/docs/faceswap-api/get-task) ## PiAPI Pricing Plans # PiAPI Pricing Subscription PlanAPI Service MONTHLY YEARLY (SAVE 25%) ### Free Offering basic features, perfect for enthusiast developers. $0/mo No free credits included in the subscription plan Provides the basic features: - ✓ Limited task processing speed - ✓ Automated customer service - ✓ Access to basic APIs - ✓ Playground trial package Current Plan ### Creator Ideal for developers experimenting with personal app projects. $15/mo Receive $10 worth of credits monthly during subscription period All the benefits of Free , and: - ✓ Free file-to-url conversion - ✓ Unlimited task processing speed - ✓ Email or ticket support - ✓ Account notification webhook - ✓ extended API access - ✓ Advanced task types Get Started ### Pro Suitable for senior developers working on official applications. $60/mo Receive $60 worth of credits monthly during subscription period All the greatness of Creator , and: - ✓ Free file-to-url conversion - ✓ One-on-one live customer support - ✓ All API task types - ✓ Invoice customization - ✓ Aggregated invoice Get Started ### Enterprise Suitable for teams managing multiple business units. $100/mo No free credits included in the subscription plan All the features ofPro, and: - ✓ 3× Pro task concurrency - ✓ Up to 100 sub-accounts - ✓ Unified billing, single invoice - ✓ Balance management for sub-accounts Get Started \\* Subscription plan provides you with different rights & features for use; you still need to either buy PiAPI credits (Pay-as-you-go) or subscribe to Host-Your-Account seats ($5~$10/seat/month depending on which API) to actually use the APIs. For detailed Pay-as-you-go and Host-Your-Account pricing, please toggle to "API Service" for more details. See all features ## Compare Plan Features Free Creator Pro Enterprise ### General Features Auto-failover from HYA to PAYG (Increase service stability) ✗ ✓ ✓ ✓ Free File-to-url Conversion ✗ ✓ ✓ ✓ Top Priority Generation ✗ ✗ ✓ ✓ Task Logs 48 Hours 7 Days 30 Days 30 Days Account Notification Webhook ✗ ✓ ✓ ✓ Invoice Customization (Company name, contact info, address, VAT, etc.) ✗ ✗ ✓ ✓ Aggregated Invoice ( Allowing multiple credit top-ups to be merged into one invoice.) ✗ ✗ ✓ ✓ Multiple API Keys ✓ ✓ ✓ ✓ Sub-accounts ✗ ✗ ✗ Up to 100 Sub-accounts ### [Song API (Udio)](https://piapi.ai/docs/music-api/create-task) Basic Features Music Generation ✓ ✓ ✓ ✓ Music Extension ✗ ✓ ✓ ✓ Lyrics Generation ✗ ✓ ✓ ✓ ### [DiffRhythm API](https://piapi.ai/docs/diffrhythm-api/create-task) Basic Features Text-to-Music Generation ✓ ✓ ✓ ✓ ### [MMAudio API](https://piapi.ai/docs/mmaudio-api/create-task) Basic Features Video-to-Audio Generation ✓ ✓ ✓ ✓ ### [Ace Step API](https://piapi.ai/docs/ace-step-api/text-to-audio) Basic Features Video-to-Audio Generation ✓ ✓ ✓ ✓ Concurrent Jobs 6 10 40 50 ### [F5-TTS API](https://piapi.ai/docs/tts-api/f5-tts) Basic Features Text-to-Speech Generation ✓ ✓ ✓ ✓ ### [Wanx API](https://piapi.ai/docs/wanx-api/create-task) Basic Features Text-to-Video Generation ✓ ✓ ✓ ✓ Image-to-Video Generation ✓ ✓ ✓ ✓ ### [Kling API](https://piapi.ai/kling-api) Basic Features Effects ✓ ✓ ✓ ✓ Virtual Try-on ✓ ✓ ✓ ✓ Access to V1.5 Model ✓ ✓ ✓ ✓ Motion Brush ✗ ✓ ✓ ✓ Watermark Removal ✗ ✓ ✓ ✓ Text-to-video Generation ✓ ✓ ✓ ✓ Image-to-video Generation ✓ ✓ ✓ ✓ Negative Prompt ✓ ✓ ✓ ✓ Video Extension ✗ ✓ ✓ ✓ Lip Sync ✗ ✓ ✓ ✓ Add End Frame ✗ ✓ ✓ ✓ Camera Movement (for Text to Video only) ✗ ✓ ✓ ✓ Pay-as-you-go (PAYG) Features Concurrent Jobs 2 5 20 60 ### [Luma API](https://piapi.ai/dream-machine-api) Basic Features Add End Frame ✗ ✓ ✓ ✓ Video Extension ✗ ✓ ✓ ✓ Watermark Removal ✗ ✓ ✓ ✓ Text-to-video Generation ✓ ✓ ✓ ✓ Image-to-video Generation ✓ ✓ ✓ ✓ Pay-as-you-go (PAYG) Features Concurrent Jobs 2 5 20 60 ### [SkyReels API](https://piapi.ai/skyreels) Basic Features Image-to-Video Generation ✓ ✓ ✓ ✓ ### [Framepack API](https://piapi.ai/docs/framepack-api/create-task) Basic Features Image-to-Video Generation ✓ ✓ ✓ ✓ ### [Hailuo API](https://piapi.ai/hailuo) Basic Features Text to Video ✓ ✓ ✓ ✓ Image to Video ✓ ✓ ✓ ✓ Subject Reference ✓ ✓ ✓ ✓ Pay-as-you-go (PAYG) Features Concurrent Jobs 1 5 20 60 ### Hunyuan API Basic Features Text-to-video Generation ✓ ✓ ✓ ✓ Pay-as-you-go (PAYG) Features Concurrent Jobs No limit No limit No limit No limit ### [Flux API](https://piapi.ai/flux-api) Pay-as-you-go (PAYG) Features txt2img ✓ ✓ ✓ ✓ img2img ✓ ✓ ✓ ✓ txt2img-superresolution ✓ ✓ ✓ ✓ img2img-superresolution ✓ ✓ ✓ ✓ txt2img-lora ✗ ✓ ✓ ✓ img2img-lora ✗ ✓ ✓ ✓ redux-variation ✗ ✓ ✓ ✓ fill-inpaint ✗ ✓ ✓ ✓ fill-outpaint ✗ ✓ ✓ ✓ controlnet-lora ✗ ✗ ✓ ✓ Concurrent Jobs 1 5 30 90 ### [Faceswap API](https://piapi.ai/faceswap-api) Pay-as-you-go (PAYG) Features Image Generation ✓ ✓ ✓ ✓ Concurrent Jobs 5 10 50 150 ### [AI Hug API](https://piapi.ai/docs/ai-hug-api/create-task) Pay-as-you-go (PAYG) Features Video Generation ✓ ✓ ✓ ✓ Concurrent Jobs 2 5 20 60 ### [LLM API](https://piapi.ai/docs/llm-api/completions) Pay-as-you-go (PAYG) Features deepseek-chat ✓ ✓ ✓ ✓ deepseek-reasoner ✓ ✓ ✓ ✓ gpt-4o-image ✓ ✓ ✓ ✓ gpt-image-1 ✓ ✓ ✓ ✓ gpt-4.1 ✓ ✓ ✓ ✓ gpt-4.1-mini ✓ ✓ ✓ ✓ gpt-4.1 nano ✓ ✓ ✓ ✓ gpt-4o-mini ✓ ✓ ✓ ✓ gpt-4o ✗ ✓ ✓ ✓ claude-3-7-sonnet-20250219 ✗ ✓ ✓ ✓ ### [Clean & Upscale API](https://piapi.ai/docs/image-editing-api/remove-background-api) Basic Features Image Background Removal ✓ ✓ ✓ ✓ Image Upscaling (2x/4x/8x) ✓ ✓ ✓ ✓ Segment with Prompt ✓ ✓ ✓ ✓ Video Upscaling (2x) ✓ ✓ ✓ ✓ ### [Trellis 3D API](https://piapi.ai/trellis-3d-api) Pay-as-you-go (PAYG) Features 3D-model Generation ✓ ✓ ✓ ✓ Concurrent Jobs 1 5 15 45 ## FAQ What is Pay-as-you-go, and what is Host-your-account? How do I go from Pro Plan to Creator Plan? How can I see my receipt for my payments? Do you offer discounts? Are there refunds? Why should we use your GPT3.5/GPT4/DALLE3/GPT4Vision API services instead of OpenAI's official APIs? ## Image to Image API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/flux-api/image-to-image) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "Flux with LoRA and Controlnet") - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet "Available LoRA and Controlnet") - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint "Flux API with Redux Variation, Fill, Inpaint and Outpaint") - Create Task - [Text to Image\\ \\ POST](https://piapi.ai/docs/flux-api/text-to-image "Text to Image") - [Image to Image\\ \\ POST](https://piapi.ai/docs/flux-api/image-to-image "Image to Image") - [Kontext\\ \\ POST](https://piapi.ai/docs/flux-api/kontext "Kontext") - [Get task \\ \\ GET](https://piapi.ai/docs/flux-api/get-task "Get task ") - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/flux-api/image-to-image) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/flux-api/image-to-image) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/flux-api/image-to-image) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/flux-api/image-to-image) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/flux-api/image-to-image) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/flux-api/image-to-image) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/flux-api/image-to-image) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Image to Image POST https://api.piapi.ai/api/v1/task Try it This is provided as part of the [Flux API](https://piapi.ai/flux-api "") from PiAPI. available models: Qubico/flux1-dev Qubico/flux1-schnell Qubico/flux1-dev-advanced Check [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "") to learn how to send Flux with LoRA and Controlnet task. Check [Flux with Redux and Fill](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint "") to learn how to send Flux with variation, inpaint and out paint task. Below is an example of _**image-to-image**_ request and response. ## Request Header Params Generate Code X-API-Key string required Your API KEY used for request authorization Body Params application/json Generate Code model enum required the model name Allowed values: Qubico/flux1-devQubico/flux1-schnellQubico/flux1-dev-advanced task\_type enum required Allowed values: img2imgimg2img-loracontrolnet-lora input object required the input param of the flux task prompt string required negative\_prompt string optional denoise number optional <= 1\> 0 Default: 0.7 guidance\_scale number optional Guidance scale for image generation. High guidance scales improve prompt adherence at the cost of reduced realism. >= 1.5<= 5 image string required batch\_size number optional number of images, only works for schnell at the moment. Price will be batch\_size \* (price for one generation) >= 1<= 4 Default: 1 lora\_settings array\[object {3}\] optional control\_net\_settings array\[object(control\_net\_setting) {2}\] required config object optional webhook\_config object optional Example ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-schnell", "task_type": "img2img", "input": { "prompt": "a bear", "image": "https://i.ibb.co/J7ZNgSG/01.jpg" }, "config": { "webhook_config": { "endpoint": "https://webhook.site/xxxx", "secret": "" } } } ``` ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request POST 'https://api.piapi.ai/api/v1/task' \ --header 'X-API-Key;' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "Qubico/flux1-schnell", "task_type": "img2img", "input": { "prompt": "a bear", "image": "https://i.ibb.co/J7ZNgSG/01.jpg" }, "config": { "webhook_config": { "endpoint": "https://webhook.site/xxxx", "secret": "" } } }' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code code integer required data object required task\_id string required model string required task\_type string required status enum required Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged Allowed values: CompletedProcessingPendingFailedStaged input object required output object required meta object required detail null required logs array\[object\] required error object required message string required If you get non-null error message, here are some steps you chould follow: Check our [common error message](https://climbing-adapter-afb.notion.site/Common-Error-Messages-6d108f5a8f644238b05ca50d47bbb0f4 "") Retry for several times If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon. Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "data": { "task_id": "1631d053-2352-4add-95cc-360fc52d5f89", "model": "Qubico/flux1-schnell", "task_type": "img2img", "status": "pending", "config": { "webhook_config": { "endpoint": "https://webhook.site/xxxx", "secret": "" } }, "input": { "prompt": "a bear", "negative_prompt": "", "image": "https://i.ibb.co/J7ZNgSG/01.jpg", "width": 0, "height": 0, "steps": 0 }, "output": null, "meta": { "created_at": "2024-09-25T07:40:08.333962391Z", "started_at": "0001-01-01T00:00:00Z", "ended_at": "0001-01-01T00:00:00Z", "usage": { "type": "quota", "frozen": 0, "consume": 20000 }, "is_using_private_pool": false }, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` Modified at2025-05-09 06:34:35 [Previous\\ \\ Text to Image](https://piapi.ai/docs/flux-api/text-to-image) [Next\\ \\ Kontext](https://piapi.ai/docs/flux-api/kontext) ## Kling Virtual Try-On [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples "Lipsync With PiAPI Kling API Examples") - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples "Motion Brush With PiAPI Kling API Example") - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements "Kling Elements Video Generation API") - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects "Kling Effects Video Generation") - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task\\ \\ GET](https://piapi.ai/docs/kling-api/get-task "Get Task") - [Create Task\\ \\ POST](https://piapi.ai/docs/kling-api/create-task "Create Task") - [Kling Virtual Try-On\\ \\ POST](https://piapi.ai/docs/kling-api/virtual-try-on-api "Kling Virtual Try-On") - [Kling Effects\\ \\ POST](https://piapi.ai/docs/kling-api/kling-effects-api "Kling Effects") - [Kling Sound\\ \\ POST](https://piapi.ai/docs/kling-api/kling-sound-api "Kling Sound") - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Kling Virtual Try-On POST https://api.piapi.ai/api/v1/task Try it This is the api for Kling's Virtual Try On, $0.07 for each output image for PAYG. You can also use this endpoint in HYA mode. ## Request Header Params Generate Code x-api-key string required you api key Body Params application/json Generate Code model string required should be `kling` Default: kling task\_type string required should be `ai_try_on` Default: ai\_try\_on input object required the input param of the task model\_input string required the image url of the model(person), see [guideline](https://i.ibb.co/vk0cCsG/model-guidline.png "") dress\_input string optional the image url of the full-body garment. If you use this parameter, do not include the upper\_input or lower\_input parameters in the same request. See [guideline](https://i.ibb.co/mCKmwJx/garment-guideline.png "") upper\_input string optional the image url of the upper-body garment. If you use this parameter, do not include the dress\_input parameters in the same request. See [guideline](https://i.ibb.co/mCKmwJx/garment-guideline.png "") lower\_input string optional the image url of the lower-body garment. If you use this parameter, do not include the dress\_input parameters in the same request. See [guideline](https://i.ibb.co/mCKmwJx/garment-guideline.png "") batch\_size integer optional default is 1, final generation price is $0.07\*batch\_size >= 1<= 4 Default: 1 Example ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "ai_try_on", "input": { "model_input": "string", "dress_input": "string", "upper_input": "string", "lower_input": "string", "batch_size": 1 } } ``` ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request POST 'https://api.piapi.ai/api/v1/task' \ --header 'x-api-key;' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "kling", "task_type": "ai_try_on", "input": { "model_input": "string", "dress_input": "string", "upper_input": "string", "lower_input": "string", "batch_size": 1 } }' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code object{0} Example ```_code_4jcsy_1 hljs hljs-json {} ``` Modified at2024-12-30 08:11:28 [Previous\\ \\ Create Task](https://piapi.ai/docs/kling-api/create-task) [Next\\ \\ Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) ## Kling API Task Creation [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples "Lipsync With PiAPI Kling API Examples") - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples "Motion Brush With PiAPI Kling API Example") - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements "Kling Elements Video Generation API") - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects "Kling Effects Video Generation") - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task\\ \\ GET](https://piapi.ai/docs/kling-api/get-task "Get Task") - [Create Task\\ \\ POST](https://piapi.ai/docs/kling-api/create-task "Create Task") - [Kling Virtual Try-On\\ \\ POST](https://piapi.ai/docs/kling-api/virtual-try-on-api "Kling Virtual Try-On") - [Kling Effects\\ \\ POST](https://piapi.ai/docs/kling-api/kling-effects-api "Kling Effects") - [Kling Sound\\ \\ POST](https://piapi.ai/docs/kling-api/kling-sound-api "Kling Sound") - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/kling-api/create-task) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/kling-api/create-task) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/kling-api/create-task) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/kling-api/create-task) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/kling-api/create-task) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/kling-api/create-task) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Create Task POST https://api.piapi.ai/api/v1/task Try it This is provided as part of the [Kling API](https://piapi.ai/kling-api "") from PiAPI. This service allows you access to APIs for the most advanced video generation model - **Kuaishou's KlingAI**. You can create Text-to-video, Image-to-video, Extend video, Lipsync task and Effects task through this endpoint. INFO #### Text-to-video vs Image-to-video [\#](https://piapi.ai/docs/kling-api/create-task\#text-to-video-vs-image-to-video) 1. If the parameter `image_url` is left null then the task would be a text-to-video task; if filled out, then the task would be an image-to-video task. #### About version 1.5 1.6 2.0 2.1 and 2.1-master [\#](https://piapi.ai/docs/kling-api/create-task\#about-version-15-16-20-21-and-21-master) The V1.5/1.6 model through the API currently has all the features and constraints as per klingai.com pricing for 2.1 is the same as 1.6 pricing for 2.0/2.1-master: 2.0-pro-5s: USD0.96/generation, 2.0-pro-10s: USD1.92/generation #### Video Lengths [\#](https://piapi.ai/docs/kling-api/create-task\#video-lengths) For the video lengths (5s vs 10s) of the API-generated-videos for each model (1.0 1.5 1.6 2.0 2.1 and 2.1-master) and modes (std vs pro) combination, please refer to what is allowed on klingai.com; the API currently aligns with the website. ## Request Header Params Generate Code x-api-key string required Your API Key used for request authorization Body Params application/json Generate Code model enum required the model name Allowed value: kling task\_type enum required type of the task. If you want to extend video,set to `extend_video` and include `origin_task_id` filed in `input`; if you want lipsync, use `lip_sync` and include `origin_task_id` in `input` Allowed values: video\_generationextend\_videolip\_synceffects input object required the input param of the kling task, depends on the `task_type` .refer to the example for more details. prompt string optional <= 2500 characters negative\_prompt string optional <= 2500 characters cfg\_scale string optional float between 0 and 1, it is strongly recommended to use 0.5 duration enum optional Allowed values: 510 aspect\_ratio enum optional only required in text-to-video task Allowed values: 16:99:161:1 camera\_control object optional mode enum optional Allowed values: stdpro version enum optional the model version Allowed values: 1.01.51.62.02.12.1-master image\_url string optional Only required in image-to-video task. Initial frame of the video.No larger than 10MB, and each side must be greater than 300 pixels. image\_tail\_url string optional End frame of the video. No larger than 10MB, and each side must be greater than 300 pixels.Need to be used with `image_url`. origin\_task\_id string optional The task\_id of the video to extend or lip\_sync. tts\_text string optional The text that you want to lipsync in the video, used in `lip_sync` task only; will be ignored if `local_dubbing_url` is set tts\_speed number optional The speed of the lip\_sync speech, used in `lip_sync` task with valid `tts_text` only. >= 0.8<= 2 Default: 1 tts\_timbre string optional The voice that you want to use in `lip_sync` task with valid `ttx_text`, the full voice name list and demo list here: [https://klingai.com/api/lip/sync/ttsList?type=](https://klingai.com/api/lip/sync/ttsList?type= "") local\_dubbing\_url string optional Use your audio file for lip\_sync through this parameter. All tts related param will be ignored if this is set. Audio format: ```mp3``wav``flac``ogg```, should be less than 20 MB and shorter than 60 seconds. After the audio is submitted, we will trim it to the exact length of the original video. Example: https://example.com/hello.mp3 motion\_brush object(motion brush) optional It's highly recommended that you read our example doc before acutally use motion brush effect enum optional your choice of kling effect, see [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects "") Allowed values: squishexpansion config object optional webhook\_config object optional service\_mode enum optional This field allows for more flexible switching between HYA and PAYG. `public`-> `Pay As You Go(PAYG)` `private`-> `Host Your Account(HYA)` Allowed values: publicprivate Example ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "video_generation", "input": { "prompt": "White egrets fly over the vast paddy fields", "negative_prompt": "", "cfg_scale": 0.5, "duration": 5, "aspect_ratio": "1:1", "camera_control": { "type": "simple", "config": { "horizontal": 0, "vertical": 0, "pan": -10, "tilt": 0, "roll": 0, "zoom": 0 } }, "mode": "std" }, "config": { "service_mode": "", "webhook_config": { "endpoint": "", "secret": "" } } } ``` ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request POST 'https://api.piapi.ai/api/v1/task' \ --header 'x-api-key;' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "kling", "task_type": "video_generation", "input": { "prompt": "White egrets fly over the vast paddy fields", "negative_prompt": "", "cfg_scale": 0.5, "duration": 5, "aspect_ratio": "1:1", "camera_control": { "type": "simple", "config": { "horizontal": 0, "vertical": 0, "pan": -10, "tilt": 0, "roll": 0, "zoom": 0 } }, "mode": "std" }, "config": { "service_mode": "", "webhook_config": { "endpoint": "", "secret": "" } } }' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code code integer required data object required task\_id string required model string required task\_type string required status enum required Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged Allowed values: CompletedProcessingPendingFailedStaged input object required output object required meta object required detail null required logs array\[object\] required error object required message string required If you get non-null error message, here are some steps you chould follow: Check our [common error message](https://climbing-adapter-afb.notion.site/Common-Error-Messages-6d108f5a8f644238b05ca50d47bbb0f4 "") Retry for several times If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon. Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "data": { "task_id": "6e269e8c-2091-46c4-b4a5-40a4704a766a", "model": "kling", "task_type": "video_generation", "status": "",// pending/processing/failed/completed "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "" } }, "input": {}, "output": { "video_url": "" }, "meta": {}, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` Modified at2025-06-13 08:20:38 [Previous\\ \\ Get Task](https://piapi.ai/docs/kling-api/get-task) [Next\\ \\ Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) ## PiAPI MCP Server [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/mcp-server) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/mcp-server) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/mcp-server) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/mcp-server) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog "Change Log") - [Output Storage](https://piapi.ai/docs/output-storage "Output Storage") - [Unified API Schema](https://piapi.ai/docs/unified-api-schema "Unified API Schema") - [Webhook](https://piapi.ai/docs/unified-webhook "Webhook") - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation "Bulk Generation Service") - [Billings](https://piapi.ai/docs/billings "Billings") - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server "PiAPI MCP Server") - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/mcp-server) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/mcp-server) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/mcp-server) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # PiAPI MCP Server # piapi-mcp-server [\#](https://piapi.ai/docs/mcp-server\#piapi-mcp-server) A TypeScript implementation of a Model Context Protocol (MCP) server that integrates with PiAPI's API. PiAPI makes user able to generate media content with Flux/Kling/LumaLabs/Udio/Wanx/Trellis directly from Claude or any other MCP-compatible apps. ## Features (more coming soon) [\#](https://piapi.ai/docs/mcp-server\#features-more-coming-soon) Note: Time-consuming tools like video generation may not complete due to Claude's timeout limitations Base Image toolkit Base Video toolkit Flux Image generation from text/image prompt Hunyuan Video generation from text/image prompt Skyreels Video generation from image prompt Wan Video generation from text/image prompt MMAudio Music generation from video TTS Zero-Shot voice generation Kling Video and Effects generation Luma Dream Machine video generation Udio Music and Lyrics generation Trellis 3D model generation from image Workflow planning inside LLMs ## Working with Claude Desktop Example [\#](https://piapi.ai/docs/mcp-server\#working-with-claude-desktop-example) ## Prerequisites [\#](https://piapi.ai/docs/mcp-server\#prerequisites) Node.js 16.x or higher npm or yarn A PiAPI API key (get one at [piapi.ai](https://piapi.ai/workspace/key "")) ## Installation [\#](https://piapi.ai/docs/mcp-server\#installation) 1. Clone the repository: ```_code_4jcsy_1 hljs hljs-bash ``` 2. Install dependencies: ```_code_4jcsy_1 hljs hljs-bash ``` 3. Build the project: ```_code_4jcsy_1 hljs hljs-bash ``` After building, a `dist/index.js` file will be generated. You can then configure this file with Claude Desktop and other applications. For detailed configuration instructions, please refer to the Usage section. 4. (Optional) Test server with MCP Inspector: First, create a `.env` file in the project root directory with your API key: ```_code_4jcsy_1 hljs hljs-bash ``` Then run the following command to start the MCP Inspector: ```_code_4jcsy_1 hljs hljs-bash ``` After running the command, MCP Inspector will be available at [http://localhost:5173](http://localhost:5173/ "") (default port: 5173). Open this URL in your browser to start testing. The default timeout for inspector operations is 10000ms (10 seconds), which may not be sufficient for image generation tasks. It's recommended to increase the timeout when testing image generation or other time-consuming operations. You can adjust the timeout by adding a timeout parameter to the URL, for example: [http://localhost:5173?timeout=60000](http://localhost:5173/?timeout=60000 "") (sets timeout to 60 seconds)The MCP Inspector is a powerful development tool that helps you test and debug your MCP server implementation. Key features include: **Interactive Testing**: Test your server's functions directly through a web interface **Real-time Feedback**: See immediate results of your function calls and any errors that occur **Request/Response Inspection**: View detailed information about requests and responses **Function Documentation**: Browse available functions and their parameters **Custom Parameters**: Set custom timeout values and other configuration options **History Tracking**: Keep track of your previous function calls and their results For detailed information about using the MCP Inspector and its features, visit the [official MCP documentation](https://modelcontextprotocol.io/docs/tools/inspector ""). ## Usage [\#](https://piapi.ai/docs/mcp-server\#usage) ### Connecting to Claude Desktop [\#](https://piapi.ai/docs/mcp-server\#connecting-to-claude-desktop) Add this to your Claude Desktop configuration file ( `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS or `%APPDATA%\Claude\claude_desktop_config.json` on Windows): ```_code_4jcsy_1 hljs hljs-json { "mcpServers": { "piapi": { "command": "node", "args": ["/absolute/path/to/piapi-mcp-server/dist/index.js"], "env": { "PIAPI_API_KEY": "your_api_key_here" } } } } ``` After updating your configuration file, you need to restart Claude for Desktop. Upon restarting, you should see a hammer icon in the bottom right corner of the input box. For more detailed information, visit the [official MCP documentation](https://modelcontextprotocol.io/quickstart/user "") ### Connecting to Cursor [\#](https://piapi.ai/docs/mcp-server\#connecting-to-cursor) Note: Following guide is based on Cursor 0.47.5. Features and behaviors may vary in different versions.To configure the MCP server: 1. Navigate to: File > Preferences > Cursor Settings, or use the shortcut key `Ctrl+Shift+J` 2. Select "MCP" tab on the left panel 3. Click "Add new global MCP server" button in the top right 4. Add your configuration in the opened mcp.json file ```_code_4jcsy_1 hljs hljs-json { "mcpServers": { "piapi": { "command": "node", "args": ["/absolute/path/to/piapi-mcp-server/dist/index.js"], "env": { "PIAPI_API_KEY": "your_api_key_here" } } } } ``` 5. After configuration, you'll see a "piapi" entry in MCP Servers page 6. Click the Refresh button on the entry or restart Cursor to connect to the piapi server To test the piapi image generation: 1. Open and select "Agent mode" in Cursor Chat, or use the shortcut key `Ctrl+I` 2. Enter a test prompt, for example: "generate image of a dog" 3. The image will be generated based on your prompt using piapi server To disable the piapi server: 1. Navigate to the MCP Servers page in Cursor Settings 2. Find the "piapi" entry in the server list 3. Click the "Enabled" toggle button to switch it to "Disabled" ## Development [\#](https://piapi.ai/docs/mcp-server\#development) ### Project Structure [\#](https://piapi.ai/docs/mcp-server\#project-structure) ```_code_4jcsy_1 hljs hljs- piapi-mcp-server/ ├── assets/ ├── src/ │ ├── index.ts # Main server entry point ├── package.json ├── tsconfig.json └── .env.example ``` Modified at2025-04-24 07:43:01 [Previous\\ \\ Billings](https://piapi.ai/docs/billings) [Next\\ \\ Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) ## Streamlined AI API Integrations # Agentic Integrations ## PiAPI Just Got Even Easier to Use! We’ve always been committed to delivering top-quality AI API services—and now, we’re making things even simpler for your workflow needs. With PiAPI now integrated into both Make and n8n, you can finally say goodbye to the hassle of manual HTTP calls—and start using top AI models with just a few clicks. ## Models now on Make.com Your favorite PiAPI models are available as apps on [Make.com](https://www.make.com/), ready to plug into your automated workflows. More models are on the way! [Kling](https://piapi.ai/kling-api)![Kling](https://piapi.ai/workspace/make/integrations/kling_make.png) [Flux.1](https://piapi.ai/flux-api)![Flux.1](https://piapi.ai/workspace/make/integrations/flux_make.png) [WanX](https://piapi.ai/wanx)![WanX](https://piapi.ai/workspace/make/integrations/wanx_make.png) [Hunyuan](https://piapi.ai/docs/hunyuan-video/txt2video-api)![Hunyuan](https://piapi.ai/workspace/make/integrations/hunyuan_make.png) [Faceswap](https://piapi.ai/faceswap-api)![Faceswap](https://piapi.ai/workspace/make/integrations/faceswap_make.png) [DiffRhythm](https://piapi.ai/diffrhythm)![DiffRhythm](https://piapi.ai/workspace/make/integrations/diffRhythm_make.png) [MMAudio](https://piapi.ai/docs/mmaudio-api/create-task)![MMAudio](https://piapi.ai/workspace/make/integrations/mmaudio_make.png) [SkyReels](https://piapi.ai/skyreels)![SkyReels](https://piapi.ai/workspace/make/integrations/skyReels_make.png) [Trellis 3D](https://piapi.ai/trellis-3d-api)![Trellis 3D](https://piapi.ai/workspace/make/integrations/trellis_make.png) [Clean & Upscale](https://piapi.ai/docs/tools/video-upscale-api)![Clean & Upscale](https://piapi.ai/workspace/make/integrations/toolkit_make.png) ![logo](https://piapi.ai/workspace/make/integrations/piapi_blue.png) And more to come... ## Workflow Templates on N8N.io We’ve also released a collection of practical workflow templates on [n8n.io](https://n8n.io/), inspired by the most common user requests—and we’re just getting started. Template: Motion Illustration Function: Generate animated illustrations Input: Visual scene description Output: Animated illustration video ![Template: Motion Illustration](https://piapi.ai/workspace/n8n/integrations/n8n_work1.png) Template: General 3D Presentation Function: Generate a 360° rotating view of a figurine Input: Descriptive keywords of the figurine’s appearance Output: Full rotation video of the figurine ![Template: General 3D Presentation](https://piapi.ai/workspace/n8n/integrations/n8n_work2.png) Start building faster, smarter, and easier with PiAPI! ## Create Music Task [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples "Song API Task Creation Examples") - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend "[Udio] Song Extend") - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/music-api/create-task) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/music-api/create-task) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/music-api/create-task) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/music-api/create-task) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/music-api/create-task) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/music-api/create-task) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/music-api/create-task) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/music-api/create-task) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Create Task POST https://api.piapi.ai/api/v1/task Try it INFO The API to create song from text prompts - supporting models like Udio and others! #### Unit Pricing [\#](https://piapi.ai/docs/music-api/create-task\#unit-pricing) music-u: $0.05 / generation #### Examples [\#](https://piapi.ai/docs/music-api/create-task\#examples) Check [here](https://piapi.ai/docs/music-api/music-task-examples "") for different examples when using the Song API. ## Request Body Params application/json Generate Code model enum required model of the music api Allowed value: music-u task\_type enum required type of the task Allowed values: generate\_musicgenerate\_music\_custom input object required prompt string optional prompt of the music, check [Examples](https://piapi.ai/docs/music-api/music-task-examples "") negative\_tags string optional negative tags of the music, seperate by comma, for example 'pop,rock' gpt\_description\_prompt string optional use in generate\_music only, if title string optional title of the music lyrics\_type enum required used in music-u only, check [Examples](https://piapi.ai/docs/music-api/music-task-examples "") Allowed values: generateuserinstrumental seed number optional used in music-u only, check [Examples](https://piapi.ai/docs/music-api/music-task-examples "") lyrics string optional if lyrics\_type is user, put full lyrics here config object optional webhook\_config object optional Example ```_code_4jcsy_1 hljs hljs-json { "model": "music-u", "task_type": "generate_music", "input": { "negative_tags": "veritatis", "gpt_description_prompt": "magna in id in eu", "lyrics_type": "instrumental", "seed": -25443934 } } ``` ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request POST 'https://api.piapi.ai/api/v1/task' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "music-u", "task_type": "generate_music", "input": { "negative_tags": "veritatis", "gpt_description_prompt": "magna in id in eu", "lyrics_type": "instrumental", "seed": -25443934 } }' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code object{0} Example ```_code_4jcsy_1 hljs hljs-json {} ``` Modified at2025-05-06 09:11:07 [Next\\ \[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) ## Page Not Found # 404 ## This page could not be found. ## File Upload API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/tools/file-upload) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/tools/file-upload) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/tools/file-upload) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/tools/file-upload) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload "File Upload API") - [Video Upscale\\ \\ POST](https://piapi.ai/docs/tools/video-upscale-api "Video Upscale") - [Video Upscale-Get Task\\ \\ GET](https://piapi.ai/docs/video-upscale/get-scale "Video Upscale-Get Task") - [Remove Background API\\ \\ POST](https://piapi.ai/docs/image-editing-api/remove-background-api "Remove Background API") - [Remove Background-Get Task\\ \\ GET](https://piapi.ai/docs/remove-background/get-task "Remove Background-Get Task") - [Segment With Prompt API\\ \\ POST](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api "Segment With Prompt API") - [Segment With Prompt API-Get Task\\ \\ GET](https://piapi.ai/docs/segment-with-prompt/get-task "Segment With Prompt API-Get Task") - [Image Upscale(Super Resolution) API\\ \\ POST](https://piapi.ai/docs/image-editing-api/super-resolution-api "Image Upscale(Super Resolution) API") - [Image Upscale-Get Task\\ \\ GET](https://piapi.ai/docs/image-upscale/get-task "Image Upscale-Get Task") - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/tools/file-upload) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/tools/file-upload) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/tools/file-upload) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/tools/file-upload) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/tools/file-upload) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # File Upload API # Ephemeral Resource Upload API [\#](https://piapi.ai/docs/tools/file-upload\#ephemeral-resource-upload-api) ## Overview [\#](https://piapi.ai/docs/tools/file-upload\#overview) This API allows you to upload temporary files that will be automatically deleted after 24 hours. **This API is Free of charge for Creator/Pro Plan**. If you are on Free plan, you can not use it. ## Base URL [\#](https://piapi.ai/docs/tools/file-upload\#base-url) ```_code_4jcsy_1 hljs hljs- https://upload.theapi.app ``` ## Authentication [\#](https://piapi.ai/docs/tools/file-upload\#authentication) Authentication is required via API key Must be on the Creator plan or higher Add your API key to the request headers as `x-api-key` ## Endpoint: Upload Temporary File [\#](https://piapi.ai/docs/tools/file-upload\#endpoint-upload-temporary-file) Upload a file that will be automatically deleted after 24 hours. ### HTTP Request [\#](https://piapi.ai/docs/tools/file-upload\#http-request) `POST /api/ephemeral_resource` ### Headers [\#](https://piapi.ai/docs/tools/file-upload\#headers) | Header | Value | Description | | --- | --- | --- | | Content-Type | application/json | Request body format | | x-api-key | YOUR\_API\_KEY | Your API authentication key | ### Request Body Parameters [\#](https://piapi.ai/docs/tools/file-upload\#request-body-parameters) | Parameter | Type | Required | Description | | --- | --- | --- | --- | | file\_name | string | Yes | Name of the file with extension (max 128 characters) | | file\_data | string | Yes | Base64 encoded file data. Can include data URI if it matches the file's content type (max 10MB) | ### Supported File Extensions [\#](https://piapi.ai/docs/tools/file-upload\#supported-file-extensions) The following file extensions are supported (case-insensitive): 1. jpg 2. jpeg 3. png 4. webp 5. mp4 6. wav 7. mp3 ### File Name Requirements [\#](https://piapi.ai/docs/tools/file-upload\#file-name-requirements) Must not be empty Must include one of the supported extensions Maximum length: 128 characters Extensions are case-insensitive ### File Data Requirements [\#](https://piapi.ai/docs/tools/file-upload\#file-data-requirements) Must be provided as a base64 string Maximum size: 10MB Optional data URI is supported If data URI is included, its content-type must match the file extension's content-type ### Example Request [\#](https://piapi.ai/docs/tools/file-upload\#example-request) ```_code_4jcsy_1 hljs hljs-bash ``` ### Success Response [\#](https://piapi.ai/docs/tools/file-upload\#success-response) A successful request will return a 200 status code with the following response structure: ```_code_4jcsy_1 hljs hljs-json { "code": 200, "data": { "url": "https://example.com/example.png" }, "message": "success" } ``` ### Error Responses [\#](https://piapi.ai/docs/tools/file-upload\#error-responses) #### Invalid Request (400) [\#](https://piapi.ai/docs/tools/file-upload\#invalid-request-400) Returned when the request parameters are invalid (e.g., unsupported file type, file too large). ```_code_4jcsy_1 hljs hljs-json { "code": 400, "message": "Invalid request parameters" } ``` #### Insufficient Permissions (403) [\#](https://piapi.ai/docs/tools/file-upload\#insufficient-permissions-403) Returned when the user's plan level is insufficient (requires Creator plan or higher). ```_code_4jcsy_1 hljs hljs-json { "code": 403, "message": "Insufficient plan level" } ``` ### Important Notes [\#](https://piapi.ai/docs/tools/file-upload\#important-notes) 1. Uploaded files are automatically deleted after 24 hours 2. The service requires a Creator plan or higher 3. The file\_data field can include a data URI, but if included, its content-type must match the file extension's expected content-type 4. File names are validated for supported extensions in a case-insensitive manner ### Additional Examples [\#](https://piapi.ai/docs/tools/file-upload\#additional-examples) #### Example with JPG file [\#](https://piapi.ai/docs/tools/file-upload\#example-with-jpg-file) ```_code_4jcsy_1 hljs hljs-bash ``` #### Example with MP3 file [\#](https://piapi.ai/docs/tools/file-upload\#example-with-mp3-file) ```_code_4jcsy_1 hljs hljs-bash ``` Modified at2025-01-17 13:01:34 [Previous\\ \\ Get Task](https://piapi.ai/docs/joycaption/get-task) [Next\\ \\ Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) ## Kling Elements API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples "Lipsync With PiAPI Kling API Examples") - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples "Motion Brush With PiAPI Kling API Example") - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements "Kling Elements Video Generation API") - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects "Kling Effects Video Generation") - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task\\ \\ GET](https://piapi.ai/docs/kling-api/get-task "Get Task") - [Create Task\\ \\ POST](https://piapi.ai/docs/kling-api/create-task "Create Task") - [Kling Virtual Try-On\\ \\ POST](https://piapi.ai/docs/kling-api/virtual-try-on-api "Kling Virtual Try-On") - [Kling Effects\\ \\ POST](https://piapi.ai/docs/kling-api/kling-effects-api "Kling Effects") - [Kling Sound\\ \\ POST](https://piapi.ai/docs/kling-api/kling-sound-api "Kling Sound") - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/kling-api/kling-elements) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/kling-api/kling-elements) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/kling-api/kling-elements) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/kling-api/kling-elements) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/kling-api/kling-elements) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/kling-api/kling-elements) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/kling-api/kling-elements) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/kling-api/kling-elements) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Kling Elements Video Generation API ## Overview [\#](https://piapi.ai/docs/kling-api/kling-elements\#overview) Kling Image-to-Video generation now supports elements parameter. You can provide 1-4 elements, where each element consists of an image URL. The entire image is treated as one element, and region selection is not currently supported.Upload 1-4 images, select the subjects (people, animals, objects, or scenes) in the images as elements, and describe their actions and interactions. A video will be created based on the elements and prompts. ## Element Image Requirements [\#](https://piapi.ai/docs/kling-api/kling-elements\#element-image-requirements) Supports 1-4 JPG/PNG images Maximum file size: 10MB per image Minimum dimension: 300px ## API Specifications [\#](https://piapi.ai/docs/kling-api/kling-elements\#api-specifications) ### Input Object Parameters [\#](https://piapi.ai/docs/kling-api/kling-elements\#input-object-parameters) `prompt`: Description of the desired video output `duration`: Video length in seconds (5 or 10) `elements`: Array of image elements (1-4 items) `mode`: Generation mode (e.g., "std") `aspect_ratio`: Output video ratio ("16:9", "9:16", or "1:1") `version`: **Must** be "1.6" for elements feature ### Example Request [\#](https://piapi.ai/docs/kling-api/kling-elements\#example-request) ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "video_generation", "input": { "prompt": "Two toy figures fighting", "negative_prompt": "", "duration": 5, "elements": [\ {\ "image_url": "https://i.ibb.co/p6rmPwdm/2025-01-17-133430.png"\ },\ {\ "image_url": "https://i.ibb.co/RfHW0tK/2025-01-17-133106.png"\ }\ ], "mode": "std", "aspect_ratio": "16:9", "version": "1.6" }, "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "" } } } ``` Modified at2025-02-07 08:31:47 [Previous\\ \\ Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) [Next\\ \\ Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) ## Kling API Lipsync [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples "Lipsync With PiAPI Kling API Examples") - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples "Motion Brush With PiAPI Kling API Example") - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements "Kling Elements Video Generation API") - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects "Kling Effects Video Generation") - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task\\ \\ GET](https://piapi.ai/docs/kling-api/get-task "Get Task") - [Create Task\\ \\ POST](https://piapi.ai/docs/kling-api/create-task "Create Task") - [Kling Virtual Try-On\\ \\ POST](https://piapi.ai/docs/kling-api/virtual-try-on-api "Kling Virtual Try-On") - [Kling Effects\\ \\ POST](https://piapi.ai/docs/kling-api/kling-effects-api "Kling Effects") - [Kling Sound\\ \\ POST](https://piapi.ai/docs/kling-api/kling-sound-api "Kling Sound") - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/kling-api/lipsync-examples) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/kling-api/lipsync-examples) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/kling-api/lipsync-examples) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/kling-api/lipsync-examples) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/kling-api/lipsync-examples) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/kling-api/lipsync-examples) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/kling-api/lipsync-examples) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/kling-api/lipsync-examples) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Lipsync With PiAPI Kling API Examples Here are some input examples for using klingai's lipsync feature in PiAPI's kling api. Please note that the lipsync is priced at $0.1 per 5 seconds. ## LipSync with existing dubbing/audio [\#](https://piapi.ai/docs/kling-api/lipsync-examples\#lipsync-with-existing-dubbingaudio) ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "lip_sync", "input": { "origin_task_id": "3b8aa9f3-586a-4a84-9c77-4d15416f1111", "tts_text": "", "tts_timbre": "", "tts_speed": 1, "local_dubbing_url": "http://example.com/example.mp3" } } ``` ## LipSync with kling tts [\#](https://piapi.ai/docs/kling-api/lipsync-examples\#lipsync-with-kling-tts) Read [kling tts voice list](https://klingai.com/api/lip/sync/ttsList?type= "") before you proceed. ```_code_4jcsy_1 hljs hljs-json { "model": "kling", "task_type": "lip_sync", "input": { "origin_task_id": "3b8aa9f3-586a-4a84-9c77-4d15416f1111", "tts_text": "All hail Britannian!", "tts_timbre": "Rock", "tts_speed": 1, "local_dubbing_url": "" } } ``` ## Common lipsync errors [\#](https://piapi.ai/docs/kling-api/lipsync-examples\#common-lipsync-errors) The video that you want to lipsync should have at least one CLEAR AND STEADY HUMAN face with a visible mouth, and that face should appear in most of the video frames. Otherwise the lipsync task will fail. Modified at2024-10-26 12:53:38 [Previous\\ \[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) [Next\\ \\ Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) ## AI Face Swap API # Seamlessly swap faces in your images withFaceswap API Integrate fast and simple AI-powered face swapping ability into your apps. Deliver extraordinary, personalized images for your users! [Get started!](https://piapi.ai/workspace/faceswap) [API Docs](https://piapi.ai/docs/faceswap-api/faceswap) [Join Discord](https://discord.gg/qRRvcGa7Wb) ![An image displaying photos of Superman, Leonardo Dicaprio and a face swapped image from the two previous photos](https://piapi.ai/images/faceswap/PiAPI_Faceswap_API_header_graphic.webp) Everything you need to start integrating Cost Effective.With our affordable pay-as-you-use pricing, we deliver excellent value for money while providing top-notch face-swapping capabilities! Low Latency.We work hard to keep latencies low for our API, turning back images result faster for our users! High Concurrency Supported.Built to handle high concurrency, our API efficiently manages concurrent requests, ensuring service even during peak loads. Easy Setup and Integration.Integrating our API is a hassle-free setup process with simple HTTPs calls, making it easy to integrate within any tech stack. Asynchronous.Our API works asynchronously, enhancing your workflow efficiency, and allowing smoother integration into your existing systems. Automatic face detection.Our API comes with robust automatic face detection capability, intelligently identifying and swapping faces in your input photo. Bulk generation.We have the backend infrastructure to handle your custom high-volume needs, be it for batch operations or large-scale projects or one-time project, we've got you covered. Standard RESTful API.Conforming to the constraints of REST architectural style, our API ensures interoperability and compatibility with a variety of systems Webhook.We will notify you of a completed task through our webhook feature, to avoid repeated fetch calls made through the network. Pricing Simple & Straightforward ### Standard $0.02 / call - Access to our SOTA model - Sign up and try for free! ### Custom Dedicated Deployment Contact Us - Faster speed & lower latency - Support High Concurrency - Priority Access & Autonomy ## Check our Pricing page for more information [Detailed Faceswap Pricing](https://piapi.ai/pricing) [Get Started!](https://piapi.ai/workspace/faceswap) ## Testimonials > “The automatic face detection feature of Faceswap API is pretty good. It‘s smart enough for what we need in our photo editing software.” Luka Popović > “Handling large-scale projects was quite easy with Faceswap API. The bulk generation feature was also nice for our one-off, high-volume project.” DreamEngine > “We were able to ramp up our Meme-creating platform within no time using the API. The simple HTTPs calls made the setup process very hassle-free.” Naoko T. > “With Faceswap API, we delivered an image altering feature for this social media app that we are working on. We like the low latency feature!” Farid A. > “The face detection feature in the API is pretty spot-on, it is very accurate! This helped us build the face swap feature in our app! ” Sanjay > “Thanks for helping us with our peak load situation! We appreciate the extra-support for the high concurrency!” BlueSyntax > “Thanks for the API, especially the free testing credits upon sign up!” Rafala N. > “Great job on the async api - thanks again! (I like your new BYOA accounts service announcement btw.. will DM you about it soon)” -TBool > “Good custom server solution for the Faceswap API, we needed something that offers higher Concurrency and minimum latency, this worked great!” Brevo Labs ## Our blog Check out our blog for related contents! ![A face swapped image of Superman and Leonardo Dicaprio by PiAPI's Faceswap API](https://piapi.ai/images/faceswap/How_to_use_FaceswapAPI_in_Postman_blog_Banner.webp) Faceswap API ### [How to use Faceswap API from PiAPI with Postman](https://piapi.ai/blogs/how-to-use-faceswap-api-from-piapi-with-postman) Interested in using Faceswap API but not sure how? Check out this tutorial! ## Frequently asked questions What is PiPAI's Faceswap API? Our FaceSwap API based on a custom AI model which allows developers to integrate advanced face swapping capability into their own apps or platforms, providing their users with the ability to quickly personalize desired images. Who is the intended user for the FaceSwap API? Our API is created for developers who want to incorporate face swapping capabilities into their generative AI software applications. This feature is ideal for social apps, picture editing apps, and/or entertainment apps. Non-developers can also use our API with tools such as Postman/Make/Zapier to swap faces as well! How to get started with integrating the API? After registering for an account on PiAPI, you will get some free credits to try the API. Using your own API-KEY you can start making HTTPs calls to the API! How do I make calls to the API? You can call our API using HTTPS Post and Get methods from within your application. A wide range of programming languages that support HTTP methods (ex. Python, JavaScript, Ruby, Java, etc.) can be used to make the call! What is the response time of the API? Our model is designed for optimal speed. The actual response time will vary depending on several factors including the file size of the input pictures, resolution of the pictures, the unobstructed view of the face. Typically, the smaller the size of inputs will have a faster response time. Is there a limit to the total number of requests or concurrent number of requests I can make? We will queue your concurrent jobs if the number of your concurrent jobs exceeds a certain threshold. In terms of total number of requests, you can make as many requests as your credit amount allows. How does the API handle errors? Our API returns error codes and messages in the HTTP response to help identify the issue. Please refer to our documentation for more details. Can you provide dedicated deployment for this API? Yes, absolutely! We have clients who need custom solutions for specialized requirements (ex. Low latency, extra storage time, high concurrency, fine-tuning models, or just shorter queuing time in general), and we do provide cost-effective and performance-enhanced solutions for these scenarios! In terms of data privacy, does your API store images or data? Our model is hosted on PiAPI's server (rented). Our API does not store any input images, they go directly into the model. The output images are stored on our CDN provider's storage for three (3) days and then they are deleted. What is the pricing options for the API? We offer the API through a pay-as-you-use system, you can purchase credits on our Workspace and monitor the remaining credits. The per-use cost of the API is reflected on upper portion this page. Please note that the credits purchased do expire in 180 days after purchase. How do I pay for this API? We have integrated Stripe in our payment system, which will allow payments to be made from most major credit card providers. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI's Workspace, you are given free credits to try our service before making payments! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to listen to your feedback and explore potential collaborations! ## AI Model APIs Overview ``` # Overview ## What is PiAPI? [PiAPI](https://piapi.ai) is a comprehensive platform offering a wide range of large-scale ***AI model APIs***, designed to help developers easily integrate advanced AI functionalities into their applications. ## Key Features What truly sets PiAPI apart is our ***unified API architecture***, which simplifies the process: with just two endpoints, you can handle the full spectrum of task creation and retrieval. For an in-depth explanation, explore our [Unified API Schema](/docs/unified-api-schema) on the unified API framework. Access a diverse range of models for various AI tasks. We offer [Webhook](/docs/unified-webhook) services integrated with our [Unified API Schema](/docs/unified-api-schema) for timely update and notifications. ## Available APIs - [Flux](https://piapi.ai/flux-api) - [Faceswap](https://piapi.ai/faceswap-api) - [Kling](https://piapi.ai/kling-api) - [Dream Machine](https://piapi.ai/dream-machine-api) - [AI Hug](/docs/ai-hug-api/create-task) - check [LLM API](/docs/llm-api/completions) for details ## What is Pay-as-you-go vs Host-your-account? **Pay-as-you-go**: or sometimes referred to as "PPU" or "Pay-per-use", is a service option where you don’t have to have your own ChatGPT/Kling/Luma/etc accounts depending on the API you want to use, and you will be using the account pool operated by us and it will consume your credits (which you can get more by topping up). Thus, all the jobs submitted will be processed by our accounts. The Pay-as-you-go service option will consume your PiAPI credits, which you can top-up on the [Workspace](https://app.piapi.ai/).
**Host-your-account**: sometimes referred to as "BYOA" or "Bring-your-own-account", is a service option where you do need to have and operate your own ChatGPT/Kling/Luma/etc accounts, and then subscribe to a seat or multiple seats on our platform for that particular API, connect your account to that seat, and then start using the API. Thus, all the jobs submitted will be processed by your own accounts. The Host-your-account service option will require you to subscribe to Host-your-account seats for that particular API you want to use. You will not need to top-up PiAPI credits for Host-your-account service option.
## Quick Start To start using the PiAPI, follow the [Quickstart](/docs/quickstart) guide to set up your environment and make your first API call. ``` ## Music Task Examples [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples "Song API Task Creation Examples") - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend "[Udio] Song Extend") - [Create Task\\ \\ POST](https://piapi.ai/docs/music-api/create-task "Create Task") - [\[Udio\] Generate Lyrics\\ \\ POST](https://piapi.ai/docs/song-api/udio-generate-lyrics "[Udio] Generate Lyrics") - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/music-api/music-task-examples) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/music-api/music-task-examples) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/music-api/music-task-examples) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/music-api/music-task-examples) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/music-api/music-task-examples) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/music-api/music-task-examples) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/music-api/music-task-examples) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/music-api/music-task-examples) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/music-api/music-task-examples) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Song API Task Creation Examples This document provides examples and descriptions for tasks supported by the Song API. Below are the available modes and configurations for `music-u`. ## Music-u (Udio API) [\#](https://piapi.ai/docs/music-api/music-task-examples\#music-u-udio-api) Currently, the `music-u` model supports only the `generate_music` task. Below are the task examples for different use cases: ### Request Body Example of Udio Simple Prompt [\#](https://piapi.ai/docs/music-api/music-task-examples\#request-body-example-of-udio-simple-prompt) ```_code_4jcsy_1 hljs hljs-json { "model": "music-u", "task_type": "generate_music", "input": { "gpt_description_prompt": "night breeze, piano", "negative_tags": "", "lyrics_type": "generate", "seed": -1 }, "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "" } } } ``` ### Request Body Example of Udio Instrumental [\#](https://piapi.ai/docs/music-api/music-task-examples\#request-body-example-of-udio-instrumental) This mode generates instrumental music. ```_code_4jcsy_1 hljs hljs-json { "model": "music-u", "task_type": "generate_music", "input": { "gpt_description_prompt": "night breeze", "negative_tags": "", "lyrics_type": "instrumental", "seed": -1 }, "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "" } } } ``` ### Request Body Example of Udio Full Lyrics [\#](https://piapi.ai/docs/music-api/music-task-examples\#request-body-example-of-udio-full-lyrics) This mode generates music using user-provided lyrics. ```_code_4jcsy_1 hljs hljs-json { "model": "music-u", "task_type": "generate_music", "input": { "lyrics": "[Verse]\nIn the gentle evening air,\nWhispers dance without a care.\nStars ignite our dreams above,\nWrapped in warmth, we find our love.\n[Chorus]\n", "gpt_description_prompt": "jazz, pop", "negative_tags": "", "lyrics_type": "user", "seed": -1 }, "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "" } } } ``` * * * Modified at2025-05-06 09:40:40 [Previous\\ \\ Endpoints](https://piapi.ai/docs/endpoints) [Next\\ \[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) ## PiAPI Overview [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/overview) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/overview) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/overview) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/overview) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog "Change Log") - [Output Storage](https://piapi.ai/docs/output-storage "Output Storage") - [Unified API Schema](https://piapi.ai/docs/unified-api-schema "Unified API Schema") - [Webhook](https://piapi.ai/docs/unified-webhook "Webhook") - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation "Bulk Generation Service") - [Billings](https://piapi.ai/docs/billings "Billings") - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server "PiAPI MCP Server") - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/overview) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/overview) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/overview) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Overview ## What is PiAPI? [\#](https://piapi.ai/docs/overview\#what-is-piapi) [PiAPI](https://piapi.ai/ "") is a comprehensive platform offering a wide range of large-scale _**AI model APIs**_, designed to help developers easily integrate advanced AI functionalities into their applications. ## Key Features [\#](https://piapi.ai/docs/overview\#key-features) 1 Unified API Schema What truly sets PiAPI apart is our _**unified API architecture**_, which simplifies the process: with just two endpoints, you can handle the full spectrum of task creation and retrieval. For an in-depth explanation, explore our [Unified API Schema](https://piapi.ai/docs/unified-api-schema "") on the unified API framework. 2 Broad Model Selection Access a diverse range of models for various AI tasks. 3 Webhook We offer [Webhook](https://piapi.ai/docs/unified-webhook "") services integrated with our [Unified API Schema](https://piapi.ai/docs/unified-api-schema "") for timely update and notifications. ## Available APIs [\#](https://piapi.ai/docs/overview\#available-apis) Image Models Video Models Audio Models LLM ## What is Pay-as-you-go vs Host-your-account? [\#](https://piapi.ai/docs/overview\#what-is-pay-as-you-go-vs-host-your-account) **Pay-as-you-go**: or sometimes referred to as "PPU" or "Pay-per-use", is a service option where you don’t have to have your own ChatGPT/Kling/Luma/etc accounts depending on the API you want to use, and you will be using the account pool operated by us and it will consume your credits (which you can get more by topping up). Thus, all the jobs submitted will be processed by our accounts.The Pay-as-you-go service option will consume your PiAPI credits, which you can top-up on the [Workspace](https://app.piapi.ai/ ""). **Host-your-account**: sometimes referred to as "BYOA" or "Bring-your-own-account", is a service option where you do need to have and operate your own ChatGPT/Kling/Luma/etc accounts, and then subscribe to a seat or multiple seats on our platform for that particular API, connect your account to that seat, and then start using the API. Thus, all the jobs submitted will be processed by your own accounts.The Host-your-account service option will require you to subscribe to Host-your-account seats for that particular API you want to use. You will not need to top-up PiAPI credits for Host-your-account service option. ## Quick Start [\#](https://piapi.ai/docs/overview\#quick-start) To start using the PiAPI, follow the [Quickstart](https://piapi.ai/docs/quickstart "") guide to set up your environment and make your first API call. Modified at2024-11-09 03:54:27 [Next\\ \\ Quickstart](https://piapi.ai/docs/quickstart) ## Unified API Schema [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/unified-api-schema) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/unified-api-schema) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/unified-api-schema) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/unified-api-schema) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog "Change Log") - [Output Storage](https://piapi.ai/docs/output-storage "Output Storage") - [Unified API Schema](https://piapi.ai/docs/unified-api-schema "Unified API Schema") - [Webhook](https://piapi.ai/docs/unified-webhook "Webhook") - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation "Bulk Generation Service") - [Billings](https://piapi.ai/docs/billings "Billings") - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server "PiAPI MCP Server") - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/unified-api-schema) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/unified-api-schema) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/unified-api-schema) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Unified API Schema ## Introduction [\#](https://piapi.ai/docs/unified-api-schema\#introduction) As [PiAPI](https://ppiapi.ai/ "")'s range of models and services has expanded, it has become increasingly challenging for both us to manage and for our users to integrate with various APIs. To simplify the experience and streamline the process, we are moving towards a **Unified API**. This new schema allows users to interact with all models and services through just two endpoints: `create task` and `get task`.By consolidating into this unified approach, we aim to reduce complexity while maintaining the full power of our API services. Everything stays the same, except for a few key parameters in the `create task` request body: `model`, `task_type`, and `input`. ## Key Benefits of the Unified API [\#](https://piapi.ai/docs/unified-api-schema\#key-benefits-of-the-unified-api) **Simplified Integration**: Users no longer need to interact with multiple endpoints for different models or tasks. With just two endpoints, you can create tasks and fetch results across all models and services. **Consistency**: The request and response formats remain consistent across all models, making it easier to build and scale your integrations. **Scalability**: As we add more models and services, this unified schema will ensure that your integration process remains as straightforward as possible, without the need to learn new APIs for each service. **Webhooks**: Unified API has built-in support for webhooks. Check [Webhook](https://piapi.ai/docs/unified-webhook "") for more details. ## Unified API Structure [\#](https://piapi.ai/docs/unified-api-schema\#unified-api-structure) The Unified API is designed with simplicity in mind. All models and services are accessed via: 1. **Create Task Endpoint**: Submit a task to any model or service. 2. **Get Task Endpoint**: Retrieve the status and result of the submitted task. In the `create task` request body, you will need to specify three main components: **model**: The specific model you wish to interact with. **task\_type**: The type of task (e.g., image generation, text generation). **input**: The inputs specific to the task and model (e.g., text prompts, image sizes). ## Example Workflow [\#](https://piapi.ai/docs/unified-api-schema\#example-workflow) To demonstrate how the Unified API works, here are examples of how to use the `create task` and `get task` endpoints to interact with our models. #### **Create Task**: Submit a task to generate an image using the model "Qubico/flux1-dev." [\#](https://piapi.ai/docs/unified-api-schema\#create-task-submit-a-task-to-generate-an-image-using-the-model-qubicoflux1-dev) ```_code_4jcsy_1 hljs hljs-python ``` #### **Get Task**: Fetch the status and results of the task once it's completed. [\#](https://piapi.ai/docs/unified-api-schema\#get-task-fetch-the-status-and-results-of-the-task-once-its-completed) ```_code_4jcsy_1 hljs hljs-python ``` ## Important Note [\#](https://piapi.ai/docs/unified-api-schema\#important-note) While we are excited about this unified approach, it’s important to clarify that **the old API schema is not deprecated**. All legacy schemas are still fully functional and will continue to work as expected. However, we highly recommend transitioning to the Unified API for future projects as it offers a more streamlined and efficient experience. * * * Modified at2024-10-24 11:28:40 [Previous\\ \\ Output Storage](https://piapi.ai/docs/output-storage) [Next\\ \\ Webhook](https://piapi.ai/docs/unified-webhook) ## Get Task Details [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples "Song API Task Creation Examples") - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend "[Udio] Song Extend") - [Create Task\\ \\ POST](https://piapi.ai/docs/music-api/create-task "Create Task") - [\[Udio\] Generate Lyrics\\ \\ POST](https://piapi.ai/docs/song-api/udio-generate-lyrics "[Udio] Generate Lyrics") - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - Create Task - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - Create Task - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - Face Swap - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - Dream Machine - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - Kling - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Get Task GET https://api.piapi.ai/api/v1/task/{task\_id} Try it ## Request Path Params Generate Code task\_id string required Header Params Generate Code x-api-key string required Your API Key used for request authorization ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request GET 'https://api.piapi.ai/api/v1/task/' \ --header 'x-api-key;' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code code integer required data object required task\_id string required model string required task\_type string required status enum required Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged Allowed values: CompletedProcessingPendingFailedStaged input object required output object required meta object required detail null required logs array\[object\] required error object required message string required If you get non-null error message, here are some steps you chould follow: Check our [common error message](https://climbing-adapter-afb.notion.site/Common-Error-Messages-6d108f5a8f644238b05ca50d47bbb0f4 "") Retry for several times If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon. ``` Modified at2025-01-26 15:55:58 [Previous\\ \[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) [Next\\ \\ Create Task](https://piapi.ai/docs/music-api/create-task) ## AI Tools and Techniques [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/94b84c8899274fa79b2e9b27d78de893da063d5d-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/creating-an-ai-music-video-generator-using-wan-2-1) ### [Creating an AI Music Video Generator using Wan 2.1](https://piapi.ai/blogs/creating-an-ai-music-video-generator-using-wan-2-1) March 7, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/f49288ec4f5b0a2d92b8a7903d975c1a2c5ab26d-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/using-kling-api-to-animate-toys-like-popal) ### [Using Kling API to animate toys like Popal](https://piapi.ai/blogs/using-kling-api-to-animate-toys-like-popal) March 4, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/30f2c59925698efb7e2aa1de548b19004e6f5574-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/kling-api-vs-pika-api) ### [Kling API vs Pika API (Kling Effects vs Pikaffects)](https://piapi.ai/blogs/kling-api-vs-pika-api) February 25, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/5ae6f61987c78a292519695917236f5b964df7b8-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/bring-historical-figures-to-life-using-ai-like-kling-api) ### [Bring Historical Figures to life using AI like Kling API](https://piapi.ai/blogs/bring-historical-figures-to-life-using-ai-like-kling-api) February 21, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/3cac99c24f8bb7e1b68628d9aa41eb1bb030298c-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/3d-trellis-api-through-piapi) ### [3D Trellis API through PiAPI](https://piapi.ai/blogs/3d-trellis-api-through-piapi) February 21, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/2f665a1630738f17c3d81f79860bbe93fa20bcb2-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/kling-elements-through-kling-api) ### [Kling Elements through Kling API](https://piapi.ai/blogs/kling-elements-through-kling-api) February 13, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](https://piapi.ai/blogs/kling-1-6-model-through-kling-api) December 19, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/d0d4f0a35b6157f9465da531df3eb70a568334ff-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/sora-api-vs-kling-api-a-comparison-of-ai-video-generation-models) ### [Sora API vs Kling API - a comparison of AI video generation Models](https://piapi.ai/blogs/sora-api-vs-kling-api-a-comparison-of-ai-video-generation-models) December 10, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/f7a4c746682a67ba8a7d0de7133728f9088ddbcd-2400x1350.jpg?rect=0,75,2400,1200&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/openai-realtime-api-vs-moshi-api) ### [OpenAI's Realtime API (powering ChatGPT Advanced Voice Mode) vs Moshi API](https://piapi.ai/blogs/openai-realtime-api-vs-moshi-api) October 17, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/3b300397dd917f550cf88549099f66b882da3de2-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-piapi-s-kling-api-is-better-than-the-official-kling-api-cost-speed-and-additional-features) ### [How PiAPI's Kling AI API is better than the Official Kling AI API (cost, speed, and features)!](https://piapi.ai/blogs/how-piapi-s-kling-api-is-better-than-the-official-kling-api-cost-speed-and-additional-features) October 11, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/ba709308f4688f21b3e7b254a49bd17aecdfb688-1280x641.png?rect=0,1,1280,640&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/crush-it-melt-it-through-pika-api-kling-api-and-luma-api) ### [Crush it Melt it through Pika API , Kling API & Luma API](https://piapi.ai/blogs/crush-it-melt-it-through-pika-api-kling-api-and-luma-api) October 9, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/b77a19c3ea85e17400571183c08d7b12295eb6b1-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/the-motion-brush-feature-through-kling-api) ### [The Motion Brush Feature through Kling API](https://piapi.ai/blogs/the-motion-brush-feature-through-kling-api) September 26, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/9fa45eb1459d1ff78f831502395866eca480c94f-2560x1440.png?rect=0,80,2560,1280&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/kling-1-5-vs-1-0-a-comparison-through-kling-api) ### [Kling 1.5 vs 1.0 - A Comparison through Kling API](https://piapi.ai/blogs/kling-1-5-vs-1-0-a-comparison-through-kling-api) September 19, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/382f82204c3877ae7623ec4477ba33e51af0178f-821x1082.png?rect=149,0,524,262&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/luma-dream-machine-1-6-testing-camera-motion-feature-through-luma-api) ### [Luma's Dream Machine 1.6 - Testing Camera Motion Feature through Luma API!](https://piapi.ai/blogs/luma-dream-machine-1-6-testing-camera-motion-feature-through-luma-api) September 5, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/6bd9b4485260160ec5283a29654bfc125a7b9c7e-2623x1800.webp?rect=0,244,2623,1312&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/luma-dream-machine-vs-kling-a-brief-comparsion-using-apis) ### [Luma Dream Machine vs Kling - A brief comparsion using APIs](https://piapi.ai/blogs/luma-dream-machine-vs-kling-a-brief-comparsion-using-apis) August 29, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/a85ff699fadb1216cd90d5b79ba08bc55c147f3c-2453x1300.png?rect=0,37,2453,1227&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/luma-dream-machine-1-5-vs-1-0-comparison-through-luma-api) ### [Luma Dream Machine 1.5 vs 1.0 - Comparison through Luma API](https://piapi.ai/blogs/luma-dream-machine-1-5-vs-1-0-comparison-through-luma-api) August 21, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI [![](https://cdn.sanity.io/images/pr53lcef/production/f382de12e5ee4832004145703a7e0c08dd589b29-1919x783.png?rect=155,0,1566,783&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-to-use-faceswap-api-from-piapi-with-postman) ### [How to use Faceswap API from PiAPI with Postman](https://piapi.ai/blogs/how-to-use-faceswap-api-from-piapi-with-postman) May 24, 2024 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Groundbreaking Image Generation # GPT-Image-1 / unlock groundbreaking image generation with 4o Image and API! Enter the realm of limitless creative possibilities with [OpenAI's ground breaking 4o image generation and the gpt image 1 API](https://openai.com/index/image-generation-api/). Whether you're an artist, developer, or enterprise innovator, you can bring your imagination to life with the unmatched image generation capabilities! [Try 4o Image!](https://piapi.ai/workspace/) [GPT Image 1 Use Cases](https://piapi.ai/docs/gpt-4o-image/use-case) [GPT-Image-1 API docs →](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) ![a generated image of two females standing in front of a text-written street sign, by GPT-4o-image](https://piapi.ai/images/gpt_image/gpt_image_1.webp) ## GPT 4o Image Generation Features! State-of-the-Art Image Generation GPT-image-1 excels in generating stunningly detailed images, turning imagination into tangible and serene landscapes to elaborate graphics. Enhanced Text Rendering 4o Image generation allows users to easily create text within images, enhancing clarity and communication through sophisticated visual storytelling. Interactive Multi-Turn Generation Refine your images with ease using natural conversational prompts using GPT 4o image. Each iteration builds on the previous, ensuring consistent design across all versions. Robust Prompt Coherence GPT 4o Image API handles complex designs effortlessly. GPT 4o Image Generation accommodates up to 20 distinct objects, giving you intricate control over each element traits and relations. Context Learning Upload and analyze your images, as GPT Image 1 effortlessly integrates their details into new creations; empowering dynamic, context-aware designs. Rich World Knowledge With native multimodal capabilities, GPT Image 1 API seamlessly connects textual insights with visual representation, enhancing image generation with informed content. Versatile Style Adaptation Tap into a myriad of styles from. 4o Image Generation transforms or creates impactful visuals that resonate with your brand identity, always reflecting your distinctive touch! Photorealism and Artistic Expression Trained on diverse styles; the GPT-Image-1 model ensures strikingly realistic images, yet accommodates shifts from photorealism to abstract artistry. Developer-Friendly API Integration Now available via 4o image API - integrate high-quality image generation into your platforms, opening new avenues for innovation and functionality across industries! ## Our Pricing Plans ### GPT 4o Image & API $0.02/image - 80% cheaper than[OpenAI GPT Image 1](https://platform.openai.com/docs/models/gpt-image-1)! ### DALLE 3 & API $0.0006/image - As an alternative to the gpt-4o-image model! [Detailed 4o Image API pricing!](https://piapi.ai/pricing) [Try GPT-Image-1!](https://piapi.ai/workspace) ## Questions about 4o Image Generation What is the 4o Image Generation? The [4o Image Generation](https://openai.com/index/introducing-4o-image-generation/) is the most advanced image generator by [OpenAI](https://openai.com/) that is built into GPT-4o. 4o image focuses on usefulness, encompassing important aspects such as text rendering, character consistency, reference-based styling, improved prompt adherence as part of the generation. What is 4o image API? Also referred to as the gpt-image-1 api, it is the API integrated by [PiAPI](https://piapi.ai/) to allow developer to connect this amazing image generation/editing capability into their own apps! What type of images can I generate with the gpt-image-1 API? There are many scenarios where the 4o image generation can be very useful! For example if you are generating a specific style of images (Gihibli for instance), or creating logo design, or a product image, or something hyperrealistic! Please see [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) for more detailed examples! Can I use images generated from the gpt-image-1 API for commercial purposes? GPT-generated content is not copyrighted, thus users can use the image generated for their use purposes. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you will be given free credits to try our API (specifically the "Pay-as-you-go" service) before making top-ups! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to talk more regarding our product offering! ## Kling 2.0 Video Generation # Kling 2.0 Master with API Transform texts and images into stunning videos with Kling 2.0 AI! Select an example below to view or create your own! ## Input Reference Image Cinematic ![Example image](https://piapi.ai/images/kling/Kling_V2_Pic_8.jpeg) Text Prompt ## Output Generated Video00:00 00:00 / 00:00 Previous ExampleNext Example ## Try These Examples Cinematic ### Dramatic Cinema ![Dramatic Cinema](https://piapi.ai/images/kling/Kling_V2_Pic_8.jpeg) The dinosaur charges towards the camera, with motion blur and the camera shaking Prompt Action ### Dynamic Action ![Dynamic Action](https://piapi.ai/images/kling/Kling_V2_Pic_6.jpeg) A mounted GoPro action camera captures a dynamic third-person rear-view angle from the cyclist perspective, the frame vibrating subtly with each turn of the pedals as they weave through urban traffic at golden hour; motion blur streaks along the wet asphalt, reflecting the warm glow of the setting sun while taillights and city signals flash rhythmically ahead; the camera tilts and banks with each shift in direction, keeping the handlebars and spinning front wheel in frame as the rider pushes forward through narrowing lanes; ambient city noise, the whir of the tires, and a rising heartbeat underscore the rush; the atmosphere is kinetic, gritty, and immersive throwing the viewer into the thrill of urban cycling with raw, street-level intensity. Prompt Portrait ### Animated Portrait ![Animated Portrait](https://piapi.ai/images/kling/Kling_V2_Pic_7.jpeg) A handheld camera gently tracks backward at eye level as the young woman walks casually toward the lens through a vibrant night market, her hands tucked in her pockets and a relaxed, genuine smile on her face; the background is a dreamy blur of golden bokeh from string lights overhead, creating a magical contrast with the cooler tones of vendor stalls and distant movement; shallow depth of field isolates her in the crowd, giving the moment a cinematic intimacy as she maintains soft eye contact with the camera; ambient sound of chatter, laughter, and music builds the atmosphere of a warm, lively evening; the vibe is spontaneous, charming, and effortlessly cinematic—capturing a fleeting moment of connection amid the glow of city lights. Prompt [Get Started with Kling 2.0!](https://piapi.ai/workspace/kling) [Kling 2.0 API Docs](https://piapi.ai/docs/kling-api/create-task) [Kling 2.0 Pricing](https://piapi.ai/pricing) [Join Discord](https://discord.gg/qRRvcGa7Wb) ## Kling 2.0 Master - What is new? Introducing Kling 2.0 Master This version of the Kling model offers significantly improved prompt adherence compared to the V1.6 model, with enhanced dynamics and aesthetics. Multi-Elements Editor Allowing for flexible adding/swapping/deleting of video content based on text and image inputs for video generation! Enhanced Response Enjoy a greatly enhanced response to actions, expressions, and camera movements, along with support for complex prompts featuring sequential actions, empowering you to direct your scene with precision. Better Dynamics Significant enhancement in dynamics: the character exhibits increased range of motion with smooth and lifelike movements, maintaining a realistic appearance with detailed features even during intricate actions, creating an immersive experience. Enhanced Visual Appeal More dramatic expressions with professional-level acting, cinematic visuals, and rich details even in Text to Video. Improved style consistency with Image to Video for complete control over stylization. Stable Cost Effective API Calls Our API is designed to handle large concurrent loads, at cost effective rates for developers and creators alike to take advantage of the newest Kling AI 2.0 ! ## Frequently asked questions What is Kling 2.0? [Kling 2.0](https://app.klingai.com/global/release-notes) is the state of the newest, state of the art video generation AI model developed by Kuaishou, used to create breathtaking video from images and texts. When will the Kling 2.0 API be ready? Our PiAPI team is working on this right now and should launch the API system by the end of third week of April! Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you will be given free credits to try our Kling API (specifically the "Pay-as-you-go" service) before making payments! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to talk more regarding our product offering! ## Instant Song Generation # DiffRhythm AI & API: Instant Full-Length Song Generation! Create complete, professional-quality songs in seconds! DiffRhythm is the world’s first open source latent diffusion model that generates full length vocal and instrumental tracks from simple text prompts. Describe your vision and let DiffRhythm handle the rhythm, melody, and lyrics. [AI Playground](https://piapi.ai/workspace) [Try our API!](https://piapi.ai/docs/diffrhythm-api/create-task) [Join Discord](https://discord.gg/qRRvcGa7Wb) ## DiffRhythm Music Generation Demo Switch between examples to see different input/output combinations. Example 1Example 2 ### Audio Reference Your browser does not support the audio element. Reference audio ### Input Lyrics ``` [00:00.52]Abracadabra abracadabra [00:03.97]Ha [00:04.66]Abracadabra abracadabra [00:12.02]Yeah [00:15.80]Pay the toll to the angels [00:19.08]Drawin' circles in the clouds [00:23.31]Keep your mind on the distance [00:26.67]When the devil turns around [00:30.95]Hold me in your heart tonight [00:34.11]In the magic of the dark moonlight [00:38.44]Save me from this empty fight [00:43.83]In the game of life [00:45.84]Like a poem said by a lady in red [00:49.45]You hear the last few words of your life [00:53.15]With a haunting dance now you're both in a trance [00:56.90]It's time to cast your spell on the night [01:01.40]Abracadabra ama-ooh-na-na [01:04.88]Abracadabra porta-ooh-ga-ga [01:08.92]Abracadabra abra-ooh-na-na [01:12.30]In her tongue she's sayin' [01:14.76]Death or love tonight [01:18.61]Abracadabra abracadabra [01:22.18]Abracadabra abracadabra [01:26.08]Feel the beat under your feet [01:27.82]The floor's on fire [01:29.90]Abracadabra abracadabra ``` ### DiffRhythm Generated Music Your browser does not support the audio element. Generated music output ## Features End-to-End Full-Length Music Generate complete songs up to 4 minutes 45 seconds in a single step - no stitching short clips or multi-stage workflows. Style + Scene-Driven Creation! Describe moods, genres, or imagery (e.g. 'Jazzy Nightclub Vibe ' or 'Indie Folk Ballad with Acoustic Harmonica ') to shape unique compositions. Asynchronous API Calls Our aysnchronous API call structure allows developers to submit tasks and have their program continues on, until a "callback" function is executed. Instrumental Mode Craft soundscapes from wild prompts like “Arctic Theremin Storms” - perfect for film scores, game soundtracks, or experimental music. Pure Vocal Generation Focus on lyrical storytelling with standalone vocal tracks, ideal for refining lyrics or acapella projects. Multilingual Music Seamlessly generate songs in English or Chinese, with natural-sounding vocal phrasing in both languages. High Concurrency Experience stable performance even under the most demanding load - our service can automatically scale as per varying peak load, processing high number of jobs concurrently while keeping latencies to the minimum! 10-Second Inference Speed Leverage non-autoregressive architecture to create songs 100x faster than language model-based alternatives. Open-Source Freedom Apache 2.0 license allows commercial use, customization, and integration into your creative tools or apps. Dynamic Length Control Adjust song duration on the fly, from 30-second jingles to extended 10-minute compositions (coming soon!). Song Extension & Remixing Expand existing tracks or blend styles by extending AI-generated songs with new sections (coming soon!). ## Our Pricing Plans ## "Pay-as-you-go" Option For the most updated unit pricing, please see our [pricing page](https://piapi.ai/pricing) more details! ### txt2audio base \| 1.35 minutes $0.02/call ### txt2audio full \| 4.45 minutes $0.02/call ## Check our Pricing page for more information [Detailed DiffRhythm Pricing](https://piapi.ai/pricing) [To our API Playground!](https://piapi.ai/workspace/) ## Frequently asked questions What is DiffRyhthm? DiffRhythm is the first open-source latent diffusion model developed by ASLP Lab, designed specifically for end-to-end full-length song generation. It creates complete tracks (up to 285s) with both vocals and instrumental accompaniment in seconds, using only text prompts like lyrics and style descriptions. Unlike traditional multi-stage systems, it combines simplicity, speed, and scalability - making AI powered music creation accessible to everyone. What is the DiffRhythm API? DiffRhythm API is created by [PiAPI](https://piapi.ai/) and it lets developers integrate our song generation technology directly into apps, tools, or workflows. It provides programmatic access to the model’s capabilities, enabling features like bulk generation, real-time customization, and seamless scaling for commercial use. Whether you’re building a music production app, a game soundtrack engine, or a creative AI platform, the API handles compute-heavy tasks while you focus on user experience. What types of music can DiffRhythm generate? The DiffRhythm API supports virtually any genre or style described in your prompts! Whether you need pop, jazz, electronic, folk, cinematic scores, or experimental soundscapes, it adapts to your creative vision. What is the Pricing for the music generation? For our "Pay-as-you-go" option, it costs $0.02 for each generation call for both txt2audio base (1.35 mins) and txt2audio full (4.45mins). Is there a maximum number of concurrent jobs for the "Pay-as-you-go" Option? Yes, different subscription plans (Free, Creator, or Pro Plan) will have grant the "Pay-as-you-go" users different number of concurrent jobs, please refer to our pricing for details. Can I use DiffRhythm songs commercially? Yes! The Apache 2.0 license permits commercial use, but you must verify originality and disclose AI involvement! Q: What inputs are required? Just lyrics (optional) and a style prompt. No instrumental references or melody templates needed! How do I pay for this API? Our workspace has integrated Stripe in our payment system, which will allow payments to be made from most major credit card providers. Do you offer refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you are given free credits to try our DiffRhythm (specifically the "Pay-as-you-go" service) before making payments! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to listen to your feedback and explore potential collaborations! ## PiAPI Benefits Program # Join PiAPI's Benefits Program: Earn Big, Save More! Are you ready to boost your income while using the best developer tools? Join PiAPI's Benefits Program and start earning rewards today! ![PiAPI Benefits Program Hero Illustration](https://piapi.ai/images/benefits/hero_bg.png) ![PiAPI Referral Program Illustration - Earn rewards by referring others](https://piapi.ai/images/benefits/referrals_logo.png) ### Earn with Referrals For every new user you refer, you'll earn real money — it's that simple! Share PiAPI with your network and receive financial rewards for each active custom-mder you bring in. Plus, you'll earn for the lifetime of each custom-mder! ### Save with Top-up Bonus That's not all! When you top up your PiAPI account using USDT, you'll gain access to exclusive bonus credits. These additional rewards give you more value for your money, enabling you to maximize your usage of PiAPI services at a lower cost. ![PiAPI Top-up Bonus Illustration - Get extra credits when you top up](https://piapi.ai/images/benefits/toptup_bg.png) ## Explore PiAPI's Trusted Partners & Discover More Perks! ![Oxapay Logo - PiAPI Payment Partner](https://piapi.ai/images/benefits/oxapay_logo.png)![RunPod Logo - PiAPI Computing Partner](https://piapi.ai/images/benefits/runpod_logo.png)[![Popal Logo - PiAPI Technology Partner](https://piapi.ai/images/benefits/popal_logo.png)](https://popal.io/) ![YesCaptcha Logo - PiAPI Security Partner](https://piapi.ai/images/benefits/yescaptcha_logo.png)![ClawCloud Logo - PiAPI Cloud Partner](https://piapi.ai/images/benefits/clawcloud_logo.png) Start Earning and Saving Today! Sign up for PiAPI's Benefits Program and start turning your network into cash and your development projects into savings. Why wait? The rewards are yours for the taking! Join Now Get to know PiAPI's API services Become our business partner [Contact Us](https://discord.gg/wfy92Zv6qn) ## FLUX.1 Image API # FLUX.1 API \- the state-of-the-art image generation model API! The [open source](https://github.com/black-forest-labs) FLUX.1 suite of models (FLUX.1-Pro, FLUX.1-Schnell, and FLUX.1-Dev) from the [Black Forest Labs](https://blackforestlabs.ai/) are state-of-the-art text-to-image generative AI model. And now PiAPI is providing Flux-dev API and Flux-schnell API for developers around world at peak performance and cost effective rates! [Get started!](https://piapi.ai/workspace/flux) [Flex Kontext](https://piapi.ai/flux-kontext) [API docs →](https://piapi.ai/docs) ![a picture of a Black Forest with the word Flux spelled out - generated by Flux-dev model](https://piapi.ai/images/flux/flux_3.webp) ## Features Image-to-Image Generation! PiAPI will be the first to offer image-to-image generation for the FLUX APIs - allow developers and users greater flexibility when generating visuals for a variety use cases. Seed parameter supported Num\_outputs is a useful parameter that can be used to control the number of outputs to generate. If left unused, the API will use 1 output as the default value. Aspect\_ratio parameter supported Developers can use this parameter to vary the aspect ratios of output images, making the outputs more suitable in a variety of different use cases! Asynchronous API Calls The API will be designed to allow for asynchronous calls, allowing developers to "submit and forget" tasks, and fetch for the task when completed. Accelerated Hardware Infrastructure Our accelerated hardware infrastructure is specifically optimized for latent diffusion model inference work, ensuring workloads to be executed with maximum efficiency and minimum latency. Custom Inference Frameworks Our custom inference framwork used for latent diffusion model workloads focus on optimized runtime performance and resource management, preventing bottlenecks from traditional framework. Bulk Generation Available The perfect generation option for developers to populate their websites/apps/projects with large quantity of custom pictures from custom prompts. Contact us on Discord with your prompts and we will get back to you with a pricing and a timeline! Simple and Flexibe Payment Plans Our Pay-as-you-go option allows developers to test the API with free credits, and purchase credits for consumption, and manually or automatically top-up their credits as their usage varies. Commercial Use Given the Apache2.0 license of the FLUX.1-schnell model, all images generated from our API using that model will be available for commercial use as needed by the developers or the end-users. ## Our Pricing Plans ### Flux-dev API $0.015/image - 50% cheaper than[Flux-dev API from Replicate](https://replicate.com/black-forest-labs/flux-dev)! ### Flux-Schnell API $0.002/image - 33% cheaper than[Flux-schnell API from Replicate](https://replicate.com/black-forest-labs/flux-schnell)! [Detailed Flux API pricing](https://piapi.ai/pricing) [Get Started!](https://piapi.ai/workspace/flux) ## Frequently asked questions What are the FLUX.1 model suite? The FLUX.1 model suite is developed by [Black Forest Labs](https://kling.kuaishou.com/en) or (BFL for short), is led by Robin Rombach, Patrick Esser, and Andreas Blattmann, who were the original co-creators of the Stable Diffusion models. BFL is invested by [A16z](https://a16z.com/) and other notable angel investors in the field of generative AI. BFL is on a mission to build the world's best open-source generative image and video visual models for developers, and FLUX.1 model is the first step! There are three versions within the FLUX.1 model family: FLUX.1-pro, FLUX.1-dev, and FLUX.1-schnell. FLUX.1-dev is open weight, guidance-distlled, efficient model for non-commercial applications. Whereas FLUX.1-schnell is openly available under the Apache2.0 license and best suited for local development and personal use. What is the FLUX API? The FLUX API are offered by PiAPI based on the FLUX.1-dev model and FLUX.1-schnell model. Given our accelerated hardware infrastructure and custom-developed inference framework, PiAPI is able provide APIs for these two models at very market competitive costs while maintaining performance and minimizing latency! Can I use images generated from the FLUX-dev API for commercial purposes? Given the Apache2.0 license of the FLUX.1-schnell model, all images generated from our API using that model will be available for commercial use as needed by the developers or the end-users. However, images generated from the API for FLUX.1-dev model will not be available for commercial use since BFL has limited that model to non-commercial use only. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you will be given free credits to try our API (specifically the "Pay-as-you-go" service) before making top-ups! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to talk more regarding our product offering! ## Moshi API Overview What's new # Moshi API \- next generation conversational AI API Powered by the speech native AI model [Moshi](https://moshi.chat/) from the [Kyutai team](https://kyutai.org/), our Moshi API allows your users to communicate smoothly and expressive with the AI model! [Sign up for Waitlist](https://piapi.ai/moshi-api#join) [Check out our other APIs!](https://piapi.ai/) ![A image of Moshi AI chat screenshot](https://piapi.ai/images/moshi/moshi-hero-image.webp) ## Get notified when our Moshi APIis ready! Email addressJoin the waitlist! ![A screenshot of Moshi API](https://piapi.ai/images/moshi/moshi-deploy-image.webp) ## Want us to deploy your own Moshi model for API? We provide custom deployment service that allows for seamless integration, optimized performance, and robust support. Enjoy enhanced security and customization options with peak performance. Email us today to get started! - Cost Effective Solutions - Low Latency - High Concurrent Workloads - Dedicated Service - Added Data Security - Fine-tuning Available Email us at [support@piapi.ai](mailto:support@piapi.ai) ## Our blog Check out our blog for related contents! ![An image of Luma Dream Machine vs Kling](https://piapi.ai/images/moshi/realtime_vs_moshi.webp) Moshi API ### [OpenAI's Realtime API (powering ChatGPT Advanced Voice Mode) vs Moshi API](https://piapi.ai/blogs/openai-realtime-api-vs-moshi-api) A detail comparison between OpenAI's Realtime API vs Moshi API - for conversation AI applications! ## Other APIs from us! We are the **all-in-one generative AI API provider** on the market, delivering all the AI APIs you need for your generative AI applications! And, we also provide custom model deployment solutions! ### [Faceswap API](https://piapi.ai/faceswap-api) Discover the power of our Faceswap API - the perfect way to add a touch of fun and interactivity to your applications. With our automatic face detection capability, high concurrency performance, and low latency, your users can effortlessly swap faces and enjoy a personalized and engaging experience! ## Frequently asked questions What is Moshi? [Moshi](https://moshi.chat/) is the conversational AI from the French Kyutai team, which is claimed to be the most advanced competitor to [GPT-4o](https://openai.com/index/hello-gpt-4o/) from OpenAI. This cutting-edge, real-time, multimodal AI model provides the possibility of natural conversational interaction between the model and users, freeing the latter from the traditional hand-dominated interactions, allowing for simultaneous speaking and listening, resulting in a much more natural and engaging experience for the end users. According to Moshi itself, the Kyutai Team is a non-profit, independent research organization funded by companies like iliad Group, CMA CGM and the Schmidt Sciences to advance the open research on multimodal AI. What is PiPAI's Moshi API? Given the open nature of the Moshi Model, and that Kyutai mentioned in the [Moshi press release](https://kyutai.org/cp_moshi.pdf) that "the code and weights of the models will soon be freely shared", we here at PiAPI will be hosting the model for inferencing and provide the APIs for developers around world to integrate this powerful conversational AI into their own platform and applications. Given PiAPI's mission statement to be the one-stop-shop for all generative AI APIs, our existing wide network of user base, and our expertise in model hosting and inferencing, PiAPI is uniquely positioned to provide the Moshi API along with other generative AI APIs for developers like you! Who are the intended users for the API? The direct users for this API will be the developers who are looking to bring Moshi's conversational capability to their user. The indirect users for this API would be the end users who are using the applications with Moshi integrated - Moshi API will enable them to move away from hand-based interactions with AI to a more natural and engaging experience. When will the Moshi API be released? As soon as the Kyutai Team released the weights of the model, the PiAPI team will start deploying the models on our server clusters and provide the API service for developers. We will also elastically scale our inference capacity as the number of developers and number of requests per developers would most likely increase over time! How will this API be priced? We currently do not have the pricing information ready for this API, but based on our previous experience with other generative AI APIs that we provide on our platform, we are most likely going to adopt a usage-based pricing system where users would top up credit as per in the Pay-as-you-go option, and be charged according to the input token and output token amount for every API call. How to get started with integrating the API? After you sign up for PiAPI's workspace using your GitHub account, you can get your own API KEY from our workspace, and then you can start making HTTPs calls to the API right away! What is the response time of the API? PiAPI will optimize our server cluster inference capabilities for the optimal speed and reduced latency. The actual response time will vary depending on several factors including the workload at the time of the API call, the length of the input tokens, the priority in queue, etc. Is there a limit to the total number of requests or concurrent number of requests I can make? Currently, all "Pay-as-you-go" users subscribed to free plan, creator plan, or pro plan will all have different number of concurrent jobs for other APIs. Therefore, it would make sense to assume rights and permissions will differ as per subscription plan for the Moshi API as well! How does the API handle errors? Our documentation keeps track of a detailed list of errors that the currently-available APIs might return, and we will update the documentation for Moshi API as well! Is there customer support service for Moshi API users? Yes, we provide customer support services for all our users for all APIs, including detailed documentation, Discord customer service channel, and email for any collaboration or other inquiries. How do I pay for this API? Our Workspace has integrated Stripe in our payment system, which will allow payments to be made from most major credit card providers. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI Workspace, you are given free credits to try our Moshi API (specifically the "Pay-as-you-go" service) before making payments! ## OmniHuman Video Generation n # OmniHuman-1 with API /High quality human video generation! Powered by OmniHuman's multimodality-conditioned model, generating highly realistic human animations prompted with images, audio, or videos! [Get Started!](https://piapi.ai/workspace/) [OmniHuman API](https://piapi.ai/docs/) [Join Discord!](https://discord.gg/qRRvcGa7Wb) ## Get notified when the OmniHuman-1 & OmniHuman APIis ready! Email addressJoin the waitlist! ## Other APIs from us! We are the **all-in-one generative AI APIs provider** on the market, delivering all the APIs you need for your GenAI apps! And we also provide custom deployment solutions for available open source models! [Faceswap AI](https://piapi.ai/faceswap-api) [Flux Image Gen](https://piapi.ai/flux-api) [Kling Video Gen](https://piapi.ai/kling-api) [DeepSeek LLM](https://piapi.ai/deepseek) [Udio Music Gen](https://piapi.ai/docs/music-api/create-task) [Hailuo Video Gen](https://piapi.ai/hailuo) ## Features Unmatched Human Video Animation Powered by Diffusion Transformer Based Framework, Omnihuman generates highly realistic and engaging results by merging various inputs to create human animations! Multimodal Input Versatility Supporting for image, audio, and video inputs, OmniHuman adapts to diverse styles, enabling versatile and creative video generation across multiple formats. Superior Audio-Driven Generation By significantly enhancing audio-driven video generation, OmniHuman ensures lip-sync precision and natural gesture movements, elevating realism in synchronized videos. Dynamic Interaction Capabilities OmniHuman API offers advanced object interaction detection enables lifelike animations, whether playing instruments or handling objects, enriching your storytelling potential. Refined Head and Facial Movements Enjoy improved natural gesture movements and accurate facial expressions that match input audio, enhancing the realism of characters in motion. Flexible Video Proportions and Styles OmniHuman API supports any video aspect ratio and portrait style, allowing users to tailor animations to specific preferences, be it close-up or full-body compositions. Realistic Pose-Driven Animation Generate animations in any pose with exceptional detail and accuracy, offering unprecedented flexibility for crafting human-centric video content. Lifelike Singing and Talking Sequences Create vivid and authentic singing or talking videos with OmniHuman’s superior movement synchronization, making them an ideal solution for expressive video projects. Commercial Use Subscribers to the Premium Plan are allowed to use the generated video outputs for commercial purposes to suit their needs. ## Our Pricing Plans ### "Pay-as-you-go" Option Video Generation \| Images & Audio Input Coming soon! - Access to both OmniHuman-1 video generation in playground and OmniHuman API Video Generation \| Video Input Coming soon! - Create your human video story with a reference video! ### Check our Pricing page for more information [Detailed OmniHuman API Pricing](https://piapi.ai/pricing) [Get Started!](https://piapi.ai/workspace/) ## Frequently asked questions What is OmniHuman AI Video Generator? [OmniHuman](https://omnihuman-lab.github.io/) is human animation generation AI model developed by [Bytedance](https://www.bytedance.com/en/). It is a state-of-the-art AI model leveraging a Diffusion Transformer based framework to generate highly realistic and vivid human animations. It supports audio, pose, image, and video-driven input modalities for end-to-end uuman video creation. What is OmniHuman API? The Omnihuman API is a powerful tool provided by [PiAPI](https://piapi.ai/), designed to facilitate developers' access to the OmniHuman-1 AI model. Once the model is officially released by Bytedance's Ressearch Lab, PiAPI will leverage its advanced inference framework and cutting-edge hardware infrastructure to deliver highly efficient and scalable video generation capabilities. With OmniHuman API, developers can easily integrate the OmniHuman model's advanced human video generation features into their applications and platforms. What type of videos can I make with the OmniHuman AI? OmniHuman can generate a wide range of human-centric videos, including: Audio-Driven Videos: perfectly synced animations for singing, speaking, or narrating with accurate mouth movements, facial expressions, and gestures. Pose-Driven Videos: Animations based on custom poses, useful for dance, fitness demonstrations, or showcasing specific body movements. Interactive Videos: Videos featuring lifelike interactions with objects, such as playing musical instruments, writing, holding items, or interacting with pets. Stylized Portraits: Close-up, half-body, or full-body videos in various artistic or photorealistic styles. Character Acting Scenes: Animated sequences with detailed head movements, emotive facial expressions, and nuanced gestures for storytelling or virtual characters. Multi-Style Videos: Customized videos using diverse visual styles, background environments, and aspect ratios to match specific aesthetic or branding needs. What input types does OmniHuman Model support? OmniHuman supports diverse inputs, including image styles, audio-driven inputs, video-driven inputs, and combined audio/video inputs, enabling versatile creative possibilities. What are some use cases for OmniHuman Video Generator? Omnihuman is perfect for content creators, marketers, filmmakers, and developers, enabling the creation of realistic human-centric animations for projects like virtual characters, explainer videos, ads, and entertainment. Can I use videos generated from the OmniHuman API for commercial purposes? PiAPI does not put any restrictions on the legal usage of the video generator and its API, and PiAPI allows video generated to be use for legal commercial purposes. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you are given free credits to try our OmniHuman AI or OmniHuman API (specifically the "Pay-as-you-go" service) before making payments! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to listen to your feedback and explore potential collaborations! ## Wanx 2.1 Video Creation n # Wanx 2.1 & API /Dive into the next generation of video creation with Wan 2.1! Wan 2.1 is an advanced and open suite of video foundation models that sets a new standard for video generation. With superior performance, multi-tasking capabilities, and consumer-grade GPU compatibility, Wan 2.1 is the future of AI-driven video creation! [Try Wan 2.1 now!](https://piapi.ai/workspace/wanx) [To Wanx API Doc](https://piapi.ai/docs/wanx-api/create-task) [Join Discord!](https://discord.gg/qRRvcGa7Wb) ## Features SOTA Performance Wan 2.1 consistently outperforms existing open-source models and commercial solutions, setting a new benchmark in video generation. Text-to-Video & Image-to-Video Wanx 2.1 excels across multiple tasks, including Text-to-Video, Image-to-Video, Video Editing, Text-to-Image, and Video-to-Audio, enabling versatility and broad applications in the video generation field. Fast Video Generation Generate a 5-second 480P video in approximately 4 minutes, even without optimization techniques like quantization, making us the most efficient video generation tools available! Realistic Motion Handling Wan 2.1 excels at simulating complex bodily movements, maintaining accurate spatial-temporal relationships for seamless, natural motion sequences in video creation. Multilingual Support Wanx 2.1 supports text prompts in both Chinese and English, making it accessible to a wide range of users globally, from developers to content creators. Top Performance Leader Ranked among the top three video generative models on the VBench leaderboard with an impressive score of 84.7%, Wanx leads the field in motion handling and multi-object interaction. Customizable Artistic Styles With over 100 artistic style templates available, including oil painting and cyberpunk, users can create unique visual content in various genres to match their specific needs. Wide Industry Applications Wanx 2.1 can be used in advertising, short video production, digital restoration of historical footage, and immersive teaching materials, making it a versatile tool for various industries. Commercial Use Subscribers to the Premium Plan are allowed to use the generated video outputs for commercial purposes to suit their needs. ## Our Pricing Plans ### "Pay-as-you-go" Option Wan 2.1 \| 1.3B \| Text to Video $0.12 / generation - Access to both Wanx 2.1 generation in playground and Wanx API! Wanx 2.1 \| 14B \| Text or Image to Video $0.28 / generation - Create your high quality video with a reference image using the powerful 14B parameter model! - Supporting both text to video generations and image to video generations! ### Check our Pricing page for more information [Detailed Wan API Pricing](https://piapi.ai/pricing) [Get Started!](https://piapi.ai/workspace/wanx) ## Other APIs from us! We are the **all-in-one generative AI APIs provider** on the market, delivering all the APIs you need for your GenAI apps! And we also provide custom deployment solutions for available open source models! [Faceswap AI](https://piapi.ai/faceswap-api) [Flux Image Gen](https://piapi.ai/flux-api) [Kling Video Gen](https://piapi.ai/kling-api) [DeepSeek LLM](https://piapi.ai/deepseek) [Udio Music Gen](https://piapi.ai/docs/music-api/create-task) [Hailuo Video Gen](https://piapi.ai/hailuo) ## Frequently asked questions What is Wan 2.1? [Wan 2.1](https://github.com/Wan-Video/Wan2.1) is an Advanced AI model developed by [Alibaba Cloud](https://www.alibabacloud.com/blog/alibaba-cloud-unveiled-wanx-2-1-redefining-ai-driven-video-generation_601930). Wan 2.1 excels at creating realistic images and videos, particularly in handling complex motions like figure skating, swimming, and diving, making it capable of producing highly detailed and physically accurate visuals. What is Wanx API? The Wanx API is provided by [PiAPI](https://piapi.ai/), designed to facilitate developers' access to the Wanx 2.1 model. PiAPI will leverage its advanced inference framework and cutting-edge hardware infrastructure to deliver highly efficient and scalable video generation capabilities. With Wan API, developers can easily integrate the Wan2.1 model's exceptional video generation capability. What makes Wanx 2.1 different from other AI visual models? Wanx 2.1 leads the industry with its superior motion handling, ability to simulate complex bodily movements, and fast video generation, placing it among the top video generative models worldwide. What industries can benefit from using Wanx 2.1? Wanx 2.1 is perfect for advertising, education, film, gaming, and any industry that requires high-quality visual content, from video generation to artistic applications. What kind of output resolution does Wan 2.1 support? Wanx 2.1 supports 1080p video for a 1-minute clip, which can be generated in just 15 seconds. It also offers a Pro version at 1280x720 resolution for high-quality output. What kind of artistic style options are available in Wanx 2.1? Wanx 2.1 provides over 100 artistic style templates, including genres like cyberpunk, oil painting, sketch, and cartoon, offering diverse creative possibilities for users. Can I use videos generated from the Wan API for commercial purposes? PiAPI does not put any restrictions on the legal usage of the video generator and its API, and PiAPI allows video generated to be use for legal commercial purposes to the extend of the original model licensing agreement. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you are given free credits to try our playground and our API (specifically the "Pay-as-you-go" service) before making payments! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to listen to your feedback and explore potential collaborations! ## SkyReels Video Generation n # SkyReels V1 & API /Human Centric Video Generation Redefined! Unleash the power of cinematic creativity with SkyReels V1, setting a new standard for AI generated video content focused on human, with 33 distinct facial expressions and over 400 natural movement combinations! [Try SkyReel V1 now!](https://piapi.ai/workspace/) [To SkyReels API Doc](https://piapi.ai/docs/) [Join Discord!](https://discord.gg/qRRvcGa7Wb) ## Other APIs from us! We are the **all-in-one generative AI APIs provider** on the market, delivering all the APIs you need for your GenAI apps! And we also provide custom deployment solutions for available open source models! [Faceswap AI](https://piapi.ai/faceswap-api) [Flux Image Gen](https://piapi.ai/flux-api) [Kling Video Gen](https://piapi.ai/kling-api) [DeepSeek LLM](https://piapi.ai/deepseek) [Udio Music Gen](https://piapi.ai/docs/music-api/create-task) [Hailuo Video Gen](https://piapi.ai/hailuo) ## Features Human-Centric Precision SkyReels V1 focuses on capturing authentic human emotions with its ability to generate 33 distinct facial expressions coupled with over 400 movement combinations. Text-to-Video & Image-to-Video Utilize our video diffusion transformer to effortlessly convert text and images into vivid video stories tailored to your vision. Cinematic Aesthetics and Lighting Each frame generated mirrors Hollywood-level cinematic quality, ensuring professional-grade video content through immaculate composition and actor positioning.. Unparalleled Training Crafted through fine-tuning on the HunyuanVideo dataset, inclusive of 10 million high-quality film and TV clips, guaranteeing superior output grounded in rich cinematic history. State-of-the-Art Performance SkyReels V1 stands shoulder to shoulder with leading proprietary models like Kling and Hailuo, offering competitive open-source quality in text-to-video conversion. Versatile Application Ideal for filmmakers, content creators, and marketers seeking to enhance engagement with visually stunning narratives that effectively communicate and resonate with audiences. User-Friendly API Integration Seamlessly integrate the SkyReels V1 API into your existing workflow to empower your team with tools designed for creativity and efficiency. Collaborative Innovation by Kunlun Developed by the esteemed innovators at Kunlun, where cutting-edge technology meets creative empowerment.. Commercial Use Subscribers to the Premium Plan are allowed to use the generated video outputs for commercial purposes to suit their needs. ## Our Pricing Plans ### "Pay-as-you-go" Option Video Generation from Texts Coming soon! - Access to both SkyReel V1 generation in playground and SkyReel API Video Generation from Images Coming soon! - Create your human video with a reference image! ### Check our Pricing page for more information [Detailed API Pricing](https://piapi.ai/pricing) [Get Started!](https://piapi.ai/workspace/) ## Frequently asked questions What is SkyReels Video Generator? [SkyReels V1](https://github.com/SkyworkAI/SkyReels-V1) is human centric video generation AI model developed by [Kunlun](https://www.kunlun.com/). It is the first and most advanced open-source human-centric video foundation model. By fine-tuning HunyuanVideo on the order of tens of millions of high-quality film and television clips. What is SkyReels API? The SkyReels API is provided by [PiAPI](https://piapi.ai/), designed to facilitate developers' access to the SkyReel V1 model. PiAPI will leverage its advanced inference framework and cutting-edge hardware infrastructure to deliver highly efficient and scalable video generation capabilities. With SkyReels API, developers can easily integrate the SkyReel V1 model's human video generation features into their applications and platforms. What are some special offerings from SkyReels AI? SkyReel AI can generate a wide range of human-centric videos with following features: \- able to capture 33 distinct facial expressions with over 400 natural movement combinations, accurately reflecting human emotions. \- the model was trained on high-quality Hollywood-level film and television data, each generated frame exhibits cinematic quality in composition, actor positioning, and camera angles. What input types does SkyReel V1 Model support? SkyReels supports a diverse set of inputs, including texts and reference image, unlocking a wide range of creative opportunities. What makes SkyReels V1 different from other video creation models? SkyReels V1 excels with its human-centric design, offering uniquely precise facial expressions, movement combinations, and cinematic aesthetics, derived from extensive training on high-quality film data. Can I use videos generated from the SkyReel API for commercial purposes? PiAPI does not put any restrictions on the legal usage of the video generator and its API, and PiAPI allows video generated to be use for legal commercial purposes to the extend of the original model licensing agreement. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you are given free credits to try our SkyReels V1 or SkyReel API (specifically the "Pay-as-you-go" service) before making payments! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to listen to your feedback and explore potential collaborations! ## Privacy Policy Overview This privacy policy for piapi ('Company,' 'we,' 'us,' or 'our'), describes how and why we might collect, store, use, and/or share ('process') your information when you use our services ('Services'), such as when you: Visit our website at https://piapi.ai, or any other associated website of ours that links to this privacy notice Engage with us in other related ways, including any sales, marketing, or events Questions or concerns?Reading this privacy notice will help you understand your privacy rights and choices. If you do not agree with our policies and practices, please do not use our Services. ## SUMMARY OF KEY POINTS What personal information do we process?When you visit, use, or navigate our Services, we may process personal information depending on how you interact with piapi and our Services, the choices you make, and the products and features you use. Do we process any sensitive personal information?We do not process sensitive personal information. We do stored your payment information to process your current and future subscriptions, and we store your email address to send transactional payment emails and service-related emails. Do we receive any information from third parties?We may receive information from public databases, marketing partners, social media platforms, and other outside sources. How do we process your information?We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and to comply with law. We may also process your information for other purposes with your consent. We process your information only when we have a valid legal reason to do so. In what situations and with which parties do we share personal information?We may share information in specific situations and with specific categories of third parties, and/or in order to comply with related legal requirements. How do we keep your information safe? We have organizational and technical processes and procedures in place to protect your personal information. However, no electronic transmission over the internet or information storage technology can be guaranteed to be 100% secure, so we cannot promise or guarantee that hackers, cybercriminals, or other unauthorized third parties will not be able to defeat our security and improperly collect, access, steal, or modify your information. What are your rights?Depending on where you are located geographically, the applicable privacy law may mean you have certain rights regarding your personal information. ## 1\. WHAT INFORMATION DO WE COLLECT? ### PERSONAL INFORMATION YOU DISCLOSE TO US We collect personal information that you voluntarily provide to us when you register on the Services, express an interest in obtaining information about us or our products and Services, when you participate in activities on the Services, or otherwise when you contact us. Personal Information Provided by You.The personal information that we collect depends on the context of your interactions with us and the Services, the choices you make, and the products and features you use. The personal information we collect may include the following: names email phone number titles usernames passwords Social Media Login Data. We may provide you with the option to register with us using your existing social media account details, like your Facebook, Twitter, or other social media account. If you choose to register in this way, we will collect the information described in the section called 'HOW DO WE HANDLE YOUR SOCIAL LOGINS?' below. All personal information that you provide to us must be true, complete, and accurate, and you must notify us of any changes to such personal information. ### INFORMATION AUTOMATICALLY COLLECTED We automatically collect certain information when you visit, use, or navigate the Services. This information does not reveal your specific identity (like your name or contact information) but may include device and usage information, such as your IP address, browser and device characteristics, operating system, language preferences, referring URLs, device name, country, location, information about how and when you use our Services, and other technical information. This information is primarily needed to maintain the security and operation of our Services, and for our internal analytics and reporting purposes. Like many businesses, we also collect information through cookies and similar technologies. The information we collect includes: Log and Usage Data. Log and usage data is service-related, diagnostic, usage, and performance information our servers automatically collect when you access or use our Services and which we record in log files. Depending on how you interact with us, this log data may include your IP address, device information, browser type, and settings and information about your activity in the Services (such as the date/time stamps associated with your usage, pages and files viewed, searches, and other actions you take such as which features you use), device event information (such as system activity, error reports (sometimes called 'crash dumps'), and hardware settings). Device Data. We collect device data such as information about your computer, phone, tablet, or other device you use to access the Services. Depending on the device used, this device data may include information such as your IP address (or proxy server), device and application identification numbers, location, browser type, hardware model, Internet service provider and/or mobile carrier, operating system, and system configuration information. Location Data. We collect location data such as information about your device's location, which can be either precise or imprecise. How much information we collect depends on the type and settings of the device you use to access the Services. For example, we may use GPS and other technologies to collect geolocation data that tells us your current location (based on your IP address). You can opt out of allowing us to collect this information either by refusing access to the information or by disabling your Location setting on your device. However, if you choose to opt out, you may not be able to use certain aspects of the Services. ## 2\. HOW DO WE PROCESS YOUR INFORMATION? We process your personal information for a variety of reasons, depending on how you interact with our Services, including: To facilitate account creation, authentication, and/or management. We may process your information so you can create and log in to your account, as well as keep your account in working order. To deliver and facilitate delivery of services to the user. We may process your information to provide you with the requested service. To respond to user inquiries/offer support to users. We may process your information to respond to your inquiries and solve any potential issues you might have with the requested service. To send administrative information to you. We may process your information to send you details about our products and services, changes to our terms and policies, and other similar information. To enable user-to-user communications. We may process your information if you choose to use any of our offerings that allow for communication with another user. To request feedback. We may process your information when necessary to request feedback and to contact you about your use of our Services. To send you marketing and promotional communications. We may process the personal information you send to us for our marketing purposes, if this is in accordance with your marketing preferences. You can opt out of our marketing emails at any time. For more information, see 'WHAT ARE YOUR PRIVACY RIGHTS?' below. To determine the effectiveness of our marketing and promotional campaigns. We may process your information to better understand how to provide marketing and promotional campaigns that are most relevant to you. ## 3\. WHAT LEGAL BASES DO WE RELY ON TO PROCESS YOUR INFORMATION? We may process your information if you have given us specific permission (i.e., express consent) to use your personal information for a specific purpose, or in situations where your permission can be inferred (i.e., implied consent). You can withdraw your consent at any time. Click here to learn more. In some exceptional cases, we may be legally permitted under applicable law to process your information without your consent, including, for example: If collection is clearly in the interests of an individual and consent cannot be obtained in a timely way For investigations and fraud detection and prevention For business transactions provided certain conditions are met If it is contained in a witness statement and the collection is necessary to assess, process, or settle an insurance claim For identifying injured, ill, or deceased persons and communicating with next of kin If we have reasonable grounds to believe an individual has been, is, or may be victim of financial abuse If it is reasonable to expect collection and use with consent would compromise the availability or the accuracy of the information and the collection is reasonable for purposes related to investigating a breach of an agreement or a contravention of the local jurisdiction If disclosure is required to comply with a subpoena, warrant, court order, or rules of the court relating to the production of records If it was produced by an individual in the course of their employment, business, or profession and the collection is consistent with the purposes for which the information was produced If the collection is solely for journalistic, artistic, or literary purposes If the information is publicly available and is specified by the regulations ## 4\. WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION? Vendors, Consultants, and Other Third-Party Service Providers. We may share your data with third-party vendors, service providers, contractors, or agents ('third parties') who perform services for us or on our behalf and require access to such information to do that work. We have contracts in place with our third parties, which are designed to help safeguard your personal information. This means that they cannot do anything with your personal information unless we have instructed them to do it. They will also not share your personal information with any organization apart from us. They also commit to protect the data they hold on our behalf and to retain it for the period we instruct. The categories of third parties we may share personal information with are as follows: Data Analytics Services User Account Registration & Authentication Services We also may need to share your personal information in the following situations: Business Transfers. We may share or transfer your information in connection with, or during negotiations of, any merger, sale of company assets, financing, or acquisition of all or a portion of our business to another company. When we use Google Maps Platform APIs. We may share your information with certain Google Maps Platform APIs (e.g., Google Maps API, Places API). To find out more about Google’s Privacy Policy, please refer to this link. We obtain and store on your device ('cache') your location. You may revoke your consent anytime by contacting us at the contact details provided at the end of this document. Other Users. When you share personal information (for example, by posting comments, contributions, or other content to the Services) or otherwise interact with public areas of the Services, such personal information may be viewed by all users and may be publicly made available outside the Services in perpetuity. If you interact with other users of our Services and register for our Services through a social network (such as Facebook), your contacts on the social network will see your name, profile photo, and descriptions of your activity. Similarly, other users will be able to view descriptions of your activity, communicate with you within our Services, and view your profile. ​ ## 5\. DO WE USE COOKIES AND OTHER TRACKING TECHNOLOGIES? We may use cookies and similar tracking technologies (like web beacons and pixels) to access or store information. Specific information about how we use such technologies and how you can refuse certain cookies is set out in our Cookie Notice. ## 6\. HOW DO WE HANDLE YOUR SOCIAL LOGINS? Our Services offer you the ability to register and log in using your third-party social media account details (like your Facebook or Twitter logins). Where you choose to do this, we will receive certain profile information about you from your social media provider. The profile information we receive may vary depending on the social media provider concerned, but will often include your name, email address, friends list, and profile picture, as well as other information you choose to make public on such a social media platform. We will use the information we receive only for the purposes that are described in this privacy notice or that are otherwise made clear to you on the relevant Services. Please note that we do not control, and are not responsible for, other uses of your personal information by your third-party social media provider. We recommend that you review their privacy notice to understand how they collect, use, and share your personal information, and how you can set your privacy preferences on their sites and apps. ## 7\. HOW LONG DO WE KEEP YOUR INFORMATION? We will only keep your personal information for as long as it is necessary for the purposes set out in this privacy notice, unless a longer retention period is required or permitted by law (such as tax, accounting, or other legal requirements). No purpose in this notice will require us keeping your personal information for longer than the period of time in which users have an account with us. When we have no ongoing legitimate business need to process your personal information, we will either delete or anonymize such information, or, if this is not possible (for example, because your personal information has been stored in backup archives), then we will securely store your personal information and isolate it from any further processing until deletion is possible. ## 8\. HOW DO WE KEEP YOUR INFORMATION SAFE? We have implemented appropriate and reasonable technical and organizational security measures designed to protect the security of any personal information we process. However, despite our safeguards and efforts to secure your information, no electronic transmission over the Internet or information storage technology can be guaranteed to be 100% secure, so we cannot promise or guarantee that hackers, cybercriminals, or other unauthorized third parties will not be able to defeat our security and improperly collect, access, steal, or modify your information. Although we will do our best to protect your personal information, transmission of personal information to and from our Services is at your own risk. You should only access the Services within a secure environment. ## 9\. DO WE COLLECT INFORMATION FROM MINORS? We do not knowingly solicit data from or market to children under 18 years of age. By using the Services, you represent that you are at least 18 or that you are the parent or guardian of such a minor and consent to such minor dependent’s use of the Services. If we learn that personal information from users less than 18 years of age has been collected, we will deactivate the account and take reasonable measures to promptly delete such data from our records. ## 10\. DO WE COLLECT INFORMATION FROM MINORS? In some regions, you have certain rights under applicable data protection laws. These may include the right (i) to request access and obtain a copy of your personal information, (ii) to request rectification or erasure; (iii) to restrict the processing of your personal information; and (iv) if applicable, to data portability. In certain circumstances, you may also have the right to object to the processing of your personal information. You can make such a request by contacting us by using the contact details provided in the section 'HOW CAN YOU CONTACT US ABOUT THIS NOTICE?' below. We will consider and act upon any request in accordance with applicable data protection laws. If you are located in the EEA or UK and you believe we are unlawfully processing your personal information, you also have the right to complain to your local data protection supervisory authority. Withdrawing your consent: If we are relying on your consent to process your personal information, which may be express and/or implied consent depending on the applicable law, you have the right to withdraw your consent at any time. You can withdraw your consent at any time by contacting us by using the contact details provided in the section 'HOW CAN YOU CONTACT US ABOUT THIS NOTICE?' below. However, please note that this will not affect the lawfulness of the processing before its withdrawal nor, when applicable law allows, will it affect the processing of your personal information conducted in reliance on lawful processing grounds other than consent. Opting out of marketing and promotional communications:You can unsubscribe from our marketing and promotional communications at any time by clicking on the unsubscribe link in the emails that we send, or by contacting us using the details provided in the section 'HOW CAN YOU CONTACT US ABOUT THIS NOTICE?' below. You will then be removed from the marketing lists. However, we may still communicate with you — for example, to send you service-related messages that are necessary for the administration and use of your account, to respond to service requests, or for other non-marketing purposes. ACCOUNT INFORMATION If you would at any time like to review or change the information in your account or terminate your account, you can: Log in to your account settings and update your user account. Contact us using the contact information provided. Upon your request to terminate your account, we will deactivate or delete your account and information from our active databases. However, we may retain some information in our files to prevent fraud, troubleshoot problems, assist with any investigations, enforce our legal terms and/or comply with applicable legal requirements. Cookies and similar technologies: Most Web browsers are set to accept cookies by default. If you prefer, you can usually choose to set your browser to remove cookies and to reject cookies. If you choose to remove cookies or reject cookies, this could affect certain features or services of our Services. ## 11\. CONTROLS FOR DO-NOT-TRACK FEATURES Most web browsers and some mobile operating systems and mobile applications include a Do-Not-Track ('DNT') feature or setting you can activate to signal your privacy preference not to have data about your online browsing activities monitored and collected. At this stage no uniform technology standard for recognizing and implementing DNT signals has been finalized. As such, we do not currently respond to DNT browser signals or any other mechanism that automatically communicates your choice not to be tracked online. If a standard for online tracking is adopted that we must follow in the future, we will inform you about that practice in a revised version of this privacy notice. ## 12\. DO CALIFORNIA RESIDENTS HAVE SPECIFIC PRIVACY RIGHTS? California Civil Code Section 1798.83, also known as the 'Shine The Light' law, permits our users who are California residents to request and obtain from us, once a year and free of charge, information about categories of personal information (if any) we disclosed to third parties for direct marketing purposes and the names and addresses of all third parties with which we shared personal information in the immediately preceding calendar year. If you are a California resident and would like to make such a request, please submit your request in writing to us using the contact information provided below. If you are under 18 years of age, reside in California, and have a registered account with Services, you have the right to request removal of unwanted data that you publicly post on the Services. To request removal of such data, please contact us using the contact information provided below and include the email address associated with your account and a statement that you reside in California. We will make sure the data is not publicly displayed on the Services, but please be aware that the data may not be completely or comprehensively removed from all our systems (e.g., backups, etc.). ## 13\. DO WE MAKE UPDATES TO THIS NOTICE? We may update this privacy notice from time to time. The updated version will be indicated by an updated 'Revised' date and the updated version will be effective as soon as it is accessible. If we make material changes to this privacy notice, we may notify you either by prominently posting a notice of such changes or by directly sending you a notification. We encourage you to review this privacy notice frequently to be informed of how we are protecting your information. ## 14\. HOW CAN YOU CONTACT US ABOUT THIS NOTICE? Please send us an email using the Contact Us information left on the main page. ## Dream Machine API # Dream Machine API /enabling state of the art video generation from texts or images PiAPI's unofficial API for [Dream Machine](https://lumalabs.ai/dream-machine)(released by Luma Labs) enables developers like you to bring the best video generation capabilities to your users! [Get Started!](https://piapi.ai/workspace/luma) [API Docs](https://piapi.ai/docs/dream-machine/video-creation) [Join Discord](https://discord.gg/qRRvcGa7Wb) ## Features Image Upload Supported Want to generate videos based on your prompts and the desired image you have in mind? Pass the image URL into the prompt parameter and get started from there! Enhance Prompt Feature Supported The API supports the "Enhance Prompt" web feature with the "expand\_prompt" parameter Extend Function Supported Like a specific clip generated and want to extend it further? We support Dream Machine's extend feature through the API endpoint. Bulk Generation Available Looking to perform a large amount of text-to-video generation tasks for your own site or your own database? Contact us on Discord with your prompts and we will get back to you as soon as possible! Pay-as-you-go and Host-your-account Similar to our other APIs, we provide two service options for our Dream Machine API as well: Host-your-own-account if you have your own supply of Dream Machine accounts, or just purchase PiAPI credits with the Pay-as-you-go option and use our PiAPI accounts! Asynchronous API Calls With our asynchronous functionality, users can submit tasks and their program will keep running until the callback function triggers, thus preventing interruption to their program. Watermark Removal By subscribing to PiAPI's Premium Subscription Plan, users will be able to remove the "LUMA" watermark on the top right corner of the generated video. Priority Generations By subscribing to PiAPI's Premium Subscription Plan, users will enjoy the highest priority generations, making it an ideal option during peak load and high demand! Commercial Use If the users are subscribed to the Premium Plan, then the generated video outputs are then permitted to be used commerically to suit their needs. ## Our Pricing Plans ### "Pay-as-you-go" Option Standard $0.30/call - Access to the latest text-to-video generation API Custom Dedicated Deployment Contact Us - Faster speed & lower latency - Support High Concurrency - Priority Access & Autonomy ### "Host-your-account" Option Flat Pricing What’s included - Connect your own Dream Machine accounts! - Access to all our Dream Machine API features - Hosting multiple accounts supported - Load Balancer for multi-accounts Stable and Safe $10/seat/month ### Check our Pricing page for more information [Detailed Dream Machine Pricing](https://piapi.ai/pricing) [Get Started!](https://piapi.ai/workspace/luma) ## Our blog Check out our blog for related contents! ![An image of Kling API & Luma API](https://piapi.ai/images/Lumalab/kling_api_and_luma_api.webp) Dream Machine API ### [Crush it Melt it through Pika API , Kling API & Luma API](https://piapi.ai/blogs/crush-it-melt-it-through-pika-api-kling-api-and-luma-api) In this blog we will be exploring the new Crush It Melt It trend and see if Luma API and Kling API can do as well as Pika API! ![An image of Luma's Dream Machine 1.6](https://piapi.ai/images/Lumalab/luma_1_6.webp) Dream Machine API ### [Luma's Dream Machine 1.6 - Testing Camera Motion Feature through Luma API!](https://piapi.ai/blogs/luma-dream-machine-1-6-testing-camera-motion-feature-through-luma-api) Introducing the new Camera Motion Feature from Luma's Dream Machine 1.6 ! ![An image of Luma Dream Machine vs Kling](https://piapi.ai/images/Lumalab/Luma_vs_Kling.webp) Dream Machine API ### [Luma Dream Machine vs Kling - A brief comparsion using APIs](https://piapi.ai/blogs/luma-dream-machine-vs-kling-a-brief-comparsion-using-apis) Comparing the same-prompt-outputs of Luma's Dream Machine and Kuaishou's Kling, results are generated using their respective APIs ![Luma Dream Machine 1.5 vs 1.0](https://piapi.ai/images/Lumalab/Luma_vs.webp) Dream Machine API ### [Luma Dream Machine 1.5 vs 1.0 - Comparison through Luma API](https://piapi.ai/blogs/luma-dream-machine-1-5-vs-1-0-comparison-through-luma-api) A detailed comparison between Luma's Dream Machine version 1.5 compared to previous version, using the Luma API to generate videos compared ## Other APIs from us! We are the **all-in-one generative AI API provider** on the market, delivering all the AI APIs you need for your generative AI applications! We also provide custom model deployment solutions! ![A face swapped image from PiAPI's Faceswap API](https://piapi.ai/images/Lumalab/Faceswap_banner.webp) ### [Faceswap API](https://piapi.ai/faceswap-api) Discover the power of our Faceswap API - the perfect way to add a touch of fun and interactivity to your applications. With our automatic face detection capability, high concurrency performance, and low latency, your users can effortlessly swap faces and enjoy a personalized and engaging experience! ## Frequently asked questions What is Dream Machine? [Dream Machine](https://lumalabs.ai/dream-machine) is developed by Luma Labs is an AI model that makes high quality, realistic videos fast from text and images. The generated videos physically accurate, showing consist characters, and has natural but impact shot from Luma AI. What is the Dream Machine API? Since Luma Lab currently does not offer Dream Machine API as part of their [Luma API](https://lumalabs.ai/luma-api), therefore PiAPI took on initiative and created the unofficial Dream Machine API for developers worldwide, allowing you to embed the state-of-the-art text-to-video / image-to-video capabilities into your application or platform! What type of videos can I make with the Dream Machine API? Dream Machine can help your users create all types of high-quality videos, whether the starting point is a simple prompt or an image. Dream Machine can iterate incredibly fast (generating 120 frames in about 120 seconds), and output videos would have accurate real-world physics, consistent character between frames, and optimized camera trajectory matching the intent of the scene! What are the current limitations with regarding to video generated? As good as the current model is now, there are still some limitations. For example, in complex, action-packed scene such as a car drifting on snow-covered roads, object morphing can occur, Occasionally, objects that are supposed to be moving remain static. Accurate text displaying also requires further improvement. Can you offer the video preview feature during the generation process? Currently Luma does not offer this feature as part of the Dream Machine Web platform, but when they do, PiAPI will integrate this feature into our supported features. Can I use videos generated from the Dream Machine API for commercial purposes? According to the current [Terms Of Service](https://lumalabs.ai/legal/tos) from Luma Labs, it seems that customer can use the outputs for commercial purposes if the outputs were produced under Customer’s paid subscription allowing for the commercial use of outputs. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you are given free credits to try our Dream Machine API (specifically the "Pay-as-you-go" service) before making payments! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to listen to your feedback and explore potential collaborations! ## Trellis 3D API # Trellis 3D / state-of-the-art 3D Generation Model & Trellis API! The [open source image to 3d models](https://github.com/microsoft/TRELLIS) from the official research paper [Structured 3D Latents for Scalable and Versatile 3D Generation](https://trellis3d.github.io/) is the state-of-the-art text to 3D and image to 3D generation AI model. And now PiAPI is providing the AI 3D model generator and the Trellis API for creators to use and supercharge their 3D workflow! [Get started!](https://piapi.ai/workspace/trellis) [API Docs→](https://piapi.ai/docs/trellis-api/create-task) ![a picture of a Black Forest with the word Flux spelled out - generated by Flux-dev model](https://piapi.ai/images/trellis/trellis.jpg) ![Image 1](https://static.piapi.ai/trellis/building_building/original.png) ![Image 2](https://static.piapi.ai/trellis/building_colorful_cottage/original.png) ![Image 3](https://static.piapi.ai/trellis/creature_rock_monster/original.png) ![Image 4](https://static.piapi.ai/trellis/humanoid_block_robot/original.png) ![Image 5](https://static.piapi.ai/trellis/humanoid_dwarf/original.png) ![Image 6](https://static.piapi.ai/trellis/humanoid_goblin/original.png) Generate OR [Try with your own image](https://piapi.ai/workspace/trellis)! Generation Result ## Features Image to 3D Generation! PiAPI will be the first to offer image to 3D Trellis 3D and Trellis API - simplifying 3D asset generation workflow of 3D artists around the world! Text to 3D Generation PiAPI will continually observe the latest research on 3D generation and deploy any model that shows any promising result in text-to-3D generation. Asynchronous API Calls The API will be designed to allow for asynchronous calls, allowing developers to "submit and forget" tasks, and fetch for the task when completed. Accelerated Hardware Infrastructure Our accelerated hardware infrastructure is specifically optimized for latent diffusion model inference work, ensuring workloads to be executed with maximum efficiency and minimum latency. Custom Inference Frameworks Our custom inference framwork used for latent diffusion model workloads focus on optimized runtime performance and resource management, preventing bottlenecks from traditional framework. Bulk Generation Available The perfect generation option for developers to populate their 3D projects with large quantity of custom 3D models from custom prompts and/or images. Contact us on Discord with your prompts and we will get back to you with a pricing and a timeline! Simple and Flexibe Payment Plans Our Pay-as-you-go option allows developers to test the API with free credits, and purchase credits for consumption, and manually or automatically top-up their credits as their usage varies. Commercial Use Given the commercial license of the Trellis model, all images generated from our API using that model will be available for commercial use as needed by the creators or 3D artists. ## Our Pricing Plans ### Image to 3D Generation $0.04/generation - 50% cheaper than similar Replicate APIs! ### Text to 3D Generation coming soon! - Integrating state-of-the-art image model as part of the 3D generation workflow! [Detailed Trellis 3D API pricing](https://piapi.ai/pricing) [Get Started](https://piapi.ai/workspace/trellis) ## Our blog Check out our blog for related contents! ![3D Trellis API through PiAPI](https://piapi.ai/images/trellis/trellis_use.webp) Trellis 3D API ### [3D Trellis API through PiAPI](https://piapi.ai/blogs/3d-trellis-api-through-piapi) PiAPI has recently launched our very own 3D Trellis API! ## Frequently asked questions What is the Trellis 3D Model? The Trellis 3D Generation Model is developed by [Microsoft's Trellis Research Team](https://github.com/microsoft/TRELLIS). It is the most advanced 3D generation AI model in the market, dedicated to simplify creator's 3D workflow with the power of generative AI! What is the Trellis 3D API? The Trellis API are offered by PiAPI based on the Trellis model. Given our accelerated hardware infrastructure and custom-developed inference framework, PiAPI is able provide APIs for these two models at very market competitive costs while maintaining performance and minimizing latency! What type of 3D model can I generate with the text to 3d model? With the significant quality, users can use the picture to 3d model with various kinds using textual prompts or image prompts in their workflow! What type of scenarios can Trellis be used for? The photo to 3D model can be used in a variety of usecases. For example, if you are using Object AI to create your 2D images, you can use use the AI tool to generate the corresponding 3D model; our 2D to 3D model AI generator can produce high quality 3D asset. Or let's say you are interested in 3D character creation, our AI generator could be used to create made up 3D characters. Or if you have a wesbite for 3d assets trading, this tool could be used to populate the website with AI generated 3d models. Can I use 3D models generated from the Trellis API for commercial purposes? Given the Apache2.0 license of the Trellis 3D, all images generated from our API using that model will be available for commercial use as needed by 3D artists or creators! Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI‘s Workspace, you will be given free credits, which can be used as free AI for 3d models and API calls! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to talk more regarding our product offering! ## DeepSeek API Overview # Cost effective, open source, powerful LLMDeepSeek API Integrate the first generation of reasoning model API for DeepSeek with the R1 (671B) model! Power your LLM tasks with the most cost-efficient inference framework and infrastructure from PiAPI! [Get started!](https://piapi.ai/workspace/) [API Docs](https://piapi.ai/docs/llm-api/deepseek) [Join Discord](https://discord.gg/qRRvcGa7Wb) ![An image Benchmark Performance of DeepSeek-R1](https://piapi.ai/images/deepseek/DeepSeek_Benchmark_Performance.png) About our DeepSeek R1 API! Cost Effective.With superior inference infrastructure, we are able to provide extremely cost competitive API service for DeepSeek R1 model! Adequate Token Throughput.We work hard to keep our output token per seconds (TPS) level of 6 words per second for our users and their applications! Reinforcement Learning.R1-Zero demonstrates chain-of-thought (CoT) purely through reinforcement learning (RL), without relying on supervised fine-tuning (SFT). Multi-Stage Training with Cold Start Data.DeepSeek incorporates cold-start data to fine-tune the base model, with reasoning-oriented RL, rejection sampling, and supervised fine-tuning, achieving performance comparable to OpenAI-o1-1217. Distillation for Smaller Models.DeepSeek enables the distillation of reasoning capabilities into smaller dense models. By fine-tuning open source models like Qwen and Llama with the 800k samples from R1. Strong Performance across Diverse Tasks.R1 scores 79.8% Pass@1 on AIME 2024, and 97.3% on MATH - 500, on par with OpenAI-o1-1217. It also excels in coding-related tasks, achieving a high rating on Codeforces, and in other tasks such as creative writing, general question answering, and long - context understanding Easy Setup and Integration.Integrating our API is a hassle-free setup process with simple HTTPs calls, making it easy to integrate within any tech stack. Webhook.We will notify you of a completed task through our webhook feature, to avoid repeated fetch calls made through the network. Pricing Competitive Unit Pricing Based on Innovative Inference Infrastructure! ### Model: DeepSeek-Chat 1 \| Pricing - $0.30 per 1M Input Tokens - $1.8 per 1M Output Tokens 4 - Context Length: 64K - Maximum CoT Token2: N/A - Maximum Output Token3: 8K ### Model: DeepSeek-Reasoner 1 \| Pricing - $0.60 per 1M Input Tokens - $3.6 per 1M Output Tokens 4 - Context Length: 64K - Maximum CoT Token2: 32K - Maximum Output Token3: 8K (1) The DeepSeek-chat model points to the DeepSeek-V3 model.The DeepSeek-Reasoner model points to the new DeepSeek-R1 model. (2) CoT (Chain of Thought) is the reasoning content that DeepSeek-Reasoner provides before outputting the final answer. (3) If the max\_tokens is not specified, then the default maximum output length is 4K. Please adjust max\_tokens to support longer outputs. (4) The output token count of DeepSeek-Reasoner includes all tokens from CoT and the final answer, and they are priced equally. (5) For detailed advanced API doc please refer to https://api-docs.deepseek.com/guides/reasoning\_model. ## Frequently asked questions What is PiPAI's DeepSeek API? Our DeepSeek API is provided on [PiAPI's](https://piapi.ai/) custom AI inference framework and infrastructure, which allows developers to integrate the advanced, cost-effective LLM capability Chat and Reasoning from [R1](https://github.com/deepseek-ai/DeepSeek-R1) and [V3](https://github.com/deepseek-ai/DeepSeek-V3) into their own apps or platforms! Who is the intended user for the DeepSeek API? The DeepSeek API is created for developers who want to incorporate state of the art language and reasoning capabilities into their generative AI applications. This feature is ideal for any AI powered coding assistants, literature review, documentation summary, translation applications, marketing and advertising related applications. How to get started with integrating the API? After registering for an account on PiAPI, you will get some free credits to try the API. Using your own API-KEY you can start making HTTPs calls to the API! How do I make calls to the API? You can call our API using HTTPS Post and Get methods from within your application. A wide range of programming languages that support HTTP methods (ex. Python, JavaScript, Ruby, Java, etc.) can be used to make the call! Is there a limit to the total number of requests or concurrent number of requests I can make? We will queue your concurrent jobs if the number of your concurrent jobs exceeds a certain threshold. In terms of total number of requests, you can make as many requests as your credit amount allows. How does the API handle errors? Our API returns error codes and messages in the HTTP response to help identify the issue. Please refer to our documentation for more details. Can you provide dedicated deployment for this API? Yes, absolutely! We provide custom solutions for clients with specialized requirements (ex. low latency, higher concurrency, fine-tuned DeepSeek models, etc), and we do provide cost-effective and performance-enhanced solutions for these LLM usecases! What is the license for the DeepSeek model? The DeepSeek Models have a [custom open-source license](https://piapi.ai/) and it is permissible for commercial use for any lawful purpose. Developers do not need to register or apply with DeepSeek before using the open-source models. Developer can also develop derivative models and product applications based on the Models. What is the pricing options for the API? We offer the API through a pay-as-you-use system, you can purchase credits on our Workspace and monitor the remaining credits. The per-use cost of the API is reflected on upper portion this page. Please note that the credits purchased do expire in 180 days after purchase. How do I pay for this API? We have integrated Stripe in our payment system, which will allow payments to be made from most major credit card providers. Are there refunds? No, we do not offer refunds. But when you first sign up for an account on PiAPI's Workspace, you are given free credits to try our service before making payments! How can I get in touch with your team? Please email us at [support@piapi.ai](mailto:support@piapi.ai)\- we'd love to listen to your feedback and explore potential collaborations! ## Image and Video Enhancement # Clean & Upscale API Playground Overview Run API Task History ## Create Task MODEL [Qubico/image-toolkit](https://piapi.ai/docs/image-editing-api/super-resolution-api) PiAPI‘s Clean & Upscale API provides essential tools for image and video processing, including image background removal, image upscaling, and video upscaling. These tools help quickly improve media quality, making it easy to enhance and refine images and videos. TASK TYPEImage Upscaling ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body image\*string Upload the url of the image that you want to upscale, both width and height of the image should be no more than 2048 pixels scalenumber 248 RunReset ## Get Task ### Task Result ![Generated Image](https://piapi.ai/workspace/tool/image_upscale_ouput.png) Task Logs ``` No logs yet. ``` ## Fast AI Music Generator # Diffrhythm API Playground Overview Run API Task History API Settings ## Create Task MODEL [Qubico/diffrhythm](https://piapi.ai/diffrhythm) DiffRhythm is a fast AI music generator that is able to create full songs with synchronized vocals and instrumentals in 10 seconds. It supports English and Chinese lyrics and delivers high-quality, coherent tracks up to 4’45’’ long. TASK TYPEtxt2audio-base (1’35’’) ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body Style Prompt\*string The type of music that you want to create (Like pop, jazz, etc). Advanced Settings RunReset ## Get Task ### Task Result Your browser does not support the audio element. Task Logs ``` No logs yet. ``` ## AI Hug API # AI Hug API Playground Overview Run API Task History ## Create Task MODEL [Qubico/hug-video](https://piapi.ai/docs/ai-hug-api/create-task) The AI Virtual Hug Tool by Qubico/hug-video offers a heartwarming way to connect like never before. Feel the warmth, share the comfort, and send hugs that transcend distance—creating moments of love and support anytime, anywhere. TASK TYPEimage\_to\_video ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body image\*string Upload Upload the reference image you want to use for generation. RunReset ## Get Task ### Task Result Your browser does not support the video tag. Task Logs ``` No logs yet. ``` ## AI Face Swap Tool # Faceswap Playground Overview Run API Task History ## Create Task MODEL [Qubico/image-toolkit](https://piapi.ai/faceswap-api) piapi’s Faceswap API is based on a custom AI model, which allows users to seamlessly swap one face with another. TASK TYPEface-swap ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body target image\*string Upload Upload the image URL into this parameter (the URL should end with '.png', '.jpeg', or Base64 string). The face in this image will be swapped out with the swap\_image face. swap image\*string Upload Upload the image URL into this parameter (the URL should end with '.png', '.jpeg', or Base64 string). The face in this image will swapped be onto the target\_image face. RunReset ## Get Task ### Task Result ![Generated Image](https://piapi.ai/workspace/templates/facewap_output.png) Task Logs ``` No logs yet. ``` ## Hailuo API Overview # Hailuo API Playground Overview Run API Task History API Settings ## Create Task MODEL [Hailuo](https://piapi.ai/hailuo) This endpoint utilizes the Hailuo API's i2v-01-live, i2v-01-live-live, t2v-01, and s2v-01 models to generate videos from images and text. TASK TYPEimg2video ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body image\*string Upload Upload the reference image you want to use for generation. prompt\*string The input or instruction you provide to the AI to guide the generation of content. Advanced Settings RunReset ## Get Task ### Task Result Your browser does not support the video tag. Task Logs ``` No logs yet. ``` ## FLUX.1 API Overview # Flux.1 API Playground Overview Run API Task History API Settings ## Create Task MODEL [Qubico/flux1-dev-advanced](https://piapi.ai/flux-api) The FLUX.1 API is a fast AI visual generation tool supporting both text-to-image and image-to-image modes. It offers drei models—schnell, dev, and dev-advanced—suited for local, research, and commercial use. Ideal for art, prototyping, and creative workflows, FLUX.1 delivers high-quality visuals with speed and flexibility. TASK TYPEimg2img-kontext ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body image\*string Upload Upload the reference image you want to use for generation. prompt\*string The input or instruction you provide to the AI to guide the generation of content. Advanced Settings RunReset ## Get Task ### Task Result ![Generated Image](https://piapi.ai/workspace/flux/output_kontext_example.png) Task Logs ``` No logs yet. ``` ## Hunyuan API Overview # Hunyuan API Playground Overview Run API Task History ## Create Task MODEL [Hunyuan](https://piapi.ai/docs/hunyuan-video/txt2video-api) Hunyuan API powered by Tencent, provides advanced AI capabilities such as text-to-video function. Accessing the API is made easy through [PiAPI](https://piapi.ai/), which offers a secure, scalable platform for developers, providing features like authentication, access control, and robust support. TASK TYPEtxt2video ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body prompt\*string The input or instruction you provide to the AI to guide the generation of content. Advanced Settings RunReset ## Get Task ### Task Result Your browser does not support the video tag. Task Logs ``` No logs yet. ``` ## Kling Effect API # Kling Effect API Playground Overview Run API Task History ## Create Task MODEL [Kling](https://piapi.ai/docs/kling-api/kling-effects) PiAPI‘s Kling Effect provide ways to establish expansion and squish style of images. These tools could help users create vivid and interesting scenarios of expansion and squish and explore more possibilities with lots of fun. TASK TYPEexpansion ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body image\*string Upload the url of the image that you want to upscale, both width and height of the image should be more than 300 pixels and the size of image should not be more than 10MB. RunReset ## Get Task ### Task Result Your browser does not support the video tag. Task Logs ``` No logs yet. ``` ## Kling API Overview # Kling Playground Overview Run API Task History API Settings ## Create Task MODEL [Kling](https://piapi.ai/kling-api) This endpoint from PiAPI's Kling API utilizes Kling AI model by Kuaishou to produce text/image-to-video generation. TASK TYPEtxt2video ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body prompt\*string The input or instruction you provide to the AI to guide the generation of content. Advanced Settings RunReset ## Get Task ### Task Result Your browser does not support the video tag. Task Logs ``` No logs yet. ``` ## Luma Dream Machine # Luma Dream Machine Playground Overview Run API Task History API Settings ## Create Task MODEL [Luma](https://piapi.ai/dream-machine-api) This endpoint from Dream Machine API utilizes Dream Machine model by Luma Labs to produce text/image-to-video generation. TASK TYPEtxt2video ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body prompt\*string The input or instruction you provide to the AI to guide the generation of content. Advanced Settings RunReset ## Get Task ### Task Result Your browser does not support the video tag. Task Logs ``` No logs yet. ``` ## MMAudio API Overview # MMAudio API Playground Overview Run API Task History API Settings ## Create Task MODEL [Qubico/mmaudio](https://piapi.ai/docs/mmaudio-api/create-task) piapi’s mmaudio API provides users with the ability to transform silent videos into immersive audio experiences. Powered by advanced AI, it analyzes video content and generates perfectly matched, professional soundtracks in minutes. TASK TYPEvideo2audio ### Header X-API-KEY\*string Your default API Key used for request authorization. ### Body Prompt\*string The input or instruction you provide to the AI to guide the generation of content. Video\*string Upload Upload the video for which you want to generate background audio. The video must be in MP4 format and no larger than 10MB. Advanced Settings RunReset ## Get Task ### Task Result Your browser does not support the video tag. Task Logs ``` No logs yet. ``` Playground Overview Run API Task History API Settings * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Kling Elements API Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Kling Elements through Kling API ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/2f665a1630738f17c3d81f79860bbe93fa20bcb2-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI February 13, 2025 Hi Developers! On January 21st, 2025, the team behind [Kling AI](https://www.klingai.com/) has just released Kling Elements, a major update for Kling, making the [announcement](https://x.com/Kling_ai/status/1881712910789173358) in a post on X! And here at [PiAPI](https://piapi.ai/), we already have [Kling elements](https://piapi.ai/docs/kling-api/kling-elements) available for our users through our [Kling API](https://piapi.ai/kling-api)! ![A screenshot of the official announcement on X about Kling Elements](https://cdn.sanity.io/images/pr53lcef/production/76662730afeef0dc151a88d993a07987377d4de3-816x707.png?q=75&fit=clip&auto=format)Official announcement on X about Kling Elements So how exactly does Kling Elements improve on the current image to video AI generation model? Kling Elements allows users to upload up to 4 images as elements (such as people, animals, objects, or scenes) and describe their actions and interactions within the prompt. Kling API then generates a video based on the elements (images used as input) and the prompt, ensuring that the video maintains a consistent style and appearance. This feature is especially useful for achieving consistency in character design and objects, ensuring they remain consistent with the images uploaded when the Kling API generates a video. ## **Evaluation Framework** Regarding the evaluation framework used for this comparison, we have taken the [AIGCBench (Artificial Intelligence Generated Content Bench)](https://www.benchcouncil.org/AIGCBench/). Although this is a framework designed to be used by computers, we've adjusted it for human evaluation, adapting it from an automated system into a manual process. This is the same framework we had used in our [previous blog about Kling Motion Brush,](https://piapi.ai/blogs/the-motion-brush-feature-through-kling-api) namely: 1. 1\. Control Video Alignment (Prompt adherence) 2. 2\. Motion Affects 3. 3\. Temporal Consistency 4. 4\. Video Quality For what each of these categories means and how they could be rated, feel free to read our previous blog for more detail. ## **Testing Kling Elements through Kling API** For the upcoming tests, we will first present the images that will be used as input into Kling API using the Kling Elements feature. Afterward, we’ll showcase the video generated, along with the corresponding prompt. ### **Example 1: Drake vs Kendrick** For our first example, we’ll focus on Drake and Kendrick Lamar, especially since Kendrick recently performed at the Super Bowl. Given that the topic of Drake vs Kendrick has been the talk of the town lately, we thought this would be an interesting choice. Below is an image of the 4 Kling elements we are going to use as input into Kling API, alongside a description of each element: Element 1: A picture of Kendrick Lamar Element 2: A picture of Drake Element 3: A picture of the super bowl stadium Element 4: A picture of the Grammy award ![PNG image of the 4 Kling elements that are going to be used as input into Kling API for the Drake vs Kendrick example](https://cdn.sanity.io/images/pr53lcef/production/0f3dd58bcc77b76380653ae85d33989777968fe3-800x600.png?q=75&fit=clip&auto=format)The 4 Kling elements that are going to be used as input into Kling API for the Drake vs Kendrick example And here is the output video, along with the prompt shown in the description. ![A GIF of Kendrick Lamar and Drake fighting over a Grammy award generated by Kling API using Kling elements](https://cdn.sanity.io/images/pr53lcef/production/9392ca888e6610a094efa1597dd132a06470312b-600x338.gif?q=75&fit=clip&auto=format)Prompt: "Kendrick Lamar and Drake in the super bowl stadium fighting over a Grammy award" **Control-Video Alignment** For control-video alignment, the result closely follows both the prompt and the provided images as both Kendrick Lamar and Drake have the same facial features and are wearing the exact clothes from the images used as input. However, it is far from perfect. A few noticeable issues include the a minor chain that Kendrick Lamar is wearing, which doesn’t resemble a lowercase "a" as seen in the image, but rather looks more like the number "8." Another major issue is with the Super Bowl stadium, which appears more like a concert venue, as there is no visible football field. **Motion Affects** In terms of motion effects, the movements of both Kendrick Lamar and Drake appear quite realistic and dynamic. Kendrick turns towards Drake at the beginning, and Drake’s hands move noticeably as he shifts back and forth. **Temporal Consistency** For temporal consistency, there are two noticeable artifacts. The first is that the person standing behind Kendrick Lamar appears as a garbled, humanoid mess, making it unclear what it is supposed to be. Our best guess is that Kling was attempting to create a mascot character, possibly due to the mention of a "Super Bowl stadium" in the prompt. The second, less noticeable artifact occurs midway through the video when Kendrick Lamar raises his left hand for the first time—he seems to be holding what looks like a microphone, but it suddenly disappears. **Video Quality** For video quality, there is a noticeable issue at the beginning of the video, where Kendrick Lamar's face and hands are heavily blurred for some reason, before returning to normal later on. Overall, even though the output for this example is very impressive for character consistency, there are still quite a few errors and artifacts present in the video. ### **Example 2: Duolingo Owl Death and Revival** For our second example, we’ll attempt to revive the Duolingo Owl, following the recent announcement of the Duolingo Owl Death on their official Twitter account. Using the Kling API, we’ll try to bring the owl back to life. Below is an image of the two Kling elements we are going to use as input into Kling API, alongside a description of each element: Element 1: A picture of the Duolingo Owl Element 2: A picture of a cartoon graveyard ![PNG image of the 2 Kling elements that are going to be used as input into Kling API for the Duolingo Owl Death and Revival example](https://cdn.sanity.io/images/pr53lcef/production/82693207caac73e1d8ca1bbfbfe8d885284d997c-800x600.png?q=75&fit=clip&auto=format)The 2 Kling elements that are going to be used as input into Kling API for the Duolingo Owl Death and Revival example And below is the output video, alongside the prompt shown in the description. ![GIF of the duolingo owl flying towards the viewer in a cartoon graveyard generated by Kling API using Kling elements](https://cdn.sanity.io/images/pr53lcef/production/72c3c35a601ace9e10f1e1614a2097f45abbd3c3-600x338.gif?q=75&fit=clip&auto=format)Prompt: "A cartoon-style green Duolingo owl rising from a grave in a graveyard like a zombie, first sticking a green wing out of the grave before fully popping out" **Control-Video Alignment** For control-video alignment, both the Duolingo owl and the cartoon graveyard are generated very impressively in the video. However, it doesn’t fully follow the prompt. The Duolingo owl is positioned atop the grave from the start, instead of rising like a zombie and sticking its green wing out of the grave as prompted. **Motion Affects** In terms of motion effects, the video is pretty dynamic, with the camera slowly zooming in and the Duolingo owl flapping its wings slightly before flying towards the viewer. However, the dust effects during its jump appear too realistic and don't match the cartoonish style of the Duolingo owl and the graveyard background. **Temporal Consistency** For this example, there appear to be no issues with temporal consistency, and everything seems to be good. **Video Quality** Throughout the video, there are moments where the Duolingo Owl's eyes appear slightly blurred; aside from that, there are no issues. Overall, it is similar to the last example, the character and background consistency is very impressive but has some minor issues quality-wise. ### **Example 3: Donald Trump wearing a Philadelphia Eagles jersey** For our third example, we’ll have Donald Trump wearing a Philadelphia Eagles jersey, celebrating the Eagles super bowl wins in 2025. Given the Super Bowl season, or "Super Bowl time" as some would call it, we thought this would be a fun and fitting example. Below is an image of the 4 Kling elements we are going to use as input into Kling API, alongside a description of each element: Element 1: A picture of a Philadelphia Eagles jersey Element 2: A picture of Donald Trump Element 3: A picture of a bald eagle Element 4: A picture of the super bowl stadium ![An image of the 4 Kling elements that are going to be used as input into Kling API for the Donald Trump wearing a Philadelphia Eagles Jersey ](https://cdn.sanity.io/images/pr53lcef/production/6e6a6740eb4154cf56306d84b4e9284a3d103de2-800x600.png?q=75&fit=clip&auto=format)The 4 Kling elements that are going to be used as input into Kling API for the Donald Trump wearing a Philadelphia Eagles Jersey And below is the output video, alongside the prompt shown in the description. ![GIF of Donald Trump wearing a green philadelphia eagles jersey with an eagle perched on his shoulder, gazing down at a stadium filled with cheering fans generated by Kling API using Kling elements](https://cdn.sanity.io/images/pr53lcef/production/a5e7bd356e120980040726c1d98d3665555ab9c8-600x338.gif?q=75&fit=clip&auto=format)Prompt: "Donald Trump wearing a green Philadelphia Eagles jersey, with a bald eagle perched on his shoulder, gazing down at a Super Bowl stadium filled with cheering fans" **Control-Video Alignment** This example appears to have followed the prompt and input images very closely. The only issue is with Trump’s Philadelphia Eagles jersey, where the text adherence is off, and the back of his shirt differs from the provided image. **Motion Affects** The motion effects are dynamic, with the bald eagle settling on Trump’s shoulder at the start of the video, followed by the camera circling from in front of him to behind. **Temporal Consistency** There is one minor artifact, though it's well-hidden. In the middle of the video, when showing Trump's side view, a man holding a camera appears behind him, but the camera has two lenses, which looks unnatural. **Video Quality** There are two issues with video quality: first, the eagle’s face is slightly blurred throughout, and second, the crowd of people around is heavily blurred. Overall, this is the best example of the Kling Elements feature among all the examples, and it’s very impressive in terms of what it generated. ### **Example 4: Captain America** For our fourth example, we’ll feature Chris Evans as Captain America battling the Red Hulk, given the recent buzz surrounding _Captain America 4_. Below is an image of the 4 Kling elements we are going to use as input into Kling API, alongside a description of each element: Element 1: A picture of Chris Evans Captain America Element 2: A picture of a LEGO Captain America Shield Element 3: A picture of the Red Hulk Element 4: A picture of an asteroid ![An image of the 4 Kling elements that are going to be used as input into Kling API for the Captain America example](https://cdn.sanity.io/images/pr53lcef/production/bff62d7b4cc7f5dc2119d5336e3fc81ebb23e500-800x600.png?q=75&fit=clip&auto=format)The 4 Kling elements that are going to be used as input into Kling API for the Captain America example And below is the output video, alongside the prompt shown in the description. ![GIF of captain america in space with a lego captain america shield, with an asteroid behind him generated by Kling API using Kling elements](https://cdn.sanity.io/images/pr53lcef/production/1609f7e71cefe7948e43ddbf5491fc561e7c4a89-600x338.gif?q=75&fit=clip&auto=format)Prompt: "Chris Evans Captain America, wielding a LEGO Captain America shield, battling the Red Hulk on a moving asteroid" **Control Video Alignment** This example seems to be missing one element entirely, specifically element 3, the Red Hulk, which is not featured in the video. Additionally, it doesn't follow the prompt accurately, as Captain America is not fighting the Red Hulk. However, aside from that, it’s still quite impressive. The rest of the prompt and input images are followed closely, and if you look carefully, you can see that Captain America's shield is made of LEGO, exactly as instructed, and matches the LEGO Captain America shield from the provided image. **Motion Affects** In terms of motion effects, the video is quite dynamic, with the camera zooming in on Chris Evans as Captain America, while the asteroid flies in the background. By the end of the video, it appears that Captain America is preparing for battle. **Temporal Consistency** Regarding temporal consistency, everything seems to be in order, with no visible artifacts. **Video Quality** The video quality for this example is quite good, with minimal blurring. Overall, the character consistency is quite good in this example, but it missed one element, which is a significant issue. ### **Example 5: Anime girl with a black cat** For our final example, we’ll test how well the Kling Elements feature works with the anime art style. Below is an image of the 4 Kling elements we are going to use as input into Kling API, alongside a description of each element: Element 1: An image of an AI generated goth anime girl Element 2: An image of an anime black cat Element 3: An image of a baby wearing a Christmas hat Element 4: An image of an anime background depicting a rainy day in a traditional Japanese town ![An image of the 4 Kling elements that are going to be used as input into Kling API for the Anime girl example](https://cdn.sanity.io/images/pr53lcef/production/72c4c41b80f5bad0aa6b7a73c187f601692ebbdf-800x600.png?q=75&fit=clip&auto=format)The 4 Kling elements that are going to be used as input into Kling API for the Anime girl example And below is the output video, alongside the prompt shown in the description. ![Gif of an AI generated goth anime girl petting a cat wearing a Christmas hat and a red scarf with a rainy traditional japanese town background generated by Kling API using Kling elements](https://cdn.sanity.io/images/pr53lcef/production/6ee05d398d05b5d698404f21bbc73b795d82c75e-600x338.gif?q=75&fit=clip&auto=format)Prompt: "Anime style, a goth girl petting an anime black cat wearing a Christmas hat in her lap, with everything— including the cat and the rainy traditional Japanese town— portrayed in 2D anime style." **Control-Video Alignment** For control-video alignment, the AI Christmas animated black cat is shown in a realistic style, instead of the anime art style as specified in the prompt. Aside from that, everything else is quite impressive. The AI generated goth anime girl matches the image provided exactly, along with the background and Christmas hat. Even though the cat is shown in a realistic style instead of an anime one, it still retains the red scarf as seen in the image used as input. **Motion Affects** The video is dynamic, with the AI generated goth anime girl's hand petting the cat and the cat's head moving in sync with her hand. However, the Christmas hat on the cat appears to be stuck to the girl’s hand instead, as it would have realistically fallen off if it were following real-world physics. **Temporal Consistency** There are several noticeable artifacts in the video. The first is the Christmas hat, which is on the AI generated goth anime girl's hand instead of the cat, as mentioned in the motion effects. The second is that the girl's hand, the one petting the cat, appears more realistic than anime style, which looks out of place. **Video Quality** The only issue with video quality in this example is that the AI Christmas animated black cat's face appears slightly blurred throughout the video. Overall, this example is quite impressive, as the video maintains strong consistency with the images, despite a few issues. ## **Conclusion** Based on the five examples provided, the strengths of the Kling Elements feature are clear. Its character consistency is particularly impressive, with characters appearing exactly as they do in the images or as described in the prompt, including their clothing. The faces of the characters are also quite impressive, closely resembling those in the provided images. However, there are still some weaknesses, such as the blurring of animal faces—in all examples with animals, their faces were either slightly or heavily blurred throughout the video and the artifacts, which, to be fair, are present in most AI-generated videos. Another big issue is that it doesn't always follow the prompt exactly, as seen in example 2, and it missed an element entirely in example 4. In conclusion, the Kling Elements feature is still very impressive, and we look forward to Kuaishou further developing Kling and ironing out the kinks. Also, if you are interested in other [AI APIs that PiAPI provides](https://piapi.ai/), feel free to check them out! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Luma Dream Machine 1.6 Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Luma's Dream Machine 1.6 - Testing Camera Motion Feature through Luma API! ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/382f82204c3877ae7623ec4477ba33e51af0178f-821x1082.png?rect=149,0,524,262&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI September 5, 2024 On September 4th 2024, Luma officially [announced](https://twitter.com/LumaLabsAI/status/1831027696870269188) the release of [Dream Machine 1.6](https://lumalabs.ai/dream-machine/creations) and launching the highly anticipated feature **Camera Motion**. This new feature could elevate the quality of generated videos, allowing users to control camera movements through simple text prompts. In this blog, let's try testing this new feature through [PiAPI's Luma API](https://piapi.ai/dream-machine-api) (and yes - our API already supports this feature!) and see how it actually performs using different prompts! ![A screenshot of Luma's official announcement of Dream Machine 1.6](https://cdn.sanity.io/images/pr53lcef/production/42d062b188d89a1c5310d1da14a4513f4944353f-821x1082.png?q=75&fit=clip&auto=format)Luma's announcement on X about Dream Machine 1.6 ## **What’s New in Dream Machine 1.6** From the introduction of its first version in June 2024, Luma has continued to enhance the Dream Machine mdoel, rolling out version 1.5 in August with features like keyframe creation and improved text-to-video quality. With Dream Machine 1.6, Luma has added **Camera Motion**, giving users control over various camera movements simply by typing commands into the prompt box. This feature includes 12 camera movements such as panning left or right, pushing in or pulling back, orbiting, and even vertical movements like ascents and descents. By typing "Camera" in your prompt box, you can trigger and choose from these preset camera motions, making your videos feel more polished and cinematic. ![A screenshot of using Dream Machine 1.6 Camera Motion, entering "camera" in the prompt and triggering one of the 12 available camera motions. ](https://cdn.sanity.io/images/pr53lcef/production/43f4ed3e3046d385d0e713fe9c0f09a5401aed20-498x374.png?q=75&fit=clip&auto=format)Typing "camera" into prompt and triggering the available camera movements ## **Testing the New Camera Motion Feature through API** And to test this new feature, we will generate three videos using the different styled prompts through our API! ### **Example 1** ![Two GIFs converted from videos of a walking leopard, generated by Luma's Dream Machine](https://cdn.sanity.io/images/pr53lcef/production/cead3a241a7e90866fa59fccfe8aba707bec3012-600x332.gif?q=75&fit=clip&auto=format)Prompt: "A leopard strolls leisurely through a gently falling snowy landscape, its movements slow and graceful. The animal occasionally lifts its paw or playfully snaps at the snowflakes drifting down around it. Soft, warm light bathes the scene." The video without camera motion looks lacking depth, as the camera remained static throughout the scene. While the visuals were pretty good, the shot felt somewhat flat and passive. On the other hand, the video with camera motion is more immersive. The camera gradually zoomed in on the leopard, creating a sense of motion and drawing the viewer into the scene. As the camera pushed closer, the details of the leopard’s movements became more pronounced, adding more engagement. With that being said, we are sure there might be some users who would prefer the without camera motion version. ### **Example 2** ![Two GIFs converted from videos of A woman holds a bright red umbrella in heavy rain, generated by Luma's Dream Machine 1.6](https://cdn.sanity.io/images/pr53lcef/production/392b8a56b2532a5392f37125a903d730548a25c5-600x332.gif?q=75&fit=clip&auto=format)Prompt: "A woman holds a bright red umbrella in the heavy rain, her clothes soaking wet and her hair plastered to her back as she walks along a dimly lit narrow street." The video generated with the prompt without camera movement captures the stormy mood well, but there is some limitations on the overall engagement. While the scene is visually appealing, the absence of camera movement makes the sequence kind of dull. When we add camera motion (in this case we used "move up"), the output video has a a bit more dynamic feel, but one could argue however the upward pan is not very noticeable. ### **Example 3** ![Two GIFs converted from videos of a woman a cap is smiling generated by Luma's Dream Machine](https://cdn.sanity.io/images/pr53lcef/production/699eea8752fe4f614886cafb96cca1e21d81aa53-600x332.gif?q=75&fit=clip&auto=format)Prompt: "The woman in a peaked cap is smiling and talking, natural movements, charming eyes, and slow movements." The video generated by the aforementioned prompt without camera movement captures the charming women well. Despite without any movement, the overall shot retains relatively high quality. For the video with camera movement, the output already puts the women on the right side of the shot at the beginning of the sequence. Thus with the camera moving left command that we used, the woman quickly disappears from the shot and it instead shows a blurry man in the background, which is not what our prompt is asking. **Thus this is a relatively important lesson: with the addition of the camera movement feature, the user should really think about the original position of the main objects in the scene and the underlying background of the scene so that undesirable details do not appear in the moving footage.** ## **Conclusion** As we can see, the Camera Motion feature in Dream Machine 1.6 could be game-changer for video creators, as it can enhance the visual impact of their project. However, we can also see that adding camera movement **does not always improve** the quality of the video; the moving camera would inevitably add an additional layer of complexity to the scene that the users need to really think about before giving instructions to the model. With that said, we remain excited to see what’s next for Dream Machine as Luma continues to push the boundaries. If you are interested in our [AI APIs](https://piapi.ai/), feel free to check them out! Happy creating! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Realtime vs Moshi API Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # OpenAI's Realtime API (powering ChatGPT Advanced Voice Mode) vs Moshi API ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/f7a4c746682a67ba8a7d0de7133728f9088ddbcd-2400x1350.jpg?rect=0,75,2400,1200&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI October 17, 2024 ## Introduction In this blog, we are going to explore and compare the latest advancements in Conversational AI APIs. But first, let's consider the importance of Conversational AI. Typing with our thumbs on a 6" screen is neither the most intuitive nor efficient way for us, compared to communicating vocally - something that we have done effortlessly since birth. Thus, it would seem logical that when it comes to AI applications, we as a species would naturally pick speaking over typing as the preferred mode of interaction. In fields such as customer support, personalized education, language training, and healthcare therapy, Conversational AI is the key to building intuitive, hands-free, emotionally rich products that the public would likely adopt. Thus, we have decided to work on this comparison blog, to examine the two most promising audio AI APIs that can become the backbone of such applications, namely, OpenAI's Realtime API, and Moshi API. ## Prior to Voice Native AI Model... If we turn the clock back to the days before Realtime API and/or Moshi API, let's examine how a typical Conversational AI application would work, and we call this workflow "transcribe-reason-text2speech":user provides an audio input; - 1\. the application **transcribes** the input audio into text using ASR (Automatic Speech Recognition) model (for example, the [Whisper model from OpenAI](https://www.goapi.ai/docs/llm-api/transcription-api)); - 2\. the application passes the transcribed text to text-to-text model (for example [GPT-4o](https://www.goapi.ai/docs/llm-api)) for **reasoning**; - 3\. the application plays the textual output using a **TTS (Text-to-Speech)** model (for example, the [audio models](https://www.goapi.ai/docs/llm-api/tts-api) from OpenAI). As we can see, this workflow will most definitely result in long latency, which is a significantly barrier to a smooth user experience in a conversational AI application, thus rendering the workflow unusable in a majority of use cases. Thus next, let's start examining the newest conversational AI APIs, and the improvements they bring. ## What is Realtime API? First, let's look at [Realtime API](https://openai.com/index/introducing-the-realtime-api/) from OpenAI. The API was first released on October 1st 2024 by [OpenAI](https://openai.com/) to assist developers to build smooth speech-to-speech applications. With six presets voices, and based on the [GPT-4o model](https://platform.openai.com/docs/models/gpt-4o), developers can use this low-latency, multimodal API to build real-time voice-activated applications. ### What is ChatGPT's Advanced Voice Mode? Since a lot of users get confused about the difference between the [ChatGPT's Advanced Voice Mode](https://help.openai.com/en/articles/8400625-voice-mode-faq) vs. the Realtime API, we thought it would be good to clarify. The former is a **feature** within ChatGPT (which is a chatbot **product** developed by OpenAI - one of the most popular in the world) based on the model GPT-4o's multimodal ability. This feature is rolling out to Plus and Team users first, and it also has a **standard version** available to all ChatGPT users through IOS and Android Apps. The standard version works by adopting the traditional aforementioned transcribe-reason-text2speech approach. On the other hand, the Realtime API is a multimodal, voice-native API that can assist developers building out their respective applications, not a feature on another chatbot product. ### Audio Input and Output in the Chat Completion API As part of the Realtime API's release, OpenAI also mentioned that they would be soon releasing audio input and output in the [Chat Completion API](https://platform.openai.com/docs/guides/text-generation) for usecases where low-latency is not a concern. The API's input could be text or audio and API output could be text, audio or both. What is exciting for developers is that, previously one would have to stitch together multiple models to achieve the "transcribe-reason-text2speech" workflow powering the conversational experience. Now, one would just to make **a single API call** from Chat Completion API and the API system would take care of the rest. For the purpose of this blog, we are going to focus on comparing only Realtime API from OpenAI with the Moshi API, and deliberating leaving out the Advanced Voice Mode and the Audio Input and Output feature in the Chat Completion API, in order to have a more related and aligned analysis. ## What is Moshi API? After providing the basic context on Realtime API (and other products) from OpenAI, let's move onto Moshi API. The [Moshi](https://moshi.chat/) voice-native model was first released by the [French Kyutai Team](https://kyutai.org/) in July 2024,. With its state of the art [Mimi codec](https://arxiv.org/abs/2410.00037) processing two streams of audio (user's input and Moshi's output) simultaneously, the model significantly improves the quality of its next-token prediction. In October 2024, [PiAPI is planning to soon release the Moshi API to developers](https://piapi.ai/moshi-api) to help build realtime-dialogue applications. ## Moshi API vs. Realtime API Comparison After we've provided the necessary context on Voice Native Models, let's now start the comparison between the two APIs on different aspects which would affect the development process. ### Speed & Latency Based on [public forums](https://community.openai.com/t/realtime-api-is-extremely-fast/970088), the Realtime API offers extremely fast token generation. Although OpenAI did not provide any official information on its speed, it seems like developers are finding the token generation process is so fast that the interruption function call are deemed redundant since all the text tokens are generated before they are finished playing as audio output. Moshi on the other hand, is known for using its [Mimi codec](https://arxiv.org/abs/2410.00037) achieving sychronized text/audio output. [Their GitHub repository](https://github.com/kyutai-labs/moshi) does not explicitly state Moshi's token generation rate, but it does mention that audio is processed at "a frame size of 80ms" and "a theoretical latency of 160ms" is achieved, with "a practical overall latency as low as 200ms on an L4 GPU". For real-time application, 200ms of latency is generally considered to be quite good, as it is below the threshold that most humans would notice as a significant delay in conversations. It is also worth to note about network latency, given Moshi is a open source model, inference providers such as PiAPI can provide servers that are geographically close to the client server and proivde custom CDN infrastructure to further reduce latency caused within the network. ### Reasoning Coherency & Accuracy In terms of model accuracy there are several aspects we need to look at. Firstly, the Realtime API uses GPT-4o as the underlying inference model and GPT-4o is a much bigger and more complex model compared to the open source Moshi model. Thus it is reasonable to say that the Realtime API will have superior overall reasoning compared to the Moshi API. However, given the open source nature of Moshi, development team is able to fine-tune the base model as per specific usecases. Moreover, if we look at the potentially popular usecases for conversational AI (ex. customer support, education, healthcare, etc.), they are all areas where domain-specific or organization-specific information are crucial to achieve satisfactory output quality. ### Flexibility & Customizations As part of comparing flexibility and customizations, we'd have to again bring up fine-tuning as a major advantage for Moshi, allowing it to be tailored for specific usecases. Futhermore, communities of fine-tuned or trained models might form and give birth to the [Civitai](https://civitai.com/) equivalent of the Moshi ecosystem, allowing models with different emphasis to be shared across users, rapidly increasing innovation and development progress. On this note, OpenAI can also provide fine-tuning like functions for the Realtime API, and develop the infrastructure for users to share their usecase-specific models just like their [GPTs](https://chatgpt.com/gpts) endeavour. However, whether they chose to spend their development resource on that, and whether it would succeed, remain to be seen. In terms of function call and RAG (Retrieval Augmented Generation), Realtime API already supports function call and the Moshi ecosystem should support it in the future as well given the open source nature of the model. Both models are expected to have tools to build out the relavant RAG workflow. ### Rate Limits & Context Lengths In terms of rate limits for Realtime API, it is currently rate limited to approximately 100 simultaneous sessions for Tier 5 developers, with lower limits for Tiers 1-4. However OpenAI also mentioned that they will increase these limits over time to support larger deployments, and that the Realtime API will also support GPT-4o mini in upcoming versions of that model. For Moshi, rate limits would like not be a problem since clients total daily usage and peak throughput could be roughly calculated and extra inference instances could be added to accommodate each specific load profile. For context length, the Realtime API allegedly can hold upto 8k tokens. Moshi on the other hand, depending on its configurations and fine-tuning results, its context length will likely vary. ### Pricing Given the significantly larger size and complexity of the GPT-4o model, the Realtime API naturally would use more hardware resources for inference and memory compared to Moshi, and this would appear quite evident in their respective API pricing. For Realtime API, its pricings are as follows: - • Text Input tokens: $5 per 1M tokens - • Text Output token: $20 per 1M tokens - • Audio Input tokens: $100 per 1M tokens ($0.06 / min of audio) - • Audio Output tokens: $200 per 1M tokens ($0.24 / min of audio) For Moshi API, PiAPI is estimated to able to achieve the following pricing: - • Audio Input & Output tokens: $0.02 / min of audio ## Conclusion Given the comparison provided above, hopefully it was informative as to which conversational AI API might suit your needs better. We here at PiAPI are indifferent about developers' decision since most likely we will support both. However, given the open source nature of Moshi and the impressive results we've seen so far, we are very excited to see how far the open source ecosytem will go and where it will take all of us to! Also, if you are interested in other [AI API that PiAPI provides](https://piapi.ai/), please check them out! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Kling Motion Brush Feature Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # The Motion Brush Feature through Kling API ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/b77a19c3ea85e17400571183c08d7b12295eb6b1-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI September 26, 2024 ## **Introduction** Kling's Motion Brush is a newly introduced tool, launched by [Kuaishou](https://kling.kuaishou.com/en) on September 19, 2024, alongside the release of Kling 1.5. ![A screenshot of Kling's announcement of Kling 1.5's Kling Motion Brush 's release on their official website](https://cdn.sanity.io/images/pr53lcef/production/6c41e742182437ac37965ee40c56a288baec2743-1109x860.png?q=75&fit=clip&auto=format)Kling's announcement of Kling 1.5's and Kling Motion Brush 's release on their official website [PiAPI](https://piapi.ai/)'s Host-Your-Account users already have access to the [Kling 1.5 API](https://piapi.ai/kling-api). However, the motion brush feature will be available to our API users by around October 8, 2024. In this blog, we’ll dive into what the motion brush tool is and compare the results with and without it to see just how much it enhances the AI's performance. ## **What is the Kling Motion Brush Feature?** **Kling Motion Brush** is a new feature in Kling’s image-to-video generative AI, currently available only in Kling 1.0 and not yet supported in Kling 1.5. This tool enables users to set movement paths for specific elements in the video. By brushing over an area manually or using auto-segmentation, you can select the object in the image you want to move, then choose a path to set its movement directions. In addition to setting movement paths, users can also apply the static brush, which stops the selected parts from moving. In theory, this level of control allows users to create more dynamic motion, bringing still images to life with more movement precision. If you are interested in learning how to use the tool more effectively, we recommend checking out Kuaishou's Official [Motion Brush User Guide](https://docs.qingque.cn/d/home/eZQC6RVl0G-XM3CrRX_BCIc4K). With this in mind, we'll now examine the image-to-video evaluation framework which serves as the foundation for analyzing the effectiveness of the Kling Motion Brush. ## **Image-to-Video Evaluation Framework** For this comparison, we have taken the [AIGCBench (Artificial Intelligence Generated Content Bench)](https://www.benchcouncil.org/AIGCBench/), an evaluation framework designed for AI-generated Image-to-Video content. Although this is a framework designed to be used by computers, we've adjusted it for human evaluation, adapting it from an automated system into a manual process. Below are the four criteria the framework used, along with explanations for each. **Control-Video Alignment** We would assess how closely the output video aligns with the provided text prompt and image. This benchmark is essentially the same as the "prompt adherence" metric from our previous [blog comparing Luma Dream Machine 1.5 vs 1.0](https://piapi.ai/blogs/luma-dream-machine-1-5-vs-1-0-comparison-through-luma-api). **Motion Affects** We evaluate whether the motion in the video is dynamic, realistic, smooth, and consistent with real-world physics. **Temporal Consistency** We'll assess whether adjacent frames show high coherence, maintain continuity throughout the video, and remain free of any visible artifacts, distortions, and errors. **Video Quality** This metric is straightforward - we check if the video has a high resolution and check for any blurring. ## **Same Prompt Comparison** With the evaluation framework established, let's now outline our comparison method. We will have three comparison examples, all based on popular cultural trends. Within each example, we will compare the output of three different workflows shown below: - **Workflow 1** \- Kling 1.0 without Motion Brush - **Workflow 2** \- Kling 1.0 with Motion Brush - **Workflow 3** \- Kling 1.5 without Motion Brush All workflows within each example will use the same prompt and input image. We will express how we want the object to move with clear textual commands in the prompt. Workflow 1 & 3 will have to rely only on the prompt, whereas Workflow 2 will rely on the prompt and the motion path drawn. This is how we can compare how much improvement the motion brush feature brings. Note, Kuaishou's official guide ( [Motion Brush User Guide](https://docs.qingque.cn/d/home/eZQC6RVl0G-XM3CrRX_BCIc4K)) also advises that when using the motion brush feature, the user still should specify the desired movement in the prompt for optimal performance. Our Workflow 2 adheres to this recommended practice. Now that you're familiar with our approach, let's jump right into the examples. ### **Example 1: Joker Folie à Deux** Because we are very excited about the upcoming release of [_Joker 2_](https://www.imdb.com/title/tt11315808/), thus for this example, we've chosen to revisit the iconic stair scene from the original Joker film. Below is the image that we have found of Joaquin Phoenix's Joker on the stairs, which we'll use with a prompt to generate the videos for three workflows in this example. ![The PNG image of Joaquin Phoenix's Joker on the stairs that will be used as the input to Kling API](https://cdn.sanity.io/images/pr53lcef/production/f45cfc20e5faf12ae7660a1063728e8194257a38-400x267.png?q=75&fit=clip&auto=format)The image of Joaquin Phoenix's Joker on the stairs that will be used an input to Kling API The screenshot of the motion brush settings that we used for Workflow 2 (the Kling 1.0 model with Motion Brush) is shown as follows. As the green path illustrates, we intend the Joker to turn around and walk up the stairs. ![A screenshot of the motion brush settings for the image of Joaquin Phoenix's Joker, that will be used as input for Workflow 2](https://cdn.sanity.io/images/pr53lcef/production/fb2b788b01671a8255b5a183ff0565db2d6d0290-600x290.png?q=75&fit=clip&auto=format)The motion brush settings for the image of Joaquin Phoenix's Joker, that will be used as input to Kling API (Workflow 2) And here are the output videos of the three workflows, with the prompt used shown in the description. ![A GIF of the comparison between Kling 1.0, Kling 1.0 with motion brush, and Kling 1.5 of Joaquin Phoenix's Joker walking up the stairs](https://cdn.sanity.io/images/pr53lcef/production/5f5d455e2775a3ee1f87a7a5dcec2872a0b53087-600x256.gif?q=75&fit=clip&auto=format)A comparison of the three workflows of the prompt: "The camera slowly zooms out as Joker turns around, back facing the camera as he walks up the stairs." As discussed in the evaluation framework section, the following is our analysis: **Control-Video Alignment** All three videos have the Joker walking up the stairs with his back facing the camera. But none show the slow zoom-out specified in the prompt. **Motion Effects** All three versions have smooth, realistic motion, which are consistent with real-world physics, without any abrupt movements. **Temporal Consistency** The videos are free of flickering, abrupt transitions, or artifacts, maintaining high frame-to-frame consistency. Although the Joker seems to be turning around a bit slower than usual in the first video. **Video Quality** While Kling 1.5 provides 1080p, the other two are limited to 720p. None of the videos above show any signs of blurring. Overall, there doesn't seem to be much difference in this example for all four criteria. ### **Example 2: NFL Wallpaper** The [NFL](https://www.nfl.com/) season just kicked off, and we’re having so much fun watching it that we decided to create animated NFL wallpapers for this example. The screenshot below shows the motion brush settings we used for workflow 2 (the Kling 1.0 model with Motion Brush). We've used the static brush to keep the NFL player in the center stationary. ![A screenshot of the motion brush settings for the image of the Dallas Cowboys Wallpaper, that will be used as input into Kling API (Workflow 2)](https://cdn.sanity.io/images/pr53lcef/production/064facdac9552e2bb3315bc1bb7f7e36af3c22ca-600x401.png?q=75&fit=clip&auto=format)The motion brush settings for the image of the Dallas Cowboys Wallpaper, that will be used as input into Kling API (Workflow 2) And here are the video outputs for the three workflows. ![A GIF of the comparison between Kling 1.0, Kling 1.0 with motion brush, and Kling 1.5 of an animated NFL Wallpaper](https://cdn.sanity.io/images/pr53lcef/production/68e48b0c69132e0d6a23d0c20e630a17be083dba-600x450.gif?q=75&fit=clip&auto=format)A comparison of the three workflows of the prompt: "Cinematic loop of an NFL player in focus, stationary in vibrant blue background. Swirling effects move dynamically behind him. Camera is stationary and static." As discussed in the evaluation framework section, the following is our analysis: **Control-Video Alignment** Workflow 2 (Kling 1.0 w/ Motion Brush) delivers the best Control-Video Alignment, with the NFL player staying completely still and the background creating the most convincing loop. Workflow 1 (Kling 1.0 w/o Motion Brush) also performed well. But if you look closely, the NFL player has slight movements, and the background loop isn’t as smooth as in Workflow 2. Meanwhile, Workflow 3 (Kling 1.5 w/o Motion Brush) has poor alignment, as the NFL player’s visible movement prevents a seamless loop when used as a wallpaper. **Motion Effects** All three versions have realistic and smooth motion, with no unnatural movements visible. **Temporal Consistency** None of the three videos show flickering, abrupt transitions, or artifacts, maintaining high frame-to-frame coherence. **Video Quality** Kling 1.5 outputs in 1080p, unlike the other two, which are restricted to 720p. None of the videos display any blurring. Overall, for creating animated wallpapers, using motion brush seems like the clear choice since it lets you control which parts remain static, resulting in a more seamless loop. ### **Example 3: Sonic the Hedgehog 3** As [_Sonic 3_](https://www.imdb.com/title/tt18259086/) races toward theaters, we picked a scene from the original movie as an example. Being longtime Sonic fans, we felt this was the perfect time to showcase him! Below is an image that we have found of Sonic, which we'll use with a prompt to generate the videos for three workflows in this example. ![The PNG image of Sonic the hedgehog that will be used as the input to Kling API](https://cdn.sanity.io/images/pr53lcef/production/c53444af12c4639fd5165c598de311dbeac4bc93-400x234.png?q=75&fit=clip&auto=format)The image of Sonic the Hedgehog that will be used as the input to Kling API The screenshot below shows the motion brush settings that we used for Workflow 2 (the Kling 1.0 model with Motion Brush). As the green path illustrates, we intend Sonic to walk offscreen to the right. ![A screenshot of the motion brush settings for the image of Sonic, which will be used as input into Kling API (Workflow 2)](https://cdn.sanity.io/images/pr53lcef/production/52a532ee45c20b61e67ed7b30c5bc11efceffaf1-600x267.png?q=75&fit=clip&auto=format)The motion brush settings for the image of Sonic which be used as input into Kling API (Workflow 2) And here are the output videos for the three workflows. ![A GIF of the comparison between Kling 1.0, Kling 1.0 with motion brush, and Kling 1.5 of Sonic walking offscreen to the right.](https://cdn.sanity.io/images/pr53lcef/production/f5ee44bc94b650d30ad75f2dadc0b990366a3a67-600x256.gif?q=75&fit=clip&auto=format)A comparison of the three workflows of the prompt: "Sonic walks offscreen to the right" As discussed in the evaluation framework section, the following is our analysis: **Control-Video Alignment** Both Workflow 1 (Kling 1.0 w/o Motion Brush) and Workflow 2 (Kling 1.0 with Motion Brush) show strong Control-Video Alignment, as Sonic walks offscreen to the right in both cases. In contrast, Workflow 3 (Kling 1.5 w/o Motion Brush) shows the lowest level of Control-Video Alignment, with Sonic disappearing offscreen instead of walking off. **Motion Effects** Workflow 2 (Kling 1.0 with Motion Brush) performs best in this criterion, as Sonic walks offscreen naturally. In Workflow 3 (Kling 1.5 w/o Motion Brush), Sonic’s movements are natural, but he disappears rather than walking away. However, in Workflow 1 (Kling 1.0 w/o Motion Brush), Sonic’s legs shorten, and his body morphs unnaturally before walking offscreen. **Temporal Consistency** Workflows 1 and 2 maintain strong temporal consistency without any abrupt disruptions. However, Workflow 3 contains a sudden transition where Sonic disappears, and a red car takes his place. **Video Quality** Kling 1.5 provides 1080p resolution, compared to the other two restricted to 720p, and all videos are free from blurring. In this example, Workflow 2 (Kling 1.0 with Motion Brush) has the best output, with Sonic’s movements remaining fluid and natural, and avoiding distortion or disappearance seen in other workflows. ## **Conclusion** Based on the three examples provided above, it's clear that using Motion Brush with Kling 1.0 offers the best control over image elements, outperforming other options in Control-Video Alignment, Motion Effects, and Temporal Consistency. However, Kling 1.5 still holds a slight advantage in video quality. But this isn't always the case, as the first example shows, the difference in output quality can sometimes be minimal. We are excited to see how Kling's Motion Brush tool will evolve in the future. Even in its initial version, this tool provides powerful, precise control over image elements for image-to-video AI generation. We can't wait to see how it will turn out once the motion brush tool is added to Kling 1.5! We hope that you found our comparison useful! And if you are interested, check out our collection of [generative AI APIs from PiAPI](https://piapi.ai/)! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Sora vs Kling API Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Sora API vs Kling API - a comparison of AI video generation Models ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/d0d4f0a35b6157f9465da531df3eb70a568334ff-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI December 10, 2024 It's finally here! On December 10th 2024, [OpenAI](https://openai.com/), the team that pushed AI to the forefront of technology, officially [announced](https://x.com/OpenAI/status/1866194857636868283) the release of [Sora](https://sora.com/), their highly anticipated AI video generation model, in a post on X! In their tweet, OpenAI also revealed that Sora offers features such as text to video generation and image to video generation, alongside the option to extend, remix, or blend videos you already have. ![A screenshot of OpenAI's announcement on X about the launch of Sora](https://cdn.sanity.io/images/pr53lcef/production/f84442f7261b714c9b3a9e1390aeabd6d9facfa1-679x540.png?q=75&fit=clip&auto=format)OpenAI's announcement on X about the launch of Sora As the leading AI API provider, we at [PiAPI](https://piapi.ai/) are currently exploring the possibility of launching Sora API in the future. Since we already have [Kling API](https://piapi.ai/kling-api) and [Dream Machine API](https://piapi.ai/dream-machine-api), our investigation is focused on evaluating whether or not Sora API outperforms Kling API and Luma API while also determining the level of demand for what the AI video generation model offers. In this blog, we’ll be comparing the generation quality of our [Kling API](https://piapi.ai/kling-api) with that of Sor _a_ API to see how they measure up. Due to the high demand for Sora API, which has led to supply issues, our comparison will rely on videos showcased by OpenAI on their website for Sora. We will be comparing these to videos generated using Kling API v1.5 Pro. Here’s how the process will work: we’ll take a screenshot of the initial frame from a Sora-generated video, input it into Kling API v1.5 Pro, and generate a video using a prompt that we think is best. Finally, we’ll compare the results from both to evaluate their performance. ## **Comparison** For the following comparisons, we’ll be using the same image-to-video evaluation framework detailed in our previous blogs, which you can refer to for more details. However, we won’t be evaluating the Control-Video Alignment criterion—basically just prompt adherence—since we do not know the prompts used in the videos OpenAI inputted into Sora. ### **Example 1** ![GIF comparing Sora and Kling API video outputs of a monkey rollerskating on the street ](https://cdn.sanity.io/images/pr53lcef/production/c4341e6f0cb1228449945ebdba8a13d8a0431e9b-600x338.gif?q=75&fit=clip&auto=format)Sora vs Kling (prompt: monkey rollerskating on the street) Both videos do a great job with realism, with the shadows of the monkey and the trees lining up perfectly, making it hard to pick a clear winner. They also handle dynamic movements really well and are super smooth, with no jump cuts or artifacts. Overall, it’s a tie for this example, as both videos seem pretty much on the same level in terms of quality ### **Example 2** ![GIF comparing Sora and Kling API video outputs of a the camera zooming out of the lighthouse](https://cdn.sanity.io/images/pr53lcef/production/86950189a9264dd485c2cd4704c50c10baf2c324-600x338.gif?q=75&fit=clip&auto=format)Sora vs Kling (prompt: Camera zooms out from the lighthouse) Both videos appear highly realistic, with waves splashing onto the island and lighthouse in a lifelike manner. The movements are smooth and natural overall. However, in Kling's video, the waves don’t fully adhere to real-world physics. After the initial splash on the left side of the island, the waves unnaturally move upward toward the lighthouse, which seems unrealistic given the small size of the initial splash—it doesn’t justify such a large upward motion. Despite this, both videos demonstrate strong consistency, maintain continuity throughout, and are free from visual artifacts So, Sora slightly outperforms Kling for this example. (It’s worth noting that the prompt for Kling specifically instructs the camera to zoom out from the lighthouse. However, instead of following this, the camera zooms in.) ### **Example 3** ![GIF comparing Sora and Kling API video outputs of a rocket launching into the sky](https://cdn.sanity.io/images/pr53lcef/production/ed186767d038dd2a9d31d8bea657ebe1ea060aae-600x338.gif?q=75&fit=clip&auto=format)Sora vs Kling (prompt: A rocket launches into the sky) Sora’s video looks realistic and dynamic, showing a rocket launching into the sky. Kling’s video, on the other hand, isn’t realistic at all—it has something that’s supposed to be a rocket but looks more like a candle, popping out from behind the moon before slowly taking off, making it less dynamic than Sora's video. Sora’s video does have an issue with consistency, though, as it suddenly cuts to a blue light at the end. Meanwhile, Kling’s video, even though it’s not great quality, stays consistent throughout. Overall, Sora API outperforms Kling for this example. ### **Example 4** ![GIF comparing Sora and Kling API video outputs of a rocket launching into the sky](https://cdn.sanity.io/images/pr53lcef/production/55643eea218e13bcc7d4c8aed47260692d86d3d0-600x338.gif?q=75&fit=clip&auto=format)Sora vs Kling (prompt: The camera panning from the left side of the room to the right) Both videos look realistic and have smooth, fluid movements, but Kling’s video is a bit more dynamic. The person in Kling’s video moves around more, and the camera pans further to the right compared to Sora’s. Both videos stay consistent the whole time—no artifacts, no jumpcuts, and everything flows smoothly. For this example, Kling edges Sora out by a small margin. ### **Example 5** ![GIF comparing Sora and Kling API video outputs of camels walking towards the left](https://cdn.sanity.io/images/pr53lcef/production/00f2a64cb23923931a8c637d8c5bce698f978865-600x338.gif?q=75&fit=clip&auto=format)Sora vs Kling (prompt: Camels walking to the left in a desert) At first glance, both videos look realistic, but if you look closer, there’s an issue with the first camel's shadow on the far left. In both videos, the shadow suddenly moves on its own, completely disconnecting from the camel that’s supposed to be casting it. Then, the shadow is replaced by another one. Sora’s video is far more dynamic, featuring a greater number of camels that move faster and travel farther than those in Kling’s video. For this example, Sora outperforms Kling. ### **Example 6** ![GIF comparing Sora and Kling API video outputs of a plant growing out of the dirt](https://cdn.sanity.io/images/pr53lcef/production/a5f86576be519840ae39793ff92d9c9fd21fe894-600x338.gif?q=75&fit=clip&auto=format)Sora vs Kling (prompt: A plant growing out of the dirt) Both videos appear quite realistic and adhere well to real-world physics, with smooth and dynamic motion. However, Sora’s video is noticeably more dynamic, showcasing the growth of a larger plant, whereas Kling’s video only features a small leaf. Both videos maintain strong temporal consistency and continuity throughout, staying free from any visual artifacts. Overall, Sora outperforms Kling for this example. ### **Example 7** ![GIF comparing Sora and Kling API video outputs of a man walking towards the building](https://cdn.sanity.io/images/pr53lcef/production/d83cb0c8718b7421138dad4d453b08fdb20bc44f-600x338.gif?q=75&fit=clip&auto=format)Sora vs Kling (prompt: The man walking towards the building) Both videos appear quite realistic, and adhere well to real-world physics, with smooth and dynamic motion. Both videos also show strong temporal consistency and continuity throughout, being free from any visual artifacts. Overall, both videos have the same quality, for this example. ## **Conclusion** Based on the seven examples above, it’s clear that Sora API generally outperforms Kling in several aspects. However, it’s important to note that we don’t know whether the videos from Sora API were generated using image-to-video or text-to-video prompts, nor do we know the exact prompts used. This could make the comparison less fair, but we’ve made every effort to recreate the videos as accurately as possible using Kling. We’re excited to see how OpenAI’s Sora evolves in the future and to continue exploring whether PiAPI should introduce its own Sora API. We’re also eager to see how Sora develops further and whether OpenAI can surpass other companies in advancing AI video generation models. Additionally, we look forward to seeing how Sam Altman steers OpenAI, guiding the company into the next phase of AI innovation. We hope that you found our comparison useful! And if you are interested, check out our collection of [generative AI APIs from PiAPI](https://piapi.ai/)! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Ghibli Image Generator Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Ghibli Style Image Generator using GPT 4o image generation API ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI April 3, 2025 Hey everyone! Unless you've been living under a rock for the past week, you've likely heard that [OpenAI](https://openai.com/) has launched their new ChatGPT image generation model. The 4o image generation model was launched on March 25th, 2025, with the [announcement](https://openai.com/index/introducing-4o-image-generation/) posted on their website. And as the leading AI API provider, we at [PiAPI](https://piapi.ai/) already have our very own [GPT 4o image API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api). ![Screenshot of Official announcement of 4o Image Generation on OpenAI's website](https://cdn.sanity.io/images/pr53lcef/production/725e27244fd0325d2318e57919ed05382a30707d-1920x911.png?q=75&fit=clip&auto=format)Official announcement of 4o Image Generation on OpenAI's website And we have to say, the 4o image generation by ChatGPT looks very impressive, easily overshadowing most text-to-image and image-to-image AIs in the market. In this blog, we’ll be generating both text-to-image and image-to-image examples in the popular Studio Ghibli style. Many people have been using the new ChatGPT 4o image generation model as their own personal Ghibli image generator, and it's been pretty fun to watch! So we decided to test our own GPT 4o image generation API this way and see the results. ## **Examples** ### **Trump Tariffs** For our first example, we’ll imagine what the recent Trump Tariffs announcement might look like if we were living in the fictional world of Studio Ghibli. We'll use the image below as our input, along with an appropriate prompt. ![PNG Image of Donald Trump introducing the recent tariffs that will be used as input](https://cdn.sanity.io/images/pr53lcef/production/20366507b70d648ec278ec943797685a5eec0fe9-400x267.png?q=75&fit=clip&auto=format)Image of Donald Trump introducing the recent tariffs that will be used as input And now let's see what it looks like after we have ChatGPT 4o Ghibli -fied it! ![ChatGPT image generator ghibli -fied version of Donald Trump introducing the recent tariffs generated by 4o image generation ChatGPT](https://cdn.sanity.io/images/pr53lcef/production/fa99aab22f3e55495cacc1b48a37ca661c3455ef-600x400.png?q=75&fit=clip&auto=format)Prompt: "can you recreate this image into studio ghibli style" We must say that it definitely looks amazing. While it didn’t get all the numbers on the board correct—especially the ones at the bottom—it still shows impressive text adherence, especially compared to most other AI image generation models, which don’t even come close. ### **A Minecraft Movie** For our second example, we are going to use Jack Black playing Steve in the minecraft movie and put him through our chatgpt 4o image api. We're excited to see what a minecraft movie would look like if it was made by the talented people at studio ghibli! ![PNG Image of jack black as minecraft steve that will be used as input](https://cdn.sanity.io/images/pr53lcef/production/e78967de3a26538c0f51c316b868bb0b33be4332-400x225.png?q=75&fit=clip&auto=format)Image of jack black as minecraft steve that will be used as input And now let us look at how it turns out after putting it in our Ghibli image generator! ![PNG image of Jack black as minecraft steve after being put into our chatgpt4o image API](https://cdn.sanity.io/images/pr53lcef/production/624afe227122869dfedd27a695a3b47f204dee50-600x400.png?q=75&fit=clip&auto=format)Prompt: "can you recreate this image into studio ghibli style" This one also turned out really good! The overall image quality, combined with its strong text adherence, really makes it stand out. And it doesn't have any trouble with the fingers too, which is always nice to see. Yet another impressive result from the new ChatGPT image generation model. ### **Comic Panel** For our final test, we’re creating an AI-generated comic panel—something we've seen quite a few people experimenting with on Reddit. We wanted to give it a try ourselves using our GPT4o image API. In this example, we'll be using text-to-image with the following prompt: _Can you create a comic panel with 4 scenes, make the entire comic in studio ghibli style:_ _the first scene (top left) is a guy looking smug and pointing at two guys talking (the two guys talking have the openAI logo on their shirts), the smug looking guy says that "AI art is not art"_ _the second scene (top right) is just the two guys with the openAI logo on their shirts looking back at the smug looking guy awkwardly_ _the third scene (bottom left) is one of the two guys giving the smug looking guys a thumbs up before returning to their conversation_ _the fourth scene (bottom right) is the smug looking guy now angry, shouting at the two guys who are now ignoring him, the smug guy is shouting "STOP HAVING FUN"_ And now let's look at how the comic panel turned out! ![PNG of The AI generated comic panel generated by 4o image generation API](https://cdn.sanity.io/images/pr53lcef/production/a42c24ca90ee96a44f7adc16a5f2f8fe99abd06e-600x900.png?q=75&fit=clip&auto=format)The AI generated comic panel generated by 4o image generation API This one turned out really well! It nailed the human facial expressions, got the OpenAI logo right, and showed excellent text adherence. It really feels like you could create an entire manga or comic by only using our GPT 4o image generation API, the new ChatGPT image generation definitely feels like a huge leap forward. ## **Conclusion** I think that it can objectively be said that the new ChatGPT 4o image generation is really amazing, as it can replicate a ton of different art styles very well, including the Ghibli style which we used for the examples in this blog. We are looking forward to how else OpenAI would improve their ChatGPT image generation, and their GPT model in general! As always, if you want to test it out yourself, you can use our [GPT 4o image API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) right now! And if you are interested, please check out our other [Generative AI APIs](https://piapi.ai/)! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/94b84c8899274fa79b2e9b27d78de893da063d5d-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/creating-an-ai-music-video-generator-using-wan-2-1) ### [Creating an AI Music Video Generator using Wan 2.1](https://piapi.ai/blogs/creating-an-ai-music-video-generator-using-wan-2-1) March 7, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Animated Wallpaper Creation Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/9687c49e8140700e93fb4148fa96e3f92e4c9b58-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI September 23, 2024 ## **Introduction** As generative AI technology advances, it has never been easier to create your own custom AI Wallpaper, but what if you could take it a step further and make it an animated live wallpaper? Because now you can! In this blog, we will explore a few examples of combining these two APIs, creating some impressive animated wallpapers. ## **Example 1: Anime Wallpaper** Let’s begin by creating an anime desktop wallpaper with the help of our AI APIs. In terms of workflows, we will be testing three different ones for this example, to help us better understand the steps involved and the respective output qualities. The exact same identical Kling prompt will be used across all three workflows so that we have the same reference for comparison. ### **Workflow 3: Just using Kling** For the final workflow, we will not be using any images as an input to Kling, but only the same prompt into Kling API as we did for Workflow 1, and below is the result. ![GIF of a girl looking at the full moon, with her back towards the camera, her hair swaying slightly, as the clouds move, in the anime art style, generated by only using Kling](https://cdn.sanity.io/images/pr53lcef/production/7ccf45502c9158e4849478af82ae8c8d4d699cb1-600x338.gif?q=75&fit=clip&auto=format)Prompt: same prompt as Workflow 1 ### **Takeaways** While Workflow 2 (Image to Kling) produces a good output, finding an image online that meets your exact preferences takes quite some time. Finally in Workflow 3 (Just Using Klng), the video resolution is lower compared to Workflow 1. This difference likely comes from FLux's high-quality output, which helped the Kling model to deliver better video output. Thus, if you want the highest quality results, we recommend using Kling API alongside an image from FLux. ## **Example 2: Shogun's Yoshii Toragana** For the second example, we're going to switch things up a bit by creating a phone wallpaper. This wallpaper is inspired by the character of Yoshii Toragana played by Toshiro Mifune from the critically acclaimed show Shogun. We’re eagerly anticipating the release of _Shogun_ Season 2 to see the story of John Blackthorne, Yoshii Toragana, and Lady Mariko continue to unfold. In the meantime, we've created this wallpaper to make the wait a little more bearable. Our first step is using the FLux API to generate a wallpaper image of Yoshii Toragana; you can see below for the output image and the prompt. ![A PNG image of a samurai riding a white horse, generated by FLux API](https://cdn.sanity.io/images/pr53lcef/production/51dd356448be9209b3fea69e34b0fdd3d2e70c23-224x400.png?q=75&fit=clip&auto=format)Prompt: "Toshiro Mifune as a samurai in golden armor, riding a white horse through swirling red smoke and teal mist. His hands grip the reins calmly as his iconic expression radiates strength. The dynamic colors and moody lighting create a powerful vertical phone wallpaper, highly detailed, cinematic style" Next, we entered the generated image into the Kling API using a different prompt. Below, you can see the resulting GIF from Kling alongside the prompt used. I personally like the rising, animated smoky background behind Yoshii Toragana, very fitting of the Shogun title. ![A GIF of a samurai riding a white horse, generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/7bb476bb802f3ec2cb99bcb326466e00deb01268-337x600.gif?q=75&fit=clip&auto=format)Prompt: "Static camera shot, the samurai and horse remain still, with only the horse’s mane and the samurai’s hair swaying gently in the wind. The red mist in the background moves slowly, creating a subtle, seamless loop for a live wallpaper. Calm yet powerful atmosphere" ## **Example 3: Warhammer 40k Wallpaper** In our final example, we present none other than Demetrian Titus, captain of the Ultramarines, a central figure from the Warhammer 40k universe. This wallpaper draws inspiration from the latest installment in the franchise, _Warhammer Space Marine 2_, a highly anticipated game that brings to life the intense battles and rich lore within the Warhammer universe. As with the previous examples, we will need to generate a picture using FLux API first. ![PNG image of a Warhammer 40k Space Marine walking through an alien desert with a red planet in the background, generated by FLux API](https://cdn.sanity.io/images/pr53lcef/production/8eee6d2cc2bb73b97e02d7751c5168046599cf35-400x224.png?q=75&fit=clip&auto=format)Prompt: "A Warhammer 40K space marine, wearing ultramarine armor, in an action pose with his bolter raised forward. The alien desert is bathed in golden twilight with rocky spires and an ominous red moon rising in the background. Dust swirls in the wind as the marine stands his ground, illuminated by a bright flare. Cinematic lighting, vivid detail, epic composition, concept art style, hd quality, natural shading, inspired by sci-fi landscapes, dramatic contrast" Next, the generated image will be put into Kling API, along with the prompt shown below the GIF. We are particularly drawn to the gritty and sci-fi aesthetic of the video. ![GIF of a Warhammer 40k Space Marine frozen midstep walking through an alien desert with a red planet in the background, generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/ab7722ee0e75a2bb59cef76d3ca8edc764b3f614-600x338.gif?q=75&fit=clip&auto=format)Prompt: "Static camera shot, Space Marine in place not moving, unmoved in the desert as soft gusts of wind push his cape to the left. Dust swirls around his feet, and the distant red planet glows. A serene, yet eerie desert landscape, perfect for a live wallpaper." ## **Conclusion** From the examples shown above, you can probably see why combining our [Kling API](https://piapi.ai/kling-api) with our [FLux API](https://piapi.ai/flux-api) is the best choice for creating your very own animated custom wallpaper. The combination of FLux images and Kling's animation creates highly detailed results, With FLux providing images of high-quality output for Kling to animate. Also, prompts that create animation without drastically different starting/ending frames to achieve a more natural loop really helped with creating these animated wallpapers. We hope you've found value in our experiment and encourage you to try out some of your own ideas. If you're interested in our [other AI APIs](https://piapi.ai/), feel free to check them out! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## PiAPI Kling API Advantages Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # How PiAPI's Kling AI API is better than the Official Kling AI API (cost, speed, and features)! ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/3b300397dd917f550cf88549099f66b882da3de2-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI October 11, 2024 ## **Introduction** As you’ve probably heard by now, Kuaishou has launched their official Kling AI API to a number of limited developers on September 30th, 2024. However, the official Kling AI API has some major drawbacks, such as requiring developers to pay an upfront fee of $4,200 for three months, with no lesser usage options, and the correspondingly monthly units expiring at the end of each billing month. ![Screenshot of the Official announcement of the release of the Kling AI API on their website](https://cdn.sanity.io/images/pr53lcef/production/c2d74ed926cee742c49af64c99c95d35c2ca7cd2-1280x437.png?q=75&fit=clip&auto=format)Official announcement of the release of the Kling AI API on their website At [PiAPI](https://piapi.ai/), we're providing a superior version by developing on top of the official API, offering the same functionality plus extra features, **all at a lower price** for developers. Now, let's get into the detailed comparison, so you can decide for yourself which one is better. ## **Comparison** Here's a table we put together showing the different plans PiAPI offers and the cheapest upfront plan from the Official Kling AI API. ![PNG image of a table comparing PiAPI's different plans and the lowest-priced plan from the Official Kling API](https://cdn.sanity.io/images/pr53lcef/production/cb928e6f8443056a670d1d4dba809efa9bf51d8e-824x1053.png?q=75&fit=clip&auto=format)Overview Comparison Table for PiAPI's Kling API vs. the Official Kling API Now, we'll take a closer look at the comparison table and explain it in more detail. ### **Unit Pricing** PiAPI's Kling AI API price per video is as low as $0.13. (note that PiAPI's pricing will be as per this blog starting October 20th, 2024) The Official Kling AI API price per **unit** is $0.14. For them, a unit is what video generation tasks will consume, for example: - • In _standard mode_, a 5-second video requires 1 unit, while a 10-second video requires 2 units. Thus, a standard mode 5-second video costs $0.14, and a standard mode 10-second video costs $0.28. - • In _professional mode_, a 5-second video uses 3.5 units ($0.49), and a 10-second video uses 7 units ($0.98). For PiAPI, however, we just directly use USD per video to calculate the cost. To simplify things, we've created a detailed table outlining the cost comparison. ![PNG Image of Pricing Table Comparison](https://cdn.sanity.io/images/pr53lcef/production/b52567aeeb49e088e623518c59d7b51a5b620ee5-1641x500.png?q=75&fit=clip&auto=format)The detailed Pricing Table Comparison between PiAPI and the Official Kling API ### **Upfront Fee** Next up, let's look at the upfront fee. But first, what does that term mean for the services we are comparing?The upfront fee is the initial cost required to access the API platform. While some service providers require significant upfront payments, PiAPI offers a more flexible and cost-efficient approach. Here’s a comparison between PiAPI's Kling AI API and the Official Kling AI API: - • **PiAPI's Kling AIAPI**: PiAPI requires $0 minimum upfront fee for credit purchasing since it is a pay-as-you-go model (you use what you top up). For features, users can start on the basic free plan and if you are interested in the advanced features, you can subscribe to the corresponding Creator Plan ($8/month) or Pro Plan ($50/month). Overall, there are no large commitments required with PiAPI's offering. - • **Official Kling AIAPI**: The Official Kling API requires a $4,200 upfront payment for a three-month period, which includes 10,000 units per month (expiring at the end of each billing month). Kling does not offer any lower credit plans, and the $4200 is a significant investment for development teams who are experimenting with the Kling API and are uncertain about future usage growth. Another key difference is how long unused units/credits remain valid: - • For the official Kling API, the upfront $4200 payment per 3 months corresponds to 10,000 units per month, and unused units expire after each respective **30 days**, forcing developers to use them quickly or lose them. - • Whereas in PiAPI's pay-as-you-go model, unused credits remain valid for **180 days** from the date of the purchase, giving developers more time to use them as needed. ### **Features** Next, we’ll break down the features of both APIs and explain why PiAPI’s Kling AI API is the best option. **Full Feature Support:** PiAPI's Kling AI API offers all the features that Official Kling AI API offers, including: - • AI Text-to-Video generation - • AI Image-to-Video generation - • Support for the V1.0 Model - • Ability to handle multiple concurrent jobs - • Negative Prompts - • Watermark Removal - • Add End Frame - • Camera Movement (text-to-video) **Max Concurrent Jobs** Both APIs support multiple concurrent video generation tasks, but PiAPI provides significantly more concurrency than the Official API. The Official Kling AI API supports only to a maximum of 5 concurrent jobs, even after developers are forced to pay $4200 for a 3-month commitment. If the developers are expected to use up all the 10,000 credits, which is about 333 jobs per day, sometimes 5 concurrent jobs might result in long queue time. PiAPI's Kling AI API, other the hand, supports up to 20+ concurrent jobs, which is **four times** the concurrent job capacity than what the official is offering, making it a more useful option for users with high-volume needs. **Additional API Features** Besides handling more concurrent jobs and supporting all the features of the Official API, PiAPI’s API offers extra features that you won’t find in the official version, including support for: - • **v1.5 Model** - • **Motion Brush** (WIP) - • **Lip Sync API**(WIP) Kling released the v1.5 model recently, and the official team mentioned that it's a major improvement over the v1.0 model. Therefore, it easy to see why many developers would want the option to run the v1.5 Model through the API, but unfortunately, the Official Kling AI API doesn't offer that functionality. Motion Brush is also another tool that was released by Kling, allowing you to select an object in an image and create movement paths for precise and dynamic motion control. It is yet another powerful tool that is unavailable in the Official Kling AI API. Similarly, the Lip Sync tool is another powerful tool in Kling AI. What it allows you to do is input text, pick a voice, and generate both voiceover and video for your character. But like Motion Brush and the v1.5 Model, it is missing from the Official Kling AI API. But luckily, PiAPI’s Kling AI API gives you access to all of these features, helping you to build more powerful applications for your users. 1. **Other AI APIs!** Not only does PiAPI offer additional Kling AI API features, but with a PiAPI account, you can use the credits purchased on any of our AI APIs besides Kling. This ensures your payments are more efficiently spent, and reducing the risk of unused credits. Our family of AI APIs offering include: - • [Faceswap API](https://piapi.ai/faceswap-api) - • [Luma Dream Machine API](https://piapi.ai/dream-machine-api) - • [Moshi API](https://piapi.ai/moshi-api) (coming soon!) - • [Flux API](https://piapi.ai/flux-api) Also, if developer chose the Pro Plan ($50/month) for Kling, then other premium features of our other AI APIs could also be used, such as: - • Faceswap API: 200 calls / month for free - • Luma Dream Machine API: image-to-video generation, add end frame, video extend, watermark removal - • Flux API: 10 concurrent jobs, top priority generation, LoRA (WIP), ControlNet (WIP) For more details, please refer to [PiAPI's pricing](https://piapi.ai/pricing) page and related documentation for more information. ## **Alternative Option: Host-Your-Account** For developers who already have their Kling account(s), PiAPI also allows developers to use their own Kling accounts through our API. This is our Host-Your-Account (HYA) option. How it works is that you'd pay for a Kling API HYA "seat" for just $10 a month, then you can connect your own Kling account to this seat and start making API calls to your own Kling account. The number of video generations available under the HYA option will purely depend on the number of credits available in your Kling account, with no extra charges coming from PiAPI besides the $10/seat. Users can still start on the Free Subscription Plan, and if they are interested in the advanced features, they could subscribe to the $8 Creator Plan or the $50 Pro Plan anytime. The $10 paid for the seat differs from the $8 or the $50 paid for the subscription plan, where: 1. 1\. **$10/month** is the monthly **cost of a seat** 2. 2\. **$8/month or $50/month** will provide the users with **different features** in different subscription plans (note that concurrent job limit and whether you can remove watermarks are both determined by your own Kling account) Therefore, for the HYA option, the total upfront fee consists of the following: 1. 1\. Personal Kling account(s) cost 2. 2\. At least one PiAPI HYA seat ($10/month) 3. 3\. PiAPI Subscription Plan (can start with $0/month and upgrade as needed) This option has the potential to be even cheaper than the Pay-as-you-go option offered by PiAPI. Since Kling offers major discounts for the first subscription month, and free Kling accounts can also process jobs. ## **Conclusion** PiAPI's Kling AI API clearly stands out as the smarter choice for indie developers or big development teams alike. Not only do we provide all the features of the Official Kling AI API, but we also offer extra features that are extremely popular with developers and end users, and all of this comes at a lower cost compared to the official API. This makes it the perfect choice for anyone looking for both a high-quality and cost-effective solution. We hope that you have found this comparison useful! And if you are interested, check out our full range of [generative AI APIs at PiAPI!](https://piapi.ai/) * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Animate Toys with Kling API Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Using Kling API to animate toys like Popal ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/f49288ec4f5b0a2d92b8a7903d975c1a2c5ab26d-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI March 4, 2025 Hey guys! Today, we'll be using the [Kling API](https://piapi.ai/kling-api) to bring toys to life through animation. In this blog, we’ll be using [Popal](https://popal.io/)’s brick figurines as the examples to demonstrate how Kling API animate toys. For those of you unfamiliar with Popal, they are a company focusing on creating brick figurines of your favorite characters. ![Screenshot of Popal Website homepage](https://cdn.sanity.io/images/pr53lcef/production/8ca8c4fff363cfe21cc47c29d824af5b3174d72a-1280x589.png?q=75&fit=clip&auto=format)Popal website homepage In this blog, we’ll be using the Kling API to animate figures like the ones from Popal. We’ll explore three different aspects to evaluate whether Kling API is an effective tool for animating toys, such as brick figures. The three aspects we’ll be examining are: 1. **1\. Movement** Realistic movement is essential for making brick figures feel alive and interactive. When animating a toy, you'd naturally want it to perform some form of movement to catch the attention of the viewer. 1. **2\. Physics** Physics ensures that toy animations react naturally to real-world physics like gravity and momentum, creating believable and authentic actions that make the animation feel grounded. We also wanted to see how it would do when interacting with different objects. 1. **3\. Facial Expressions** Facial expressions are key to revealing the personality and emotions of the toys, deepening the emotional connection between the viewer and the animation. Now that you know what the key elements that we are focusing on, let's first start with our results from trying to animate a Popal brick figurine's movements. ## **Movement** For movement, we are going to use this Mai Sakurajima figurine (Rascal Does not Dream of Bunny Girl Senpai) from Popal. Below is an image of the brick figure which we will be using as input into Kling API alongside a prompt to see how well can Kling animate the toy's movements. ![PNG image of Mai Sakurajima Figure that will be used as input](https://cdn.sanity.io/images/pr53lcef/production/1b8a0ee90fc65ff1d38e5cee64ffe1f47cae4e31-400x400.png?q=75&fit=clip&auto=format)Image of Mai Sakurajima Figure that will be used as input We will have Kling API animate the brick figurine with two types of movements: one where it runs, and the other where it jumps. ### **Movement 1: Running** ![GIF of Mai Sakurajima Figure running towards the screen generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/359d0e2cd797732b81d9c3849fb976ea5df526c7-600x600.gif?q=75&fit=clip&auto=format)Prompt: "The brick figurine running intensely" As you can see above, Kling API does a great job at animating the brick figure. The running motion feels quite realistic, with the figurine’s arms and legs moving naturally. Additionally, the bunny ears move in sync with the running action, which is a nice attention to detail from Kling API. ### **Movement 2: Jumping** ![GIF of Mai Sakurajima Figure jumping with joy generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/2648e636027b6efe6c3f6c5fc32459f171b2a804-600x600.gif?q=75&fit=clip&auto=format)Prompt: "The brick figure jumps up and down, jumping for joy" The jumping animation is done very well. As you can see, the movement appears natural, with the figurine’s body lifting off the ground in a realistic way. Just like the running animation, the bunny ears react in sync with the jump, adding an extra layer of realism. The attention to detail in how the ears move with the figure showcases Kling API’s ability to handle detailed animations. ## **Physics** For the physics test, we’ll use the same figurine as input, but this time place a brick building toy beside her. The goal is to have her punch the building and see if the animation realistically shows the building breaking in response. ![PNG image of the Mai Sakurajima Figure beside a toy brick building](https://cdn.sanity.io/images/pr53lcef/production/49e3baffc35344589ca7babc305d95e5bc33a80a-400x400.png?q=75&fit=clip&auto=format)Image of the Mai Sakurajima Figure beside a toy brick building And below are the results. ![GIF of the Mai Sakurajima Figure destroying the toy building beside her generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/aa10c16f7b1cdb9a5c82a213c0cdeaa1e75033c1-600x600.gif?q=75&fit=clip&auto=format)Prompt: "The female brick figure in one swift motion, punches the building beside her intensely, like in an action sequence. The lego building then crumbles onto the floor after the punch." As you can see, the animation still looks good, but not quite as impressive. The brick figure's actions resemble more of a strangling motion than a punch. However, the brick building does break apart in a believable enough manner, showcasing a reasonable level of destruction despite the error in the figurine’s movements. ## **Facial Expressions** For the facial expressions section, we’ll be using Kling API to convey three different emotions: joy, sadness, and anger. Our goal is to evaluate whether Kling API can effectively capture and express these emotions through the toy’s facial expressions.We will also be using the same image as in our movement section. ### **Facial Expression 1: Joy** ![GIF of the Mai Sakurajima Figure laughing generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/d7832edb54b2131bd06a4849f168cd3d5b0905f9-600x600.gif?q=75&fit=clip&auto=format)Prompt: "Animate the brick figurine, making it smile widely and laugh with a joyful expression." As you can see, the emotion of joy and laughter is portrayed quite well in the video. The figurine’s facial expression clearly shows a smile, and its laughter is visibly conveyed, making the emotion feel genuine and lively. The animation does a great job of capturing the emotion of happiness, with the figurine's face reflecting a natural, joyful response. ### **Facial Expression 2: Sadness** ![GIF of the Mai Sakurajima Figure crying generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/a0fafb757d590d361654e61a3d825db220cd2207-600x600.gif?q=75&fit=clip&auto=format)Prompt: "The brick figurine crying hysterically as tears flow out of her eyes" The figurine expresses sadness quite well. You can see tears flowing from her eyes, while her head lowers slightly, conveying the expression of sadness quite well. The combination of movements and tears really helps convey the emotion of sadness. ### **Facial Expression 3: Anger** ![GIF of the Mai Sakurajima Figure being angry generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/f71dea270d99f64ad87a2432e8fc1f618d331853-600x600.gif?q=75&fit=clip&auto=format)Prompt: "Animate the brick figurine with a furrowed brow, clenching its fists and showing an angry expression." In this video, you can clearly see the figurine expressing anger, with her fists tightly clenched and her eyebrows furrowed in frustration. The intensity of her facial expression, combined with these hand movements, effectively conveys the emotion of anger. Her face shows a strong sense of determination and irritation, making the expression effectively convey anger. ## **Other Tests** Before we get to our conclusion, let's quickly review the other attempts we made. Although we didn't include these in the main points of the blog, we hope they'd help you understand how different prompts influence the outcomes as shown by our tests below. ### **Movement** ![GIF of all the other "Movement" tests we did using Kling API](https://cdn.sanity.io/images/pr53lcef/production/58e7d3deb784c2ee20f3b4a56abdfe502aaa2bf7-600x338.gif?q=75&fit=clip&auto=format)Other "Movement" tests we did using Kling API M1: The brick figure walking off screen to the right M2: The brick figure walks off to the right M3: The brick figure moving its legs in an exaggerated manner, walking offscreen to the right M4: The brick figure move its legs in an exaggerated manner, lifting it up one by one as it does a walking animation to the right of the screen M5: The brick figure move its legs in an exaggerated manner, lifting it up one by one as it does a walking animation and walks in place, lifting his legs up and down M6: The brick figure move its legs in an exaggerated manner, walking towards the viewer M7: The brick figure turns to the right and starts running M8: The brick figure turns 90 degrees to the right, then starts running ### **Physics** ![GIF of all the other "Physics" tests we did using Kling API](https://cdn.sanity.io/images/pr53lcef/production/5c705208ac807e15b89c82f613950dc609a9fafb-600x600.gif?q=75&fit=clip&auto=format)Other "Physics" tests we did using Kling API P1: The brick figure destroying the building beside her, punching it and breaking it into two P2: The brick figure destroying the building beside her, punching it and breaking it into two P3: The brick figure punches the building beside her in a quick intense motion as the building explodes into lego pieces P4: The brick figure punches the building beside her and it explodes ### **Facial Expressions** ![GIF of all the other "Facial Expressions" tests we did using Kling API](https://cdn.sanity.io/images/pr53lcef/production/0ff16c71dd729f165192df2b3a98e0f29d3d83a7-600x338.gif?q=75&fit=clip&auto=format)Other "Facial Expressions" tests we did using Kling API FEJ1: The brick figurine smiling FEJ2: The brick figurine laughing, as she points at the screen, she is laughing uncontrollably FES1: Transform the brick figurine, showing tears in its eyes as it sobs, its face filled with sadness FES2: Animate the brick figurine, showing tears in its eyes as it sobs, its face filled with sadness FEA1: The brick figurine has a scornful expression, with her face showing intense anger FEA2: Create a video of the brick figurine with a furrowed brow, clenching its fists and showing an angry expression. ## **Conclusion** Overall, we can say that Kling API does quite a good job animating toys. It is really good at conveying facial expressions, bringing out emotions with impressive details. The movement animations also stand out, with the figurines demonstrating realistic motions as they move. It's weakest point is when it comes to physics and interactions with other objects. While the building destruction test showed some promise, the overall physics interactions felt a bit off compared to the other aspects. Still, Kling API is a great AI tool for animation, especially for animating facial expressions and movement. If you are interested in the brick figures we used in this blog as examples, check out [Popal](https://popal.io/)! And if you are interested in any of our other APIs, feel free to check them out at [PiAPI](https://piapi.ai/)! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Kling vs Pika API Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Kling API vs Pika API (Kling Effects vs Pikaffects) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/30f2c59925698efb7e2aa1de548b19004e6f5574-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI February 25, 2025 Hi developers,On January 21st 2025, Kling released their Kling Elements (or magical elements as some call it!) feature which many of you are already familiar with, and for those who aren't we have previously written a [blog](https://piapi.ai/blogs/kling-elements-through-kling-api) explaining and testing it. While the Kling Magic Elements update was the primary focus of the update, Kling also introduced Kling Effects, which, although not the main highlight, represents a significant advancement in AI video generation. And both [Kling Elements](https://piapi.ai/docs/kling-api/kling-elements) and [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects) are both available for our users through our [Kling API](https://piapi.ai/kling-api). ![Screenshot of the official announcement on the Kling website about Kling Elements and Kling Effects](https://cdn.sanity.io/images/pr53lcef/production/7c5cc96970702b6bad3527e38f29d54c4437f842-877x308.png?q=75&fit=clip&auto=format)Official announcement on the Kling website about Kling Elements and Kling Effects So what is the Kling Effects feature? Basically, you insert an image into Kling API and pick an effect such as inflating it or squishing it, then Kling API will generate the output video with the chosen effect. This is very similar to the pikaffects feature from pika art which which our [Crush it Melt it blog](https://piapi.ai/blogs/crush-it-melt-it-through-pika-api-kling-api-and-luma-api) covered where we compared Kling API, Luma API, and Pika API to see which AI API performed the best. Now that Kling API has introduced its own effects feature, we decided to compare Pika API and Kling API once more to see which performs better. For this comparison, we'll revisit the examples from our Crush It Melt It blog using Pika Art API, and input the same images and effects to Kling API for a direct comparison. ## **Kling's MochiMochi vs Pika Art's Squish It** For our first example, we are going to use the [alien plou plush](https://www.amazon.com/Generic-Stuffed-Emotion-Plushie-Childrens/dp/B0BC98T6ZG) like last time. Below is an image of the alien plou plush, which we’ll use alongside the MochiMochi Kling Effect or the Squish It (Or squishy maker as some call it!) Pikaffect as input for the two AI models we are going to compare. ![JPEG image of the alien plou plush that will be used as input into the APIs](https://cdn.sanity.io/images/pr53lcef/production/99b133d9afc2d0bee7e5604def8278b186706dc2-312x400.png?q=75&fit=clip&auto=format)The image of the alien plou plush that will be used as input into the APIs We will see how Kling API's MochiMochi compares to Pika artificial intelligence API's Squish it. Below are the output videos of Kling Effects' MochiMochi and Pika Art AI's Squish It. ![GIF of Kling's MochiMochi vs Pika Art's Squish It for the squishing example](https://cdn.sanity.io/images/pr53lcef/production/c1b9a5c629b25147f599df98bee5dc90e2b048c0-600x338.gif?q=75&fit=clip&auto=format)Kling's MochiMochi vs Pika Art's Squish It for the squishing example **Pika** Pika did really good in squishing the figurine but as we said before, the fingers on the hands are quite messed up. As we said in our previous blog the issue isn’t with how the plush is being squished, but with the hands that does the squishing. When they first appear, it looks like two thumbs are pressing down, which is unnatural since a human’s fingers couldn’t start in that position. Another problem is the fingers pressing on the eyes seem to phase through the plush. Lastly, the pinky fingers look deformed with noticeable bulges. **Kling** Kling actually did really well, in both the figurine being squished and the finger movements as well. Kling Effects API actually animated the fingers a lot better than Pika API as you can see from the ways the hands and fingers squished the plush. Another thing it did better is the squishing effect itself, it looks like the plush is squishier than the one generated by Pika API. ## **Kling's BoomBoom vs Pika Art's Inflate It** For the second example, we are going to use a [Squid Game](https://www.netflix.com/title/81040344) plush.Below is an image of the squid game plush, which we’ll use alongside the MochiMochi Kling Effect or the Squish It Pikaffect as input for the two AI models we are going to compare. ![JPEG image of the squid game plush that will be used as input into the APIs.](https://cdn.sanity.io/images/pr53lcef/production/a7427c979156e3174748b8b007916ddd68bb3fcd-400x400.png?q=75&fit=clip&auto=format)The image of the squid game plush that will be used as input into the three APIs. We will see how Kling API's BoomBoom compares to Pika API's Inflate it. Below are the output videos of Kling Effects' BoomBoom and Pika Art's Inflate It. ![GIF of Kling's BoomBoom vs Pika Art's Inflate It for the inflating example](https://cdn.sanity.io/images/pr53lcef/production/3a0294604a64066c87c97468bddaaf38f41d1d1b-600x338.gif?q=75&fit=clip&auto=format)Kling's BoomBoom vs Pika Art's Inflate It for the inflating example **Pika** Pika did a great job with its video output. We can see the Squid Game plush inflating like a balloon and floating away until it vanishes. Another cool detail is how the plush’s shadow follows it as it flies upwards. But one thing of note is that only the head inflates, instead of the whole body. **Kling** Kling also did an impressive job. We can see the entire Squid Game Plush inflating and rising like a balloon. Notably, the outer layer of the plush, once inflated, takes on a rubbery texture, resembling an actual balloon. ## **Conclusion** In conclusion, Kling and Pika are quite similar in terms of quality, with Kling edging out in the 'Squish It' category, particularly when it comes to animating hands. However, it's important to note that Kling Effects currently offers only two options, which we used as examples in this blog. In contrast, Pika Art provides a much broader selection, with a total of 31 different Pikaffects to choose from. But we can definitely say that Kling can be counted as one of the top tools like pika. As always, we are excited as to where Kling and Pika are headed with these fun effects and are looking forward to what new effects both Pika and Kling will choose to do. And if you are interested, check out our collection of [generative AI APIs from PiAPI](https://piapi.ai/)! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Faceswap API Tutorial Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # How to use Faceswap API from PiAPI with Postman ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/f382de12e5ee4832004145703a7e0c08dd589b29-1919x783.png?rect=155,0,1566,783&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI May 24, 2024 Hi developers! We are very delighted to make this tutorial to show how you can use [PiAPI's Faceswap API](https://piapi.ai/faceswap-api) with [Postman](https://www.postman.com/)! Before we dive into this tutorial, do sign up for our Workspace, obtain your API Key, and check out the documentation for our Faceswap API endpoints. Now, let's get started! ## Tutorial Firstly, you will need to open up or download Postman. Click the "New" button on the top left of your screen and create a new HTTP request, then change the request type to "POST". ![An image of a Faceswap API setup tutorial of creating a new HTTP request and changing request type to "POST" in Postman](https://cdn.sanity.io/images/pr53lcef/production/1494dc0e0b216428922fc46cddca5c12b425fe60-1099x656.webp?q=75&fit=clip&auto=format)Setting up the Faceswap API in Postman Enter the Faceswap API's endpoint address from our docs into the endpoint input field, click on "Headers" and type "x-api-key" in the empty space under the "Key" text and enter your API Key under the "Value" text as shown in the example below. ![An image of a Faceswap API setup tutorial with the endpoint address, x-api-key and users' API Key in Postman](https://cdn.sanity.io/images/pr53lcef/production/67d9a6b0f4c1c34833cbb9fb8e81295434c63d7d-2612x1050.webp?q=75&fit=clip&auto=format)Entering PiAPI's Faceswap API endpoint address, the API Key entry, and associated value in Postman Next, click on "Body" located below the endpoint address, then click on "raw", copy the code from our docs and insert it into the body section. Press "Send", then a task id will be returned to you in the response section, and you will need to keep it for later use. Once you're done, proceed to the next step. ![A setup tutorial for generating a Faceswap API request in Postman by entering the target_image and the swap_image URLs into the code under the "raw" section in "Body"](https://cdn.sanity.io/images/pr53lcef/production/be679068fc967775e33c41218a5509c51f9a319f-4984x1307.webp?q=75&fit=clip&auto=format)The request body for generating a Faceswap task Now, we are going to fetch for the task that has been submitted. You will need to create a new HTTP request, change the request type to "POST", then copy the fetch endpoint URL from our docs into the endpoint input field, similar to the above steps. ![A setup tutorial of Faceswap API by entering x-api-key and users' API Key into the fetch endpoint in Postman](https://cdn.sanity.io/images/pr53lcef/production/8d4ef2d0366cb8dd75993f2835b69a45cd60f176-2646x1128.webp?q=75&fit=clip&auto=format)Entering the fetch endpoint url, the API Key entry, and associated value in Postman Then, enter the saved task id response into the body of the fetch endpoint, and press "Send". Once the result status shows "finished", you may copy the returned URL (as per arrow below) into a web browser and see your face-swapped image! ![An image of using the fetch endpoint to obtain the generated faceswapped image url ](https://cdn.sanity.io/images/pr53lcef/production/61a7ccb89cca5d0634f7f76e6db4abf597c6dee8-2794x1705.webp?q=75&fit=clip&auto=format)The Request HTTP call for fetching the faceswapped image Note: As you are sending the fetch request, if the returned "status" is either "pending" or "processing", then you should wait for a moment before you re-send the request again. ## Conclusion If you are wondering about pricing, please check out our [Faceswap page](https://piapi.ai/faceswap-api)'s pricing section for more information. We also provide custom dedicated deployment service to users who need solutions for specific requirements (ex. low latency, high concurrency, shorter queuing time). And this is how you can get started using PiAPI's Faceswap API with Postman! Thank you for reading through this tutorial. Do share with people who find this helpful and don't be shy to contact us with any feedback you might have! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Luma Dream Machine Comparison Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Luma Dream Machine 1.5 vs 1.0 - Comparison through Luma API ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/a85ff699fadb1216cd90d5b79ba08bc55c147f3c-2453x1300.png?rect=0,37,2453,1227&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI August 21, 2024 Hi everyone! On August 20th 2024, [Luma](https://lumalabs.ai/dream-machine) \- the team behind one of the best text/image-to-video generative AI model currently on the market, [announced on X](https://x.com/LumaLabsAI/status/1825639918539817101) that their new 1.5 version is now available for the public to try! ## Luma Dream Machine 1.5 Release ![A screenshot taken from X.com showing Luma announcing that Dream Machine 1.5 is now available. ](https://cdn.sanity.io/images/pr53lcef/production/301c3ec3effa91896bef09e1bde127cda8ba35cf-608x864.png?q=75&fit=clip&auto=format)Luma's announcement of Dream Machine 1.5's release on X.com With the new 1.5 version update, Luma promises better overall quality, better prompt adherence, and more accurate custom text rendering in the generated videos. Unfortunately, Luma did not provide a choice to select previous model version if one were to currently use their platform to generate videos. Thus, the difference between the former model and the new v1.5 model would be hard to evaluate. However, given PiAPI's position as the market leading generative AI API provider, which includes [Luma API (or Dream Machine API)](https://piapi.ai/dream-machine-api) as well, we are able to perform this comparison as we have to test our own products extensively before releasing them to the market (and continuously after the initial release). ## Text-to-Video Evaluation Framework For this comparison, we have the taken the [comprehensive text-to-video evaluation framework from Labelbox](https://labelbox.com/guides/a-comprehensive-approach-to-evaluating-text-to-video-models/), while adding "Text Adherence" into the mix since judging from our user feedback, text adherence is an important aspect of generative video model in order for it to become more prevalent as a productivity tool rather than just a fleeing entertaining toy. Thus, below are the various aspects (and their respective explaination) we will adopt to compare the output videos of different model versions. ### **Prompt Adherence** We'd assessed how well the output video matched the given text prompt. For example, in the given prompt: “A peaceful Zen garden with carefully raked sand, bonsai trees, and a small koi pond.” We'd looked to see if there was prompt adherence by looking at the presence of key concepts of the prompt: \- Is there a garden? \- Does it look peaceful? \- Is the sand present, and is it raked? \- Are there bonsai trees? \- Is the a small koi pond? _Scoring_ \- High: If all or most of the key concepts are present. \- Medium: If half the key concepts are present. \- Low: If less than half of key concepts are present. ### **Text Adherence** We'd assess the level of accuracy of the text reproduced in the video as per the given prompts, if there are any text requirements in the prompts. \- High: texts are reproduced accurately in the generated video \- Medium: texts are reproduced with minor mistakes in the generated video \- Low: texts are not reproduced or reproduced with major mistakes in the generated video ### **Video Realism** We'd assess how closely the generated video resembles reality, although reality is not always an appropriate benchmark depending on the context of the prompt. \- High: Realistic lighting, textures, and proportions. \- Medium: Somewhat realistic but with slight issues in shadows or textures. \- Low: Animated or artificial appearance. ### **Artifacts** We'd scan for any visible artifacts, distortions, or errors in the video, such as: \- Unnatural distortions in objects or backgrounds \- Misplaced or floating elements \- Inconsistent lighting or shadows \- Unnatural repeating patterns \- Unnatural movements \- Blurred or pixelated areas _Scoring_ \- High: If all or 5 of the errors are present. \- Medium: If 2 or 3 errors are present. \- Low: If 1 or 0 errors are present. ## v1.0 and v1.5 Video Comparison And now, let's check out the same-prompt comparison between Dream Machine 1.0 versus the new Dream Machine 1.5 version model. ![A video of an old man walking in a park in anime style, generated by Luma Dream Machine API in both version 1.0 and 1.5. ](https://cdn.sanity.io/images/pr53lcef/production/a8860552172788b7424ff68f8f51ddeb31003ae3-579x320.gif?q=75&fit=clip&auto=format)Prompt: "old man walking in a park, anime style." **Prompt Adherence:** Both videos display an old man walking and a park, although the 1.5 version has a prolonged shot where no old man is present, but this can be due to lack of specificity in the prompt. **Video Realism**: both versions show the basic elements of the anime style, and the 1.5 version show the shadow details from the trees in the park. **Artifacts:** The 1.0 version shows a significant error of the elderly man facing away from the shot but walking towards it. And the 1.5 version shows a prolonged shot with no human figure present. Overall, we see a slight improvement from the v1.5 video. ![A video of a tornado with the world "BYLD Network" on the outside, generated by Luma Dream Machine API in both version 1.0 and 1.5.](https://cdn.sanity.io/images/pr53lcef/production/74c949ded07d98038d2df4a4824ef5373de11ac5-579x320.gif?q=75&fit=clip&auto=format)Prompt: "create a tornado with the word 'BYLD Network' on the outside of it" **Prompt Adherence:** Both videos display a tornado with the v1.5 much more realistic than the v1.0 **Video Realism**: The proportion in the v1.0 is quite off as the tornado portrayed is also invisible. In the v1.5 video we can see elements flying slowing circling the eye of the tornado. **Text Adherence**: The v1.0 video spelled out "BYLD Network quite accurately with the Y and L overlapping a bit together. For the v1.5 video it spelled the word with a double B. **Artifacts:** The 1.0 version portrayed a much less accurate representation of the tornado compared to the v1.5 video. Overall, we see a general improvement from the v1.5 video, with the except on Text Adherence aspect. ![A video of a sunglassed teddy bear playing guitar in front of a waterfall, generated by Luma Dream Machine API in both version 1.0 and 1.5.](https://cdn.sanity.io/images/pr53lcef/production/e083c99e5e492c7ca247d17e169e0db874fe9726-579x320.gif?q=75&fit=clip&auto=format)Prompt: "a teddy bear in sunglasses playing electric guitar, dancing and headbanging in the jungle in front of a large beautiful waterfall" **Prompt Adherence:** Both videos display a teddy bear doning a pair of sunglasses, although if you google "teddy bear" most will bear more resemblence with the one from v1.5. Both video show a running fall amidst a jungle. However, v1.0 shows much better "headbanging" and playing motion compared to the relatively still v1.5 video. **Video Realism**: The level of realism displayed in the v1.0 video is very high given the teddy's dynamic movements, the following shadows, and the realistic human-like motions. The v1.5 videos on the other hand is very underwhelming given the static look of the character. **Artifacts:** The 1.5 showed a more static version of the teddy whereas the prompt specifically asked for "dancing and headbanging". For this prompt, it is quite clear that the v1.0 video is of a higher quality version. ![A video of a black dodge parked on asphalt around a "Kassir 34" sign, generated by Luma Dream Machine API in both version 1.0 and 1.5.](https://cdn.sanity.io/images/pr53lcef/production/ff43e880576f1fd6abd93f0cb8910aab819769c0-579x320.gif?q=75&fit=clip&auto=format)Prompt: "a black Dodge Challenger on asphalt drifts around a red 'Kassir 34' sign, viewed from above." **Prompt Adherence:** Both video displayed a black Dodge Challenger on asphalt, we see a red sign, the view is from the above, but none of the cars are drifting, which could be due to the lack of movement-specific training dataset. **Video Realism**: The level of realism displayed in the v1.5 is quite high - the lighting on the car, the texture of the car itself, and the shadows of the surrondings are all comparatively better than the version demonstrated in the v1.0. **Text Adherence**: The texts reproduced in the v1.5 video is higher compared to the v1.0 version; the latter texts spelled "Kassar" whereas the former spelled "Kassi 34", which is just one letter short of the text specified in the prompt. **Artifacts:** Neither videos showed the drifting motion as specified in the prompt. Other than that there does not seem any major artifiacts in the video. For this prompt, the v1.0 video is of a higher quality compared to the v1.0 version. ## Conclusion Based on the various examples provided above, we can see that Dream Machine 1.5 from Luma is indeed better than the previous 1.0 version, in overall quality, text adherence, and video realism. It should be noted that the better quality does not always happen as can be observed from the teddy bear example. However, given the probabilistic nature of generative AI model, this is to be expected. We hope that you found our comparison useful! And if you interested, check out the [generative AI APIs from PiAPI](https://piapi.ai/)! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Luma vs Kling Comparison Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Luma Dream Machine vs Kling - A brief comparsion using APIs ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/6bd9b4485260160ec5283a29654bfc125a7b9c7e-2623x1800.webp?rect=0,244,2623,1312&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI August 29, 2024 ## Introduction As OpenAI's [text-to-video model Sora](https://openai.com/index/sora/) rapidly gained popularity after the release of its several high-definition previews on Feb 15th 2024, the AI ecosystem was eagerly waiting for months for its launch to experiment with this newest text-to-video technology but they were of no avail. However, on June 12th, [Luma's Dream Machine](https://lumalabs.ai/dream-machine) was launched for public use. And two days prior, on June 10th, the Chinese short video platform [Kuaishou](https://www.kuaishou.com/) released their own [text-to-video model Kling](https://klingai.com/). Both product launches were able to make significant dents in the text-to-video generation space, with developers, tech enthusiast and content creator quickly utilizing the tools as part of their workflow. Thus, [PiAPI as the API provider for both Luma's Dream Machine and Kling](https://piapi.ai/), would like to briefly compare the two models and share as a reference for our users. ## Evaluation Framework Regarding the evaluation framework used for this comparison, we'd like to adopt the same framework as we had used in our [previous blog comparing Luma Dream Machines 1.0 vs 1.5](https://piapi.ai/blogs/luma-dream-machine-1-5-vs-1-0-comparison-through-luma-api), namely: - Prompt Adherence - Text Adherence - Video Realism - Artifacts For what each of these aspects mean and how they could be rated, feel free to read our previous blog for more detail. ## Same Prompt Comparison To effectively compare the outputs of these two models, we have decided to use the same prompt for both models. The prompts are submitted to Dream Machine and Kling using our [Dream Machine API (or Luma API)](https://piapi.ai/dream-machine-api), and our [Kling API](https://piapi.ai/kling-api) and the returned results are provided along with their analysis, as shown below. ![Two GIFs converted from videos of a little playing with sand castle on the beach, generated by Lum's Dream Machine and Kling](https://cdn.sanity.io/images/pr53lcef/production/87ecb260bfc2ac605d25367a2d769d1de96ffb8d-579x320.gif?q=75&fit=clip&auto=format)Prompt: On a warm summer afternoon with sunlight shining on the beach, the sea meets the sky in the far distance, gentle waves lap against the shore, and a beautiful little girl, about five or six years old, is playing on the beach. Her golden curls glisten, and her face beams with smile. She wears a pink dress, its hem gently fluttering in the breeze, and small beach sandals, her toes occasionally burying into the soft sand. With a tiny plastic shovel in her hand, she is trying to build a sandcastle. There are seagulls circle in the sky, and a few white sailboats in the distance. **Prompt Adherence** Both models shows important elements described in the prompt: an afternoon, sunlight, sandy beach, ocean, the litter girl with blonde hair and pink dress, and the boats in the far distance. The Luma model was able to get the seagull and sandal details well; whereas the Kling model was able to get the "toe buried in the sand" part well. The Luma model wasn't able to get shovel and the sand castle details where Kling depicted them well. **Video Realism** The Luma Model offered a slightly different visual effect, perhaps a bit too ideal and too unblemished. Kling's output on the other hand resembles the real-world more closely, with natural lighting and proportions. **Video Resolution** The Luma Model's resolution is high, with details like the texture of the hair, clothing, and the sparkle of the sea clearly visible, but the overall effect appears somewhat smooth due to the artistic processing. Kling's output also has high resolution, with details such as the sand, waves, and the girl’s hair strands appearing clear and natural, consistent with real-world resolution. **Artifacts** The depiction of the little girl's knees and legs are quite off in Luma's output, perhaps it is due to there is very little training data on that particular w-sitting position. And since Kling's output has the little girl standing up, one could make the assumption that Kling would have a similarly difficult time portraying the sitting posture accurately and realistically. ![Two GIFs converted from videos of a night city covered by shining lights, generated by Lum's Dream Machine and Kling](https://cdn.sanity.io/images/pr53lcef/production/7eaf862c27fdb758ac796667a36609301aa33653-579x320.gif?q=75&fit=clip&auto=format)Prompts: On a night in a modern metropolis, the camera overlooks from high above, outlining the city skyline with blinking lights. Then, the camera slowly descends, focusing on bustling streets. The neon lights shine brilliantly in colors of red, blue, green, and purple, illuminating the entire block. Pedestrians hustle along the sidewalks, some pausing to gaze at shop windows or check their phones. Vehicles passes by on the streets, their headlights flickering in the night. **Prompt Adherence** Both models captured most of the prompt descriptions: the night city, the neon lights, the overviewing camera angle, busy streets with people and cars. However, both models missed the slowly descending camera view part, perhaps it was due to the usage of the word "slowly". **Video Realism** Both videos showed a decent level of realism with the night lighting. The city skyline portrayed in the Luma video seems a bit whimiscal. **Video Resolution** Both videos had a relatively good quality of resolution. **Artifacts** The video from Luma shows some unnatural transitions between the lights in the background and those on the streets, particularly around the edges of buildings, where there is slight distortion and blurring. For Kling's video, the way that the vehicles shrinks in size and rapidly disappears as they approach the end of the street look very unnatural. ## Conclusion So above are the two examples of both text-to-video generation model processing complex, dynamic scenes with multiple details. It is up to readers like you to decide which model fared better, our team at PiAPI simply proposes a framework to evaluate the outputs and provide real test outputs for you :) We hope you found this comparison blog useful! If you are interested, please also check out [PiAPI](https://piapi.ai/) for our other generative AI APIs! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Kling 1.6 API Overview Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Kling 1.6 Model through Kling API ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI December 19, 2024 Hi developers! On December 19th 2024, [Kuaishou](https://kling.kuaishou.com/), the team behind [Kling AI](https://www.klingai.com/), has just released its new model, Kling 1.6, making the [announcement](https://x.com/Kling_ai/status/1869599147046871488) in a post on X! And here at [PiAPI](https://piapi.ai/), we already have the [Kling 1.6 API](https://piapi.ai/kling-api) available for our users! ![A screenshot of the official announcement on X about Kling 1.6](https://cdn.sanity.io/images/pr53lcef/production/91e694e496722e2a66cf0691f0b0e1d45dd28320-597x734.png?q=75&fit=clip&auto=format)Official announcement on X about Kling 1.6 With the release of Kling 1.6, Kuaishou has claimed that the new model has improved prompt adherence, more consistent and dynamic results, and a 195% overall improvement rate when compared with the Kling 1.5 model. As Kling API (before the update) is already one of the top AI video generation tools like Pika API or [Luma Labs Dream Machine API](https://piapi.ai/dream-machine-api), the new improvement can be a major update enhancing img2vid prompting for AI movie creation. However, at PiAPI, we have done our own versions 1.5 and 1.6 comparisons for both text-to-video and image-to-video, with the evaluation frameworks used shown below and the subsequent results shown in the blog. ## **Evaluation framework** ### **Text-to-video** For the text-to-video comparions between Kling 1.6 API and Kling 1.5 API we are going to be using [the comprehensive text-to-video evaluation from Labelbox](https://labelbox.com/guides/a-comprehensive-approach-to-evaluating-text-to-video-models/) plus "text adherence". This is the same framework we had used in [our previous blog comparing Luma Dream Machines 1.0 vs 1.5](https://piapi.ai/blogs/luma-dream-machine-1-5-vs-1-0-comparison-through-luma-api) namely: - • Prompt Adherence - • Text Adherence - • Video Realism - • Artifacts ### **Image-to-video** For the image-to-video comparisons between Kling 1.6 API and Kling 1.5 API we are going to be using the [AIGCBench (Artificial Intelligence Generated Content Bench)](https://www.benchcouncil.org/AIGCBench/).This is the same framework we used in our [previous blog about using the Kling Motion Brush through Kling API](https://piapi.ai/blogs/the-motion-brush-feature-through-kling-api) namely: - • Control-Video Alignment (Prompt adherence) - • Motion Affects - • Temporal Consistency - • Video Quality ## **Text-to-video Comparison** For the text-to-video comparisons between Kling 1.6 API and Kling 1.5 API, we are going to simply put the exact same prompts into both models then directly compare the resulting videos side by side. ### **Example 1** ![A GIF of a Christmas tree generated by Kling API in both versions 1.5 and 1.6](https://cdn.sanity.io/images/pr53lcef/production/edbf78adc7164095fc67404b75ba2486527d7996-600x338.gif?q=75&fit=clip&auto=format)Prompt: "The camera rotates around a large, decorated Christmas tree as snow falls gently. It slowly zooms in on the glowing golden star at the top of the Christmas tree." Both videos have some issues with adhering to the prompt. In the video generated by the Kling 1.5 API, the golden star is not placed on top of the Christmas tree. Meanwhile, in the video generated by the Kling 1.6 API, the camera fails to rotate around the tree as expected. While both videos are quite realistic, the Kling 1.6 video loses some points due to the snow falling indoors, which doesn't follow real-world physics. Apart from that, neither video exhibits any noticeable artifacts. Overall, for this particular example, Kling 1.5 performs slightly better than Kling 1.6. ### **Example 2** ![A GIF of a woman running on a track field holding a bottle of water generated by Kling API in both versions 1.5 and 1.6](https://cdn.sanity.io/images/pr53lcef/production/c259e5f965d74e28a583ae11294e7bf622add3ab-600x338.gif?q=75&fit=clip&auto=format)Prompt: "A woman is running on a track field, holding a bottle of water and drinking from it. She is wearing a shirt with the word 'NFL' clearly printed on it" Both videos have a woman running on a track field and holding a bottle of water, but Kling 1.6 API does not have the woman drinking from the water bottle, whereas Kling 1.5 follows the prompt by including this detail. Both models exhibit poor text adherence, as the words on the woman's shirt in both videos do not resemble "NFL" in any way. Despite this, both videos are realistic and free of visible artifacts. Overall, Kling AI 1.5 API performs better in adhering to the prompt compared to Kling AI 1.6 API. ### **Example 3** ![A GIF of a cartoon bird with the flu sneezing into a tissue, with a billboard behind it generated by Kling API in both versions 1.5 and 1.6](https://cdn.sanity.io/images/pr53lcef/production/819e956d15159f484ea08a57e3c4b94077ba26c4-600x338.gif?q=75&fit=clip&auto=format)Prompt: "A cartoon-style bird, visibly sick with the flu, sneezing into a tissue. Behind it, a billboard reads 'Bird Flu Medicine' in bold, clear text." Both videos have a cartoon-style bird sneezing into something, but they differ in how they follow the prompt. Kling 1.6 adheres more closely to the prompt by having the bird sneeze into a tissue, while Kling 1.5 shows the bird sneezing into a pink towel. As for text adherence, neither video fully follows the prompt as both videos do not display the words "bird flu medicine" on the billboards behind the birds. In terms of animation style, both videos look good within their respective cartoon animation styles. However, there are some visible artifacts in each. In the Kling 1.6 AI API video, the hand holding the tissue appears too humanoid, resembling a human hand rather than a bird wing. Additionally, the fingers seem to pass through the tissue. In the Kling 1.5 API video, a flickering artifact briefly appears in the bottom left corner of the screen during the middle of the video. Overall, both videos are similar in quality; with a little bit more improvement, Kling 1.6 API could even be a good animated movie generator! ## **Image-to-video Comparison** For the image-to-video comparisons between Kling 1.6 API and Kling 1.5 API, we will first generate an image using FLux API. This image, along with an identical prompt, will then be used as input for both models. ### **Example 1** Below is the image generated using FLux API, which was then used as input for Kling API in this example. ![An image of Superman flying in the sky generated by Flux](https://cdn.sanity.io/images/pr53lcef/production/6dc1aedaf1b3ef73aae8bbe0540bb054fd35925b-400x224.png?q=75&fit=clip&auto=format)Prompt: "A hyper-realistic side view of Superman flying through a clear blue sky, his red cape flowing dramatically behind him, arms fully extended forward in a classic flying pose." Now that we have an image generated by FLux API, we will be inserting that image alongside a new prompt into both Kling 1.5 API and Kling 1.6 API, and below are the videos generated ![A GIF of superman flying in the sky generated by Kling API in both versions 1.5 and 1.6](https://cdn.sanity.io/images/pr53lcef/production/357f537d4d42143e6bc06bc7c74b65f8cdb1f016-600x338.gif?q=75&fit=clip&auto=format)Prompt: "Superman is flying through the sky at high speed. The camera follows him, smoothly tracking his movement. As he continues flying, the camera gradually zooms in, focusing on his face until it fills the frame." The videos generated by both Kling 1.5 API and Kling 1.6 API closely follow the prompt, having Superman flying with the camera zooming in on his face. Both videos exhibit a similar level of dynamism, particularly with the capes flowing in the background, and maintain consistent motion throughout. There are no noticeable artifacts in either video. Overall, the quality of both videos is similar. ### **Example 2** Below is the image generated using FLux API, which was then used as input for Kling AI API in this example. ![An image of a cat in Steve Harvey's hands generated by FLux](https://cdn.sanity.io/images/pr53lcef/production/807d665201192259454baa5976078722d9bb7f1c-400x224.png?q=75&fit=clip&auto=format)Prompt: "Steve Harvey standing behind the Family Feud podium, holding a fluffy white cat in his arms. The Family Feud logo is prominently displayed on the front of the podium." Now that we have an image generated by FLux API, we will be inserting that image alongside a new prompt into both Kling 1.5 AI API and Kling 1.6 AI API, and below are the videos generated ![A GIF of a cat jumping out of Steve Harvey's hands generated by Kling API in both versions 1.5 and 1.6](https://cdn.sanity.io/images/pr53lcef/production/6a1d365b2662825248cd99c55e2c66b1324deef3-600x338.gif?q=75&fit=clip&auto=format)Prompt: "A man is holding a cat in his hands. Suddenly, the cat leaps out of his hands, jumping toward the camera. The man looks shocked and surprised as the cat jumps away from him, moving quickly toward the viewer." Kling 1.6 AI API adheres more closely with the prompt than Kling 1.5 AI API. In the video generated by Kling 1.6, the cat jumps directly toward the camera, while in the video created by Kling 1.5, the cat jumps to the left. Both videos are dynamic, but the Kling 1.6 video is a lot more realistic. The expression on Steve Harvey's face looks more natural, and both his movements and the cat's movements appear more natural. Additionally, the Kling 1.6 video is free of visible artifacts, unlike the Kling 1.5 video, where a noticeable artifact appears after the cat jumps from Steve Harvey's hands—specifically, a small, cat-like creature that seems to appear out of nowhere, which is clearly unrealistic. Overall, the video produced by Kling 1.6 is far better in terms of quality when compared to the one generated by Kling 1.5. ### **Example 3** Below is the image generated using FLux API, which was then used as input for Kling API in this example. ![An image of an anime-style picture of a girl fishing generated by FLux](https://cdn.sanity.io/images/pr53lcef/production/a494fec3ba8b63fca4d83fc30e6fbc01bbc628cf-400x224.png?q=75&fit=clip&auto=format)Prompt: "Close-up of an anime-style girl with a focused expression, standing on a wooden dock over a calm lake, holding a fishing rod. The serene water and soft, scenic background fade out, focusing on her face and fishing action." Now that we have an image generated by FLux API, which looks straight out of an anime art ai generator library, we will be inserting that image alongside a new prompt into both Kling 1.5 API and Kling 1.6 API, and below are the videos generated. ![A GIF of an anime-style scene of a girl fishing generated by Kling API in both versions 1.5 and 1.6](https://cdn.sanity.io/images/pr53lcef/production/f816504410514486903d91a0dfafc7adcdd55d82-600x338.gif?q=75&fit=clip&auto=format)Prompt: "Anime-style video, A girl uses all her strength to reel in a big fish from the lake, then pumps her fist in the air in triumph after catching it." Neither video fully adheres to the prompt. In the video generated by Kling 1.5 API, the girl fails to pump her fist in the air after catching the fish. Meanwhile, in the Kling 1.6 API video, there is no fish at all. Both videos feature dynamic motion effects. The lake's water in the background moves realistically, and the girl moves dynamically in both clips. However, the animation in the Kling 1.6 video appears much smoother overall. That said, in the Kling 1.5 video there is a very visible artifact the girl's face undergoes unnatural morphing. Overall, Kling 1.6 is slightly better than Kling 1.5 for this example. ## **Conclusion** Based on the six examples provided, it's clear to see that there are minimal differences between Kling 1.5 API and Kling 1.6 API for text-to-video generation. In fact, considering the three examples we’ve analyzed, you could even argue that Kling 1.5 outperforms Kling 1.6 in this area. However, when it comes to image-to-video generation, the Kling 1.6 API shows significant improvements, particularly in terms of movement quality and how well the model follows prompts related to movement. With that being said, we still don't believe that it is a 195% improvement when compared to Kling 1.5 like Kuaishou claimed, but these improved aspects would make the tool very valuable for workflows such as creating a motion meme. With this major leap, we can see that Kling 1.6 is on par or even exceeds other tools on the market, such as the popular Sora video generator. It can reimagine an image to video using AI very well, it can be a tool for artwork creation (ex. if developers want to create an AI frame generator), and it can even be a great tool for lip sync AI. We hope that you found our comparison useful! And if you are interested check out our [other generative AI APIs from PiAPI!](https://piapi.ai/) * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Marvel Animation APIs Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Luma API & FLux API - Exploring the Marvel Multiverse ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/a02a61525e85f308c20fec69ec9cce6045436290-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI September 14, 2024 ## **Introduction** Ever wonder how to breathe new life into your FLux creations? In this blog, we will explore some examples of combining these two AI APIs in action, creating dynamic videos as per the most popular trends! ## **Example 1: Tom Cruise Iron Man** In our first example, we’ll explore a fan-favorite scenario: the Iron Man character portrayed by Tom Cruise - and we will be using the AI APIs to generate a short scene of this fictional character. In terms of workflows, we will be testing three different workflows for this example, to help us better understand the steps involved, and the respective output qualities. ### **Workflow 1: FLux to Luma** For this workflow, we will first generate the image for this fictional character using FLux API, and then we will use that image along with another prompt to generate the video using the Luma API. Below is the image that we have generated using FLux API, with its prompt in its description (all the prompts used in this blog are edited by GPT). The image generated by FLux API will then be put into Luma API ![PNG image of Tom Cruise in an Iron Man suit staring into the camera, generated by FLux](https://cdn.sanity.io/images/pr53lcef/production/de17a56c0af1566a89378c3126346ad80ccbe87a-400x301.png?q=75&fit=clip&auto=format)Prompt: "Ultra-realistic, high-definition portrait of Tom Cruise wearing a custom-designed Iron Man suit, with intricate metallic textures and advanced futuristic technology. The suit has a sleek, streamlined design with glowing blue energy sources. Tom Cruise is standing in a heroic pose, in a futuristic cityscape at dusk, with neon lights reflecting off the suit. The atmosphere is cinematic, with a dynamic blend of realism and sci-fi. Hyper-detailed face, showing intensity and determination, with perfect lighting and shadows to enhance realism." Now that we have the image generated by FLux API, we will be inserting that image alongside a new prompt into Dream Machine API, and below is the video generated. ![GIF of Tom Cruise in an Iron Man suit staring into the camera and then looking away from the camera as the camera slowly pans from right to left, generated by Luma](https://cdn.sanity.io/images/pr53lcef/production/110a30d75041b68a1c319da4c670d1eaf90a5f8a-600x444.gif?q=75&fit=clip&auto=format)Prompt: "Tom Cruise looks away from the camera slowly, as the wind gently blows his hair. The blue energy sources on his chest and hands glow and flicker lightly. The camera movement is panning, panning from left to right, showing the futuristic city lights reflecting off his metallic suit" ### **Workflow 2: Real Image to Luma** For the second workflow, we have found a real image of Tom Cruise on the internet (see below), and we will use it along with a new prompt to generate the video using the Dream Machine API. ![PNG Image of Tom Cruise looking into the camera smiling](https://cdn.sanity.io/images/pr53lcef/production/d3b1c64520bcb313070d5784526db1125a3d58da-400x267.png?q=75&fit=clip&auto=format)An image of Tom Cruise found online to be used as an input to Luma For the prompt in this workflow, we will have to specify the "man in a red and yellow Iron Man suit" because the Tom Cruise image that we found obviously doesn't have the Iron Man suit. In contrast, Workflow 1's image includes an Iron Man suit since the image is generated by FLux, thus the omission in its prompt. Below is the video generated using the prompt (shown under the video GIF) and the input image found online. ![GIF of Tom Cruise looking into the camera smiling at the camera then looking to his left, with the camera slowly pans from right to left, generated by LUMA](https://cdn.sanity.io/images/pr53lcef/production/1a440aecccf61821bc4af94d4df69b3767432466-600x444.gif?q=75&fit=clip&auto=format)Prompt: "Tom Cruise in a red and yellow Iron Man suit looks away from the camera slowly, as the wind gently blows his hair. The blue energy sources on his chest and hands glow and flicker lightly. The camera movement is panning, panning from left to right, showing the futuristic city lights reflecting off his metallic suit" ### **Workflow 3: Just using Luma** And for the final workflow, we will not use any image as an input to Luma, but only use a relevant prompt to generate the video using the API. The main difference between the prompts for this workflow and Workflow 1 is that in Workflow 1, the image already features Tom Cruise in an Iron Man suit, so we don't need to specify the "Iron Man suit" part. Whereas this workflow has no initial image, thus needing the specification in the prompt. And below is the video generated by Luma API, using only the prompt under the GIF. ![GIF of Tom Cruise in an iron man suit looking into the camera, and then looking to his left, while the camera slowly pans from right to left, generated by LUMA](https://cdn.sanity.io/images/pr53lcef/production/54b4d37bf0a3d96e27e63728559ba67ae23a961a-600x332.gif?q=75&fit=clip&auto=format)Prompt: "Tom Cruise in a red and yellow iron man suit looking into the camera but then looks away from the camera slowly, as the wind gently blows his hair. The blue energy sources on his chest and hands glow and flicker lightly. The camera movement is panning, panning from left to right, showing the futuristic city lights reflecting off his metallic suit" ### **Takeaways** By comparing the results above, we think that the result from Workflow 1 (FLux to Luma) is the most realistic and detailed output. In Workflow 2 (Real image to Luma), we refined the prompt to specify Tom Cruise wearing a red and yellow Iron Man suit, as he obviously wasn't wearing one in the real image. However, despite the prompt, the final result did not include the suit. In Workflow 3 (Just using Luma), we also refined the prompt to specify Tom Cruise wearing a red and yellow Iron Man suit, as no initial image was used. The result is not as high resolution as that from Workflow 1. We think this is because the high quality image from FLux "primed" the Luma model to generate higher-quality video. Thus, if you want the best possible output, we recommend you to use Luma Dream Machine API in conjunction with the image from FLux. ## **Example 2: Henry Cavill Wolverine** In the second example, we’ll revisit a concept fans of the _Deadpool_ _and Wolverine_ movie may be familiar with, the fictional character Wolverine played by Henry Cavill. Although many may be disappointed by his brief cameo in the movie, Luma API and FLux API will allow us to explore an alternate reality where Henry Cavill took on the iconic role of Wolverine, instead of Hugh Jackman. First, we used FLux API to generate an image of Henry Cavill Wolverine; you can see below for the output image and the prompt. ![PNG image of Wolverine Henry Cavill, generated by FLux](https://cdn.sanity.io/images/pr53lcef/production/123166ab980567105a528836990b0ad2c882cd77-400x320.png?q=75&fit=clip&auto=format)Prompt: "Ultra-realistic, highly detailed image of Henry Cavill as Wolverine, wearing the classic black and yellow X-Men suit with rugged textures. He has a muscular, bulky physique, thick sideburns, and sharp adamantium claws, three on each hand, extended from his knuckles. His hair is messy but styled, with intense, brooding eyes. The setting is a dark, misty forest at night, with moonlight subtly illuminating his face, adding a dramatic shadow effect. Wolverine is in a dynamic combat-ready pose, ready to strike. The atmosphere is tense and gritty, with dirt and scratches on his costume, emphasizing a recent battle." Then, we input the image generated into Luma API with a new prompt. You can see below for the output GIF from Luma and the prompt used. The output is quite dynamic as you can see. ![GIF of the camera zooming into Wolverine Henry Cavill, generated by Luma Dream Machine](https://cdn.sanity.io/images/pr53lcef/production/f17d77d5788b08fd799bc466578c243fbf0ac6ac-600x444.gif?q=75&fit=clip&auto=format)Prompt:"A muscular man in a yellow and black suit, standing in a fighting stance with sharp claws, breathes heavily, his body subtly moving up and down with each breath. The camera slowly zooms in while still focusing on the man, while mist and light flickers in the background enhance the intensity" ## **Example 3 Robert Downey Jr Dr Doom** In the final example, we'll explore the highly anticipated concept of the fictional character Dr. Doom, portrayed by Robert Downey Jr (RDJ). RDJ Doom takes a new direction for the Marvel universe, and by using the APIs, you can visualize this concept before Marvel releases its first glimpse of Robert Downey Jr. as Dr. Doom. As with the previous examples, we will first need to generate an image of RDJ Doom using FLux API with the prompt provided under the output image. ![PNG image of Robert Downey Jr Doom](https://cdn.sanity.io/images/pr53lcef/production/2bd2e87f5c43d999482c6f216eed0647ec7c188a-400x301.png?q=75&fit=clip&auto=format)Prompt: "Ultra-realistic portrait of Robert Downey Jr. as Doctor Doom from Marvel Comics, without a mask, wearing Doctor Doom’s iconic green cloak and metallic armor. His hood is up, covering part of his head but still revealing his intense and serious expression. The hood casts subtle shadows on his face, giving him a mysterious and powerful aura. The armor is intricately detailed, with visible wear and tear, suggesting battles fought. The background is dark and ominous, featuring mystical and technological elements, with faint glowing machinery. The lighting should create dramatic shadows, highlighting both his face and the folds of his cloak." The image generated will then be used in the Luma API, along with a prompt shown below the output GIF. We personally like the intense look on the character and the clockwork details as the camera pans to the left. ![A GIF of Robert Downey Jr Doom staring intensely into the camera as the camera pans to the left, generated by Luma Dream Machine](https://cdn.sanity.io/images/pr53lcef/production/cd8589ff52628621867169ae11076b47f8fe0362-600x444.gif?q=75&fit=clip&auto=format)Prompt: "A man with an intense gaze, his green hood swaying gently in the wind as the camera slowly circles around him, maintaining focus on his sharp expression and face" ## **Conclusion** We hope you've enjoyed our little experiment and can try a few other ideas yourself! If you're interested in our [other AI APIs](https://piapi.ai/), feel free to check them out! Happy creating! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Animate Historical Figures Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Bring Historical Figures to life using AI like Kling API ![](https://cdn.sanity.io/images/pr53lcef/production/5ae6f61987c78a292519695917236f5b964df7b8-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) February 21, 2025 If you've been on the internet in the past few years you’ve likely seen the viral AI historical figures videos popping up all around social media. And if you're curious on how to recreate these cool videos with Artificial intelligence historical figures, you're in the right place. With [PiAPI](https://piapi.ai/), it's easier than ever to create your very own AI generated historical figures videos and bring history to life in a whole new way using [Kling API](https://piapi.ai/)! In this blog, we'll explore how all this works and showcase three examples of historical figures brought to life through AI. ## **How it works** Here’s how it works: First, we upload an image or multiple images of historical figures into Kling API or any AI video generation model of your choice. Next, we add a prompt specifying what we want the historical figures to do in the video. And finally, we just wait for Kling API or the AI video generation model to generate the video for you! ## **Example 1: Cleopatra** For our first example, we’ll focus on the most recognizable pharaoh, Cleopatra. We’ll be using the famous painting "Cleopatra" by John William Waterhouse, created in 1888. This masterpiece is currently housed in the Tate Britain Collection in London. ![PNG image of a painting of Cleopatra which will be used as input into Kling API](https://cdn.sanity.io/images/pr53lcef/production/1bcced981a4eb14af421e6fb1ef341e99e3797ad-400x465.png?q=75&fit=clip&auto=format)Painting of Cleopatra which will be used as input into Kling API Next, the image will be put into Kling API, along with the prompt shown below the GIF. We find it really impressive how fluid and smooth the motions are. We’re especially drawn to the fingers of the right hand, which point directly at the viewer. Unlike many AI-generated visuals, where fingers can often be a weakness, in the video of Cleopatra generated by AI we made, they are perfectly generated and animated. ![A GIF of Cleopatra ai looking at the camera then pointing at it generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/2f172bf0e3f6d46cb999fbe7ff83e116099f4137-600x702.gif?q=75&fit=clip&auto=format)Prompt: "The woman looks to the camera then points at it" ## **Example 2: George Washington** For our second example, we’ll be using this iconic portrait of George Washington, which serves as his presidential portrait. Painted by Gilbert Stuart in 1803, this renowned portrait is titled simply "George Washington." It is now housed in the National Gallery of Art collection in Washington, D.C. ![PNG image of a painting of George Washington which will be used as input into Kling API](https://cdn.sanity.io/images/pr53lcef/production/8d0e089a4f4f1975871e2d7bf907be1a4fa7a019-400x486.png?q=75&fit=clip&auto=format)Painting of George Washington which will be used as input into Kling API Next, we uploaded the image of George Washington into Kling API with the prompt shown below. We believe the animation is both smooth and realistic, particularly the way George Washington smiles and laughs. The subtle wrinkles around his eyes as he smiles add a touch of realism. ![A GIF of George Washington laughing generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/e09737a729d4bb14d3531bf91576d22458e1e6ec-600x735.gif?q=75&fit=clip&auto=format)Prompt: "George Washington nodding his head then laughing" ## **Example 3: Alexander the Great** For our final example, we are going to do something a little bit different. nstead of a painting, we’ll be using a photograph of the statue Alexander the Great, signed by Means of Pergamon, son of Aias, who is believed to be the sculptor. Created in the 3rd century BCE, this statue is now housed in the Istanbul Archaeology Museum. ![JPEG image of a statue of Alexander the Great](https://cdn.sanity.io/images/pr53lcef/production/0d81310ea58070e3bc5a93c319f8b9614016a3b4-400x600.png?q=75&fit=clip&auto=format)Statue of Alexander the Great Next, we uploaded the image into the Kling API along with the prompt, which you can see below the video. The vide looks pretty cool and aesthetically pleasing. The fingers are generated without any issues along with the shadow that the hand casts. ![JPEG image of a statue of Alexander the Great smoking generated by Kling API](https://cdn.sanity.io/images/pr53lcef/production/323b6a5a579f756f31cf6ddb75a8ec6bdb0c5f05-600x917.gif?q=75&fit=clip&auto=format)Prompt: "The Alexander the great statue pulling out a cigarette and smoking it" ## **Conclusion** As you can see from the three examples above AI is quite good at bringing historical figures to life, especially the Alexander the Great and Cleopatra videos. Although this is not an AI reconstruction of the historical figure (We might do this in a later blog!), AI image to video generation has come a long way. We're excited to see how people will keep using AI in even more fun and creative ways, just like this! And if you're interested in [our other APIs](https://piapi.ai/), feel free to check them out! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## API Comparison Insights Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Crush it Melt it through Pika API , Kling API & Luma API ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/ba709308f4688f21b3e7b254a49bd17aecdfb688-1280x641.png?rect=0,1,1280,640&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI October 9, 2024 ## **Introduction** On October 1st 2024, Pika Labs officially [announced](https://x.com/pika_labs/status/1841143349576941863) the release of [Pika 1.5](https://pika.art/), claiming their model now has more realistic movements and big screen shots. But the most exciting and popular addition is the new Pikaffects feature, which lets you create effects that "break the laws of physics" with the click of a button, no text prompt needed. ![A screenshot of Pika Lab's announcement on X about Pika 1.5](https://cdn.sanity.io/images/pr53lcef/production/9107dee245a6efcafd48837ca9069c603aae61fe-716x763.png?q=75&fit=clip&auto=format)Pika Lab's announcement on X about Pika 1.5 The "Crush it Melt it" trend has taken off on social media, with Pika's official video alone racking up nearly 14 million views on TikTok in the past week. Other videos following the trend have pulled in between 100,000 and 1 million views each. As the leading AI API provider, we at [PiAPI](https://piapi.ai/) are also deciding whether we should launch Pika API, since we already offer [Kling API](https://piapi.ai/kling-api) and [Luma API](https://piapi.ai/dream-machine-api). As part of this decision-making process, we looked at the new "Crush it Melt it" trend and tried to replicate the effect and compare the results between Pika API, Kling API, and Luma's Dream Machine API. ## **Comparisons** But before we start comparing the three different AI models, let us first establish our comparison method.For Pika 1.5 API, we will simply apply the corresponding Pikaffect. For Kling API and Luma API, we'll try to replicate the Pika Art API effect by testing a variety of prompts and selecting the best result for the comparison. ### **Example 1: Crush it** For our first example, we are going to use the [Moo Deng Hippo Plushie](https://www.kawaiies.com/products/kawaii-moo-deng-baby-hippo-plushie?srsltid=AfmBOoo-xIQYsb_jNj6ymPkUELRwjz0Wl_k5H8SKdhnEwfqlGK6ebNy_). Seeing as this trend has been popular with plushies and figurines, we thought we'd try using them as well and see what results we get. Below is an image of the Moo Deng Hippo Plushie, which we’ll use alongside unique "Crush It" prompts or the Crush It Pikaffect as input for the three AI models we are going to compare. ![PNG image of a Moo Deng Plushie that will be used as input into the APIs](https://cdn.sanity.io/images/pr53lcef/production/46c14041da8543e2b18a10ac1ce4dc1a8b62ddad-400x200.png?q=75&fit=clip&auto=format)The image of a Moo Deng Plushie that will be used as input into Pika API, Kling API, and Luma API And here are the output videos of the three different AI models, with the prompts used shown in the description. ![GIF of the comparison for "Crush it" of Luma API, Pika API, and Kling API](https://cdn.sanity.io/images/pr53lcef/production/a6f8a97f69bddf12c1849441756834234b758c3a-800x341.gif?q=75&fit=clip&auto=format)Luma (Prompt: Hydraulic press crushens and flattens Hippo Plushie) vs. Pika (Pikaffect: Crush it) vs. Kling (Prompt: Hydraulic press crushing hippo plushie) **Pika** Pika's output is the most impressive, with the hydraulic press smoothly crushing the Moo Deng Plushie, aligning with the Pikaffect "Crush It" prompt. The video shows fluid and dynamic movements as the hydraulic press crushes the plush, resulting in a realistic final result with no artifacts. **Kling** Kling's output ranks second overall, though it doesn't fully adhere to the prompt. Instead of a hydraulic press crushing the Moo Deng Plushie, it has a strange metal object crushing it. The video is fluid and dynamic, but the plushie exhibits strange unrealistic movements, with its body twitching and shaking. On the plus side, there are no visible artifacts. **Luma** Luma's output was by far the worst, not adhering to the prompt at all. There was no hydraulic press even though it was specified in the prompt, instead the Moo Deng Plushie fell over and morphed into something unrecognizable. The whole thing felt unrealistic, especially with the plushie’s random transformation. Also, an artifact appeared when it fell onto what looked like an iron table, even though the prompt never mentioned any kind of table. Overall, Pika's output far outshines Kling or Luma in the "Crush It" test. ### **Example 2: Melt it** For our second example, we are going to use a figurine of the popular [YouTuber KSI](https://www.youtube.com/@jjolatunji). Below is an image of the KSI figurine, which we’ll use alongside unique "Melt It" prompts or the Melt It Pikaffect as input for the three AI models we are going to compare. ![JPEG image of the KSI figurine that will be used as input into the APIs](https://cdn.sanity.io/images/pr53lcef/production/2dd72c5011485f8cb648df1516f47b35bd301cbe-243x400.png?q=75&fit=clip&auto=format)The image of the KSI figurine that will be used as input into Pika API, Kling API, and Luma API And here are the output videos of the three different AI models, with the prompts used shown in the description. ![GIF of the comparison for "Melt It" using all three AI APIs](https://cdn.sanity.io/images/pr53lcef/production/49c5f93b12b59b1d505ddf9bb826bf093c8ab6f8-600x338.gif?q=75&fit=clip&auto=format)Luma (Prompt: Static camera shot of the figurine melting into liquid form and becoming a puddle on the ground) vs. Pika(Pikaffect: Melt It) vs. Kling (Prompt: Static camera shot of the figurine of the man melting into liquid form and becoming a puddle) **Pika** Pika delivers an impressive result with the KSI figurine melting realistically, and the final touch of the shoes melting last is a nice addition. The motion is fluid and dynamic, with the entire melting process feeling realistic. **Kling** Kling's video is pretty well made, showing the KSI figurine's head melting first, but the issue is that it doesn't turn into a puddle as the prompt described. The way the melting process moves and flows feels natural, closely following real-world physics. **Luma** Luma's output is also really good—the KSI figurine's arms detach and melt into a puddle on the ground, just as described in the prompt. The motion is dynamic; the melting looks real, and the liquid physics are highly impressive. Overall, they all produce similar results for the "Melt It" prompt, and none of the videos have any artifacts. ### **Example 3: Cakeify It** In this third example, we’re taking a [Minecraft grass block](https://minecraft.wiki/w/Grass_Block) and transforming it into a cake! Below is an image of the Minecraft grass block, which we’ll use unique "Cakeify It" prompts and the Cakeify It Pikaffect as input for the three AI models we are going to compare. ![JPEG image of the Minecraft grass block that will be used as input into the APIs](https://cdn.sanity.io/images/pr53lcef/production/eef52c5e021d9558b0fc5db1002543a8c794e1ed-400x300.png?q=75&fit=clip&auto=format)The image of the Minecraft grass block that will be used as input into the three APIs And here are the output videos of the three different AI models, with the prompts used shown in the description. ![GIF of the comparison for "Cakeify It" into the 3 APIs](https://cdn.sanity.io/images/pr53lcef/production/23f7c50391282553c30ef2ec7bcaa1d039ec0958-800x341.gif?q=75&fit=clip&auto=format)Luma (Prompt: Realistic video of a kitchen knife cutting through the minecraft grass block and cutting it open, with the insides being cake) vs. Pika (Pikaffect: Cakeify It) vs. Kling (Prompt: Same as Luma's) **Pika** The result from Pika is amazing, looking just like those trendy ["cake or not" videos](https://www.youtube.com/watch?v=KIRE8yscK_o) from a while ago. The hand holding the knife moves smoothly, the knife itself looks good, and the cutting action feels dynamic and lifelike, even leaving cake crumbs on the knife after slicing through the Minecraft grass block. But if you look closely, you'll notice an artifact—the tip of the knife is left in the cake after it's been used to cut it open. **Kling** Kling didn't do so well in this example. Near the end, they cut open the Minecraft grass block, revealing a plain white interior instead of a cake-like one. But the more glaring issue is that midway through the video, it abruptly cuts to a completely different object - a more realistic, cake-like version of the Minecraft grass block. Another problem is that the cut on the object doesn’t align with where the knife is actually cutting. **Luma** Luma did a decent job, although the output isn't as clean as Pika's and has random objects cluttering the video. We see the kitchen knife blade come down, slicing through the Minecraft grass block, and inside, it definitely looks like cake. But after the blade comes down, it seems to vanish, and the finished shape of the object doesn’t line up with where it was cut. There are also some very noticeable artifacts, like random objects falling onto the cake as it’s being sliced. Overall, Pika certainly takes the cake in this example. ### **Example 4: Explode It** In this example, we'll use an image of a [Joaquin Phoenix](https://www.imdb.com/name/nm0001618/) Joker figurine. Below is an image of the Joker Figurine, which we’ll use alongside unique "Explode It" prompts or the Explode It Pikaffect as input for the three AI models we are going to compare. ![JPEG image of the Joker figurine that will be used as input into the APIs](https://cdn.sanity.io/images/pr53lcef/production/87796d66e2fcc17fa3d9a0aa859c31a27e872c81-400x400.png?q=75&fit=clip&auto=format)The image of the Joker figurine that will be used as input into the APIs And here are the output videos of the three different AI models, with the prompts used shown in the description. ![GIF of the comparison for "Explode It" of the APIs](https://cdn.sanity.io/images/pr53lcef/production/d4f60f7b9cc2847e23db23e9ef7f032dd74a1b2d-600x338.gif?q=75&fit=clip&auto=format)Luma (Prompt: Close-up of a joker figurine exploding in slow motion. Camera zooms in as cracks appear and fragments fly outward in all directions. Dust particles catch the light from a nearby light, creating a dramatic, chaotic moment.) vs. Pika (Pikaffect: Explode It) vs. Kling (Prompt: static slow-motion shot of the figurine as it breaks apart and explodes into tiny pieces of itself that fly away from the explosion) **Pika** Pika did a great job in this example. The explosion looks amazing, especially with all the little pieces scattering from the blast. A little impressive detail is that as the Joker figurine exploded, the stand remained untouched. It also looks realistic and closely matches real-world explosion physics. **Kling** Kling’s output was also impressive, though the size of the explosion didn’t quite match Pika’s, with only a small burst at the base of the figurine. It didn't fully adhere to the prompt though, which asked for a static shot of the figurine, but instead, the camera rotates around it. The explosion physics are impressive, closely resembling real-world physics as the small blast knocked off the figurine’s foot and base. **Luma** Luma performed the worst in this example, as the "explosion" didn’t even cause the slightest damage to the figurine. Instead, we notice that there are what seem to be fragments of the figurine flying out, despite the figurine being completely undamaged. Overall, Pika also outshines both Luma and Kling in this example as well. ### **Example 5: Squish It** For the fifth example, we are going to use an [alien plou plush](https://www.amazon.com/Generic-Stuffed-Emotion-Plushie-Childrens/dp/B0BC98T6ZG). Below is an image of the alien plou plush, which we’ll use alongside unique "Squish It" prompts or the Squish It Pikaffect as input for the three AI models we are going to compare. ![JPEG image of the alien plou plush that will be used as input into the APIs](https://cdn.sanity.io/images/pr53lcef/production/99b133d9afc2d0bee7e5604def8278b186706dc2-312x400.png?q=75&fit=clip&auto=format)The image of the alien plou plush that will be used as input into the APIs And here are the output videos of the three different AI models, with the prompts used shown in the description. ![GIF of the comparison for "Squish It" of the three APIs](https://cdn.sanity.io/images/pr53lcef/production/525dba371464d9481575d79e92713d4032670b11-600x338.gif?q=75&fit=clip&auto=format)Luma (Prompt: a pair of hands coming in and squishing the plushie, the plushie morphs as if it were made out of clay when being squished, it gets squished into a ball an becomes a sphere like form.) vs. Pika (Pikaffect: Squish It) vs. Kling (Prompt: a pair of hands coming in and squishing the plushie, the plushie morphs as if it were made out of clay when being squished, it gets squished into a ball an becomes a sphere like form) **Pika** Pika did a pretty good job in this example, but it doesn’t quite measure up to the quality of the other videos it produced in our prior examples. The squishing effect looks great, as the alien plou plush really seems to get squished realistically. The issue isn’t with how the plush is being squished, but with the hands that does the squishing. When they first appear, it looks like two thumbs are pressing down, which is unnatural since a human’s fingers couldn’t start in that position. Another problem is the fingers pressing on the eyes seem to phase through the plush. Lastly, the pinky fingers look deformed with noticeable bulges. **Kling** While Kling's video gets decent results, it's noticeably more strange than the rest. The first strange thing in the Kling video is when a hand randomly puts a red object on the plush before it disappears abruptly, which is most likely an artifact. Another strange thing is that the hands appear to remove the plush's eyes, and as they detach, the eyes become extremely blurred. The video then proceeds as the hands gently squish the body of the plush. Also, there are no visible deformities present in the hands. **Luma** Luma delivers great results as the human hands squish the mouth of the alien plou plush realistically, with no noticeable issues with how the hands or the plush behave. It’s worth mentioning that, although it has no visible mistakes or artifacts, the motions aren’t as dynamic as Pika’s. Pika and Luma deliver the best performance overall, with Pika showing more dynamism and Luma making fewer mistakes. ### **Example 6: Inflate It** For our last example, we are going to use a [Squid Game](https://www.netflix.com/title/81040344) plush. Below is an image of the squid game plush, which we’ll use alongside unique "Inflate It" prompts or the Inflate It Pikaffect as input for the three AI models we are going to compare. ![JPEG image of the squid game plush that will be used as input into the APIs.](https://cdn.sanity.io/images/pr53lcef/production/a7427c979156e3174748b8b007916ddd68bb3fcd-400x400.png?q=75&fit=clip&auto=format)The image of the squid game plush that will be used as input into the three APIs. And here are the output videos of the three different AI models, with the prompts used shown in the description. ![GIF of the comparison for "Inflate It" of the three APIs](https://cdn.sanity.io/images/pr53lcef/production/0e468a865e53cefd6b525573f5c0fd9f55b157ee-600x338.gif?q=75&fit=clip&auto=format)Luma (Prompt: static camera shot as the plushie bloats and inflates, flying up offscreen like a balloon) vs. Pika (Pikaffect: Crush it) vs. Kling (Prompt: the plushie inflates and floats up like a balloon) **Pika** Pika did a great job with its video output. We can see the Squid Game plush inflating like a balloon and floating away until it vanishes. Another cool detail is how the plush’s shadow follows it as it flies upwards. **Kling** Kling's video started out fine, with the Squid Game plush inflating slightly and hovering off the ground at first, but by the end, it seemed to deflate and fall to the floor, despite the prompt mentioning nothing about deflating or dropping to the ground. **Luma** Luma's video was a decent attempt, but while the plush inflated slightly and tried to float upwards, it didn’t get off the ground. It also didn't fully adhere to the prompt since the plush didn't fly up offscreen. Overall, Pika delivers the best performance for this example as well. ## **Our Other Tests** Before we get to our conclusion, let's quickly review the other tests we'veconducted. Although we didn’t include these tests in the main comparison, we hope they'd help you understand how different prompts influence the outcomes, as shown by our tests below. ### **Crush It** #### **Luma** The following are the other tests we did to recreate the "Crush It" effect using Luma API. ![GIF of the other "Crush It" tests using Luma API](https://cdn.sanity.io/images/pr53lcef/production/93a90dc757c23afd5b727d2a310eea1e5dd324ad-600x450.gif?q=75&fit=clip&auto=format)Other "Crush It" tests we did using Luma API The following are the prompts used: L1: Hydraulic press crushing a hippo plushie L2: Hippo plushie gets squished and crushed by a hydraulic press coming from the top L3: Hippo plushie gets crushed by a hydraulic press coming from the top, flattening the hippo plushie L4: Hippo plushie gets crushed by the cylinder of the hydraulic press coming from the top, flattening the hippo plushie L5: Slow-motion close-up of the plush hippo under the hydraulic press. The soft fabric starts to compress, with subtle creases forming. Gentle lighting highlights the squishy texture. Tension builds as the press lowers. Playful, oddly satisfying. L6: Hydraulic press crushens and flattens Hippo Plushie, leaving it becoming flatand the hydraulic press crushing it from the top L7: hippo plushie gets crushed and becomes flattened L8: still hippo plushie gets crushed and becomes flattened L9: Static camera shot of the hippo plushie getting crushed by a heavy object, it's body flattening, pressure is being applied to it's soft body, by the end it should be a flatter version if itself. #### **Kling** The following are the other tests we did to recreate the "Crush It" effect using Kling API. ![GIF of the other "Crush It" tests using Kling API](https://cdn.sanity.io/images/pr53lcef/production/1ce869aeed326561666204597e7d0d60ce7f8084-600x338.gif?q=75&fit=clip&auto=format)Other "Crush It" tests we did using Kling API The following are the prompts used: K1: Hydraulic press crushing hippo plushie, flattening it K2: Hydraulic press cylinder crushing hippo plushie, flattening it, it is beng flattened as like how clay is flattened. Satisfying and relaxing mood. K3: Hydraulic press cylinder crushing hippo plushie, flattening it, it is beng flattened as like how clay is flattened. Satisfying mood. K4: Hydraulic press cylinder crushing hippo plushie, flattening it, it is beng flattened as like how cay is flattened. Satisfying mood. K5: Static camera shot of the hippo plushie getting crushed by a heavy object, it's body flattening, pressure is being applied to it's soft body, by the end it should be a flatter version if itself. K6: Hippo plush gets crushed by a heavy object, as it body flattens and becomes a squished version of itself ### **Melt It** #### **Luma** The following are the other tests we did to recreate the "Melt It" effect using Luma API. ![GIF of the other "Melt It" tests using Luma API](https://cdn.sanity.io/images/pr53lcef/production/765822d92b2b8d4728d9af685c3aab0b6129bb30-600x800.gif?q=75&fit=clip&auto=format)Other "Melt It" tests we did using Luma API The following are the prompts used: L1: A Figurine Being Melted L2: The Figurine melting into a liquid form L3: The Figurine melting into a liquid form and ends up as a liquid puddle on the floor L4: The Figurine melting into a liquid form due to extreme heat and ends up as a liquid puddle on the floor L5: Static camera shot of the figurine completely melting into liquid form and becoming a puddle on the ground L6: Static camera shot of the entire figurine melting into liquid form and becoming a puddle on the ground. The figurine is melting similar to the way ice melts and becomes a liquid L7: Static camera shot of the figurine of the man melting into a flowing liquid form like water and becoming a puddle on the ground. The figurine is melting similar to the way plastic melts when exposed to high temperatures and becomes a liquid. At the end of the video the figurine is completely turned into liquid. L8: Static camera shot of the whole body of the figurine completely melting fast into liquid form and the whole figurine becomes a puddle on the ground L9: Static camera shot of the whole body of the figurine completely melting fast into liquid form and the whole figurine becomes a puddle on the ground. The liquid is on the floor as all the liquid drops to the ground and becomes a puddle #### **Kling** The following are the other tests we did to recreate the "Melt It" effect using Kling API. ![GIF of the other "Melt It" tests using Kling API](https://cdn.sanity.io/images/pr53lcef/production/0d453d68b4644cb2bb24262257786cb3ebad15fc-600x800.gif?q=75&fit=clip&auto=format)Other "Melt It" tests we did using Kling API The following are the prompts used: K1: Static camera shot of the figurine melting into a puddle K2: Static camera shot of the figurine of the man melting into liquid form and becoming a puddle. The figurine is melting similar to the way plastic melts when exposed to high temperatures and becomes a liquid. At the end of the video, the figurine is completely turned into a liquid puddle. K3: Static camera shot of the figurine of the man melting into liquid form and becoming a puddle. The figurine is melting similar to the way plastic melts when exposed to high temperatures and becomes a liquid. At the end of the video, the figurine is completely turned into a liquid puddle. K4: Static camera shot of the figurine melting completely in its entirety into liquid form and becoming a puddle. The figurine is melting similar to the way plastic melts when exposed to high temperatures and becomes a liquid. At the end of the video, the figurine is completely turned into a liquid puddle. K5:Static camera shot of the figurine of a black man melting completely in its entirety into liquid form and becoming a puddle. The figurine is melting similar to the way plastic melts when exposed to high temperatures and becomes a liquid. At the end of the video, the figurine is completely turned into a liquid puddle. K6: Static camera shot of the whole body of the figuring completely melting into liquid from and resulting in a puddle on the ground K7: Static camera shot of the whole body of the figurine completely melting fast into liquid form and the whole figurine becomes a puddle on the ground K8: Static camera shot of the whole body of the man completely melting fast into liquid form and the whole man becomes a puddle on the ground K9: Static camera shot of the whole body of the figuring completely melting quickly into liquid from and resulting in a puddle on the ground as the final result ### **Cakeify It** #### **Luma** The following are the other tests we did to recreate the "Cakeify It" effect using Luma API. ![GIF of the other "Cakeify It" tests using Luma API](https://cdn.sanity.io/images/pr53lcef/production/1662c03a27ba5fa34572009ef6bb1b65032fb38e-800x341.gif?q=75&fit=clip&auto=format)Other "Cakeify It" tests we did using Luma API The following are the prompts used: L1: Knife cutting through the minecraft grass block and revealing that it is a cake L2: realistic clean video of a kitchen knife cutting through the minecraft grass block and cutting it open, with the insides being cake L3: Knife cutting through the mincraft grass block, cutting it open, the inside of the minecraft grass block is cake #### **Kling** The following are the other tests we did to recreate the "Cakeify It" effect using Kling API. ![GIF of the other "Cakeify It" tests using Kling API](https://cdn.sanity.io/images/pr53lcef/production/a599549438f6748eadbda110230fcfeb252e23c1-800x341.gif?q=75&fit=clip&auto=format)Other "Cakeify It" tests we did using Kling API The following are the prompts used: K1: Kitchen knife cutting open the minecraft grass block, revealing the inside being cake K2: realistic video of a kitchen knife coming down cutting through the minecraft grass block and cutting it open, with the insides revealed to be cake K3: realistic video of a kitchen knife cutting the middle of the minecraft grass block, splitting it in half, the insides of the minecraft grass block is cake ### **Explode It** #### **Luma** The following are the other tests we did to recreate the "Explode It" effect using Luma API. ![GIF of the other "Explode It" tests using Luma API](https://cdn.sanity.io/images/pr53lcef/production/42c3fe943ebb4a56efa42c668adb278a10d1865d-600x600.gif?q=75&fit=clip&auto=format)Other "Explode It" tests we did using Luma API The following are the prompts used: L1: The joker figurine explodes L2: the joker figurine explodes into tiny pieces all flying away from the explosion L3: the joker figurine breaks apart and explodes into tiny pieces all flying away from the explosion L4: the joker figurine breaks apart and explodes. resulting in tiny pieces of the figurine flying everywhere. The figurine is not seen anymore by the end of the video since it has exploded #### **Kling** The following are the other tests we did to recreate the "Explode It" effect using Kling API. ![GIF of the other "Explode It" tests using Kling API](https://cdn.sanity.io/images/pr53lcef/production/1b25cf3b24e6549a893e60190ab4e834e895e4e9-600x600.gif?q=75&fit=clip&auto=format)Other "Explode It" tests we did using Kling API The following are the prompts used: K1: joker figurine exploding K2: the figurine explodes into small pieces K3: static shot of the figurine as it explodes into small pieces K4: static slow-motion shot of the figurine as it explodes into tiny shards that fly away from the explosion ### **Squish It** #### **Luma** The following are the other tests we did to recreate the "Squish It" effect using Luma API. ![GIF of the other "Squish It" tests using Luma API](https://cdn.sanity.io/images/pr53lcef/production/f135e909aba0b8ca375142d15423e3de19eef536-600x800.gif?q=75&fit=clip&auto=format)Other "Squish It" tests we did using Luma API The following are the prompts used: L1: two hands come in and squish the plushie L2: First person view of a pair of hands coming in and squishing the plushie L3: a pair of hands coming in and squishing the plushie, playing with it as if it was clay L4: a pair of hands coming in and squishing the plushie, the plushie morphs as if it were made out of clay when being squished #### **Kling** The following are the other tests we did to recreate the "Squish It" effect using Kling API. ![GIF of the other "Explode It" tests using Kling API](https://cdn.sanity.io/images/pr53lcef/production/d35198f0bee3b4d76e9abdabc232432ca91c236a-600x338.gif?q=75&fit=clip&auto=format)Other "Explode It" tests we did using Kling API The following are the prompts used: K1: a pair of hands coming in and squishing the plushie K2: a pair of hands coming in and squishing the plushie, playing with it as if it was clay K3: a pair of hands coming in and squishing the plushie, playing with it and squishing it, the plushie being squished into a more sphere like object ### **Inflate It** #### **Luma** The following are the other tests we did to recreate the "Inflate It" effect using Luma API. ![GIF of the other "Inflate It" tests using Luma API](https://cdn.sanity.io/images/pr53lcef/production/daf99beb98207603df42c5e24c2c90908302f8fa-600x338.gif?q=75&fit=clip&auto=format)Other "Inflate It" tests we did using Luma API The following are the prompts used: L1: the plushie inflates and floats up like a balloon L2: static camera shot as the plushie bloats and inflates, flying up like a balloon L3: static camera shot as the plushie bloats and inflates, floating up like a balloon #### **Kling** The following are the other tests we did to recreate the "Inflate It" effect using Kling API. ![GIF of the other "Inflate It" tests using Kling API](https://cdn.sanity.io/images/pr53lcef/production/16ec8ab171b87e1df3e1c1ae38109a84de16cd69-600x600.gif?q=75&fit=clip&auto=format)Other "Inflate It" tests we did using Kling API The following are the prompts used: K1: the plushie bloats and inflates, as it flies up like a balloon K2: static camera shot as the plushie bloats and inflates, flying up offscreen like a balloon K3: static camera shot as the plushie bloats and inflate flying up like a balloon K4: static camera shot as the plushie inflates and flies up like a balloon ## **Conclusion** From looking at the six effect examples above, it's clear that Pika 1.5 easily outperforms both Luma and Kling. But depending on the example, Kling API or Luma API can deliver a similar level of quality, as shown in examples 2 and 5. However, we need to keep in mind that this applies only to these six specific special effects, likely because Pika Labs has optimized their AI for these particular "Pikaffects". That being said, we're eager to see where AI image-to-video technology goes next, and we’re hoping for even more types of fun and visually pleasing special effects like the ones shown above. We hope that you have found this comparison useful! And if you are interested, check out our collection of [generative AI APIs from PiAPI](https://piapi.ai/)! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## AI Music Video Generator Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Creating an AI Music Video Generator using Wan 2.1 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/94b84c8899274fa79b2e9b27d78de893da063d5d-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI March 7, 2025 Hey everyone! In this blog, we’ll be creating an AI music video generator using the [Wan 2.1 model](https://piapi.ai/wanx), which is readily available on [PiAPI](https://piapi.ai/). You can start using with it right now in our [workspace](https://piapi.ai/workspace/luma)! Building an AI music video generator requires a variety of AI tools, including a text-to-video generator, an image-to-video converter, LLMs, and an AI song generator. Luckily for you, all these different AI tools are all readily available on [PiAPI](https://piapi.ai/)! ## **Creating the AI Music Video Generator** ### **Step 0: Brainstorm ideas for the music video** Before even beginning with the process, we must first brainstorm an idea and script for the video. Luckily, we have the LLM tools for that, such as [GPT 4o-mini and Deepseek](https://piapi.ai/workspace/llm) which you can use in our [workspace](https://piapi.ai/workspace/luma). I used these tools to generate lyrics for a hip-hop song and even come up with creative concepts for the music video scenes. ### **Step 1: Audio** If you don't have a song ready, you can start by using Ace step or [Udio](https://piapi.ai/docs/music-api/create-task), which are also both readily available on PiAPI. For this example, I used ace-step and input the lyrics generated by ChatGPT 4o. For the prompt, I simply specified the genre as hip-hop, without adding any negative prompts. Here are the two results I got from ace-step Your browser does not support the audio tag.Your browser does not support the audio tag. We are going to use the first example for the music video creation process. ### **Step 2: Image Generation (optional)** The next step is image generation. While it's optional—since you can directly use text-to-video with models like Wan 2.1—it's highly recommended to use image-to-video generation instead, as it offers significantly better quality. So here are some images we generated using a text-to-image AI model, you can use [Flux](https://piapi.ai/workspace/flux) or [FLux](https://piapi.ai/workspace/flux) which are both readily available on [PiAPI Workspace](https://piapi.ai/workspace). First we will need a consistent character, we will generate a character for the music video first then use --cref, below is the prompt that we used for the character we generated using FLux ![PNG image of a black hip hop artist generated by FLux](https://cdn.sanity.io/images/pr53lcef/production/2d66386a6c218d3bf1a59ef73a716a1ccd010c4c-1024x1024.png?q=75&fit=clip&auto=format)Prompt: "Black Hip Hop artist" Below are three images we've generated, which we’ll be using for the AI music video generator. ### **Step 3: Video Generation** For the third step, we’ll use [Wan 2.1](https://piapi.ai/wanx) as our image-to-video generation model, which is also available for you to use in our [PiAPI Workspace](https://piapi.ai/workspace/). We'll use an appropriate prompt along with the image we generated in FLux as input. Your browser does not support the audio tag. Prompt: "Animate a slow-motion zoom-in on an artist stepping confidently into a spotlight, walking through a dark room with flashing neon lights. The neon reflections move fluidly as the artist’s footsteps create soft echoes, focusing on his intense expression. The camera moves in a smooth tracking motion to capture his slow but purposeful approach." Your browser does not support the audio tag. Prompt: "Animate a sweeping aerial shot zooming out from the city to reveal the artist floating in a vast sky filled with glowing clouds. The artist's movements should be slow and fluid, interacting with the environment. The surrounding colors should gradually shift as the scene feels otherworldly and surreal" Your browser does not support the audio tag. Prompt: "Animate a close-up of the artist’s face as he stands on the rooftop. The wind should blow through his hair as he gazes at the horizon. The camera should pull back slowly, revealing the vast city around him, as the sun rises. The motion should be gradual, symbolizing a new beginning." Make sure to create enough videos for the video! ### **Step 4: Editing** The final step to using AI to create a video for your song involves bringing everything together—combining all the videos you generated with the audio. While you can use any editing software for this process, we’ve chosen to use CapCut. In this stage, you can adjust the speed of each clip, add smooth transitions, and refine the video as needed. It’s the stage to fine-tune your creation and ensure the visuals and audio sync perfectly to create a polished, professional-looking music video. ![A screenshot of the video being edited in Capcut](https://cdn.sanity.io/images/pr53lcef/production/bc1c101d969252839450dc00f264c5b8d89ed588-1920x1008.png?q=75&fit=clip&auto=format)Editing the music video in Capcut ### **Step 5: Results** And now, it's time to check out the results generated by a ton of our AIs including Wan 2.1! Your browser does not support the audio tag. ## **Conclusion** We personally think that the results are pretty good, as Wan 2.1 generated some amazing and visually appealing videos! It is the perfect AI video generation tool to create an AI music video maker where you can add audio and video easily. Moreover, given the open-source nature of Wan 2.1 and the impressive results we've seen so far, we're excited to see how the open-source ecosystem will continue to evolve and push the boundaries of AI video creation. We hope you found this blog useful! Also, if you are interested in other [AI API that PiAPI provides](https://piapi.ai/), please check them out! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## Kling API Comparison Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # Kling 1.5 vs 1.0 - A Comparison through Kling API ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/9fa45eb1459d1ff78f831502395866eca480c94f-2560x1440.png?rect=0,80,2560,1280&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI September 19, 2024 The wait is finally over! On September 19th 2024, [Kuaishou](https://kling.kuaishou.com/), the team behind one of the most advanced text/image-to-video generative AI models currently on the market, has just released its new model, Kling 1.5, making the [announcement](https://klingai.com/release-notes) on their official website. Thus, we at [PiAPI](https://piapi.ai/) are working to bring the [Kling 1.5 API](https://piapi.ai/kling-api) to our users, and we are actively comparing the differences between version 1.0 and 1.5, sharing results with you in this blog. ## **Kling 1.5 Release** ![A screenshot of Kling's announcement of Kling 1.5's release on their official website](https://cdn.sanity.io/images/pr53lcef/production/6c41e742182437ac37965ee40c56a288baec2743-1109x860.png?q=75&fit=clip&auto=format)Official announcement of Kling 1.5's release on their official website With the new 1.5 version update, Kling promises improvements in image quality, dynamic quality, and prompt relevance. Kling has also added a new motion brush feature, where you can precisely define the movement of any element in your image, giving you unparalleled control over the motion and performance of your videos. Kling's internal tests boast a 95% performance increase, but we at PiAPI have done our own comparisons, with the evaluation framework use and the subsequent results shown in the blog. ## **Evaluation Framework** Regarding the evaluation framework used for this comparison, we have taken the [comprehensive text-to-video evaluation framework from Labelbox](https://labelbox.com/guides/a-comprehensive-approach-to-evaluating-text-to-video-models/), while adding "Text Adherence" into the mix since judging from our user feedback, text adherence is an important aspect of generative video for it to become more prevalent as a productivity tool than something just used for entertainment. This is the same framework we had used in our [previous blog comparing Luma Dream Machines 1.0 vs 1.5](https://piapi.ai/blogs/luma-dream-machine-1-5-vs-1-0-comparison-through-luma-api), namely: 1. 1\. Prompt Adherence 2. 2\. Text Adherence 3. 3\. Video Realism 4. 4\. Artifacts For what each of these categories mean and how they could be rated, feel free to read our previous blog for more detail. ## **Kling 1.0 and Kling 1.5 Comparison** And now, let's see how the previous Kling 1.0 model fares against the new Kling 1.5 model. ### **Example 1: MLB Detroit Tigers Player Hitting a Baseball with a Baseball Bat** ![A GIF of a comparison of two different videos of an MLB baseball player hitting a baseball with a baseball bat, with the words "detroit tigers" written on his shirt, one generated by Kling 1.0, while the other is generated by Kling 1.5](https://cdn.sanity.io/images/pr53lcef/production/0e9b423d630b77bc620db2876dd62bc29e2d4c8b-600x338.gif?q=75&fit=clip&auto=format)Prompt: "An MLB baseball player hitting a baseball (ball) with a baseball bat, with the words "Detroit Tigers" writen on his shirt" **Prompt Adherence** The video generated by Kling 1.0 includes most of the elements from the prompt: the MLB player, the baseball bat, and the baseball, but it falls short of capturing the core action: the baseball player hitting the ball with his bat. Meanwhile, the video generated by Kling 1.5 contains all the elements, including the one missing from Kling 1.0, though the motion appears somewhat unnatural. **Text Adherence** Both outputs have poor text adherence, as neither video has the words "Detroit Tigers" or anything close to it in text. **Video Realism** Both videos show impressive realism, with shadows beneath the MLB players' caps following the head movements. However, the video generated by Kling 1.5 stands out more given its higher definition. **Artifacts** Both outputs display noticeable artifacts. In the video generated by Kling 1.0, a baseball player holds a ball at first, but it quickly morphs into a bat. While in the Kling 1.5 video, the baseball’s movement toward the player and its contact with the bat feel noticeably unnatural. The final artifact that both players are wearing New York Yankees caps whereas Detroit Tigers were specified in the prompt, is present in both videos. We believe this error is present because ["the New York Yankees is the most popular Major League Baseball franchise"](https://www.statista.com/statistics/1140528/public-opinion-st-louis-cardinals/#:~:text=A%20March%202023%20survey%20in,popular%20Major%20League%20Baseball%20franchise), therefore it is likely that it dominated the baseball-related training data that Kling used. Overall, we see only a slight improvement from the video generated by Kling 1.5. ### **Example 2: AI Cat Playing a Red Electric Guitar in the Forest** ![A GIF of a comparison of two different videos of a an ai cat playing a red electric guitar in the forest, one generated by Kling 1.0, while the other is generated by Kling 1.5](https://cdn.sanity.io/images/pr53lcef/production/507f8ec4e37526ead70d6c296b0f65acc29ef0db-600x338.gif?q=75&fit=clip&auto=format)prompt: "A cat playing a red electric guitar in the forest" **Prompt Adherence** Both videos display all the elements described in the prompt: a cat playing a red electric guitar, and the forest surrounding it. **Video Realism** The level of realism displayed in video generated by Kling 1.5 is very high due to the cat's dynamic movements, especially the hand and head movements. The forest's reflection on its electric guitar is also of higher definition. **Artifacts** The video generated by Kling 1.0 contains a significant error. The left arm, intended to be the cat's paw, bears more of a resemblance to that of a human hand, with peach skin clearly visible. Meanwhile, in the video generated by Kling 1.5, the cat’s left hand has human-like fingers, but the black fur conceals this detail, making it far less noticeable than the skin-toned features seen in the other video. Overall, we see a moderate improvement from the video generated by Kling 1.5. ### **Example 3: A Cartoon Monkey and Cartoon Dog Hugging Each Other** ![A GIF of a comparison of two different videos containing a cartoon monkey and a cartoon dog hugging beneath a large tree, one generated by Kling 1.0 and the other generated by Kling 1.5](https://cdn.sanity.io/images/pr53lcef/production/2e02dfa22dd04e0051d730e0f18f0f871d1a05af-600x338.gif?q=75&fit=clip&auto=format)Prompt: "A cartoon monkey and a cartoon dog hugging beneath a large tree" **Prompt Adherence** Both videos display the large tree, but only the Kling 1.5 video displays both the cartoon monkey and the cartoon dog hugging, whereas Kling 1.0 shows two animal bodies embracing but with just one head. Both bodies in the 1.0 video have monkey-like features, such as white hands with fingers, with no sign of dog-like paws. **Video Realism** Both versions show the core elements of the cartoon style, though the animation styles are different. This is likely caused by the lack of specificity in the prompt. But one thing of note is that the video generated by Kling 1.5 is more dynamic, as evident in the monkey's changing expressions and the dog's wagging tail. **Artifacts** The video from Kling 1.0 was full of artifacts: the unnatural distortion in both the characters, the absent dog, and the vanishing hands. While in the video made by Kling 1.5 showed no such flaws. For this prompt, it's evident that the video output produced by Kling 1.5 marks a significant improvement over its predecessor. ### **Example 4: Earth with a Moon and a Mini Moon** ![A GIF of a comparison of two different videos of a moon and a mini moon rotating around the earth, one generated by Kling 1.0, and the other generated by Kling 1.5](https://cdn.sanity.io/images/pr53lcef/production/0394b253d808990efc144f8658a1ee9075e44871-600x338.gif?q=75&fit=clip&auto=format)Prompt: "The earth, with 2 moons rotating around it" **Prompt Adherence** Both versions captured the prompt descriptions. Although the version generated by Kling 1.5 has a more accurate depiction of the Earth and its moons. **Video Realism** Both videos display an impressive amount of realism, but the version produced by Kling 1.5 provides a more convincing portrayal. It shows more dynamic camera movements, shifting shadows, and more realism, especially as the Earth's shadow slowly covers the second moon. **Artifacts** Kling 1.0's video output presents a few noticeable artifacts: Earth's landmasses are fully white, and the moons having mismatched colors, with one being orange and the second moon having differently colored terrain. Meanwhile, the output from Kling 1.5 has no artifacts. In fact, it even has a shockingly accurate depiction of Earth's geography - the African continent has the right amount of greenery in the middle with deserts in both the northern and southern parts. Overall, we see a general improvement in Kling 1.5's video output. ### **Example 5: Messi, Wearing a Shirt with the words "Champions League", Kicking a Soccer Ball into a Goal Post** ![A GIF of a comparison of two different videos of Lionel Messi, wearing a shirt with the words "Champions League", kicking a soccer ball into a goal psot](https://cdn.sanity.io/images/pr53lcef/production/fe0badc981200ddcbec00e45b34bf4b941235db8-600x338.gif?q=75&fit=clip&auto=format)Prompt: "Messi kicking a soccer ball into a goal post, with the words "Champions League" written on his shirt" **Prompt Adherence** Both outputs show poor prompt adherence, but Kling 1.5 performs slightly better than Kling 1.0. While both models generate an image of a soccer player, neither one resembles Lionel Messi. Kling 1.0's output doesn't have a soccer ball, a goal post, nor the visible action of Messi kicking the ball into a goal post. On the other hand, Kling 1.5's output does show a goalpost and a kicking motion, but the soccer ball itself is still missing **Text Adherence** Both videos display low text adherence, with neither video having the words "Champions League" or anything resembling the writing on their shirts. **Video Realism** Though both videos are realistic, Kling 1.5 outperforms its predecessor by a long shot. This is because Kling 1.0 merely produced a zoom-out of a static image, while Kling 1.5 renders Messi kicking a ball, with his hair swaying and his shirt subtly shifting with the motion. **Artifacts** The background of Kling 1.0's output is heavily blurred, especially when compared to the output of Kling 1.5. ## **Conclusion** Based on the various examples provided above, it is evident that both models fall short in the text adherence category within the examples provided, frequently producing incoherent and inaccurate text. However, it is clear that Kling 1.5 surpasses Kling 1.0 in terms of overall quality, prompt adherence, and video realism. With that being said, we don't see the "95% increase in performance" that Kuaishou claimed. We hope you found this comparison blog useful! If interested, please also check out our [other generative AI APIs from PiAPI!](https://piapi.ai/) * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## 3D Trellis API Overview Previewing drafts. [Back to published](https://piapi.ai/api/disable-draft) # 3D Trellis API through PiAPI ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ![](https://cdn.sanity.io/images/pr53lcef/production/3cac99c24f8bb7e1b68628d9aa41eb1bb030298c-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format) ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI February 21, 2025 ## **Introduction** TRELLIS is a large-scale 3D asset generation model open-sourced by [Microsoft's Trellis Research Team](https://github.com/microsoft/TRELLIS) that supports high-quality 3D content generation from text or images. It employs a structured 3D latent space approach to achieve scalable and versatile 3D generation.Key Features: • Supports both image-to-3D and text-to-3D generation(soon) modes • Uses structured 3D latent space approach for higher generation quality • Provides multiple 3D representation formats (Gaussian point clouds, radiance fields, meshes, etc. • Open source and easy to deploy • Supports export to standard 3D file formats like GLB/PLY The Trellis API is offered by PiAPI based on the Trellis model. Given their accelerated hardware infrastructure and custom-developed inference framework, PiAPI is able to provide APIs for these two models at very market competitive costs while maintaining performance and minimizing latency. ### **So what makes Trellis a good 3D Model?** To understand the practical differences and capabilities of TRELLIS, let’s compare it with another AI model , [Meshy AI](https://www.meshy.ai/workspace) by exploring how each generates GIFs of knee-high Converse shoes. This example will illustrate not only the visual quality of outputs but also highlight the efficiency and versatility of TRELLIS’s structured 3D latent space compared to its counterpart. ## **Knee High Converse** ![PNG image of Knee High Converse that will be used as input](https://cdn.sanity.io/images/pr53lcef/production/89ad2941d7ad65e900147c2d1a0988edc2f062a2-400x379.png?q=75&fit=clip&auto=format)Image of Knee High Converse that will be used as input![GIF of a comparison of Meshy AI and Treliis 3d API of the Knee High Converse Example](https://cdn.sanity.io/images/pr53lcef/production/85d3a68909c077a22e6e83c85e8f69cb894d9702-600x323.gif?q=75&fit=clip&auto=format)Comparison of Meshy AI and Treliis 3d API of the Knee High Converse Example **Comparing the two Models:** **Model Design and Realism:** While Meshy AI’s model attempts to replicate the form of a sneaker, it lacks refinement, with rough edges and inconsistent proportions that detract from its overall realism. The design feels unfinished, and the exaggerated textures give it a somewhat artificial appearance. Trellis3D offers a more structured and defined design, with a consistent and cohesive shape. While it isn’t perfect, the overall form aligns more closely with the natural proportions and flow of a real sneaker, making it slightly more believable in terms of structure. **Texture and Detail:** In Meshy AI, the textures are overly dramatic, with exaggerated shading and surface marks that can make the model feel less cohesive. The material representation lacks subtlety, and the surface details do not align naturally with real-life fabric or rubber. The textures in Trellis3D are simpler but more balanced. While not highly detailed, the model avoids the harsh highlights and oversaturation seen in Meshy AI, giving it a more understated and realistic appearance. **Cohesion and Completeness:** In Meshy AI, the elements of the model, such as the laces, sole, and fabric, feel disjointed. The lack of polish in its construction results in a model that appears incomplete and inconsistent. Trellis3D delivers a more cohesive presentation. Although less intricate, the elements are better aligned and feel more harmonious, providing a sense of completeness despite the lack of fine detailing. In summary , while Meshy AI showcases an ambitious design with intricate textures, its lack of polish and cohesion limits its effectiveness. Trellis3D, although simpler, provides a more balanced and structured model, making it the better choice for realism and overall presentation in this comparison. While the first comparison highlighted TRELLIS's ability to deliver realistic textures and details for modern objects like shoes, its strengths become even more apparent when applied to historical or thematic objects. Let’s now compare TRELLIS and Meshy in generating a medieval weapon model to further illustrate its capability to balance ruggedness, detail, and realism. ## **Medieval times weapons wood** ![WEBP image of a medieval times weapons wood that will be sued as input](https://cdn.sanity.io/images/pr53lcef/production/5dd79c131c16cb10d62a8a4029a92ebd36dd3571-400x400.webp?q=75&fit=clip&auto=format)Image of a medieval times weapons wood that will be sued as input![Gif of a comparison of Trellis 3D API and Meshy AI of the medieval times weapons wood example](https://cdn.sanity.io/images/pr53lcef/production/0a2566dde09416c4851bf5137d8fb93cdccc6370-600x239.gif?q=75&fit=clip&auto=format)Comparison of Trellis 3D API and Meshy AI of the medieval times weapons wood example **Comparing the two Models:** **Model Design and Realism**: In Trellis 3D , the model features rugged textures and a worn appearance, which gives it an aged and historical look. However, the form appears less refined, with a somewhat irregular shape that may detract from its believability as a weapon. In Meshy AI, the model has a sleek and well-defined structure, with smooth yet balanced textures that reflect modern design standards while still retaining a worn, medieval aesthetic. **Texture and Detail**: In Trellis3D, textures are rugged and emphasize wear and tear but appear overly simplistic and lack finer details such as grain or specific surface imperfections. In Meshy AI, the textures are more detailed, with shading and subtle surface marks that provide depth and a realistic appearance. The material representation (wood/metal) is also more recognizable in Meshy AI. **Cohesion and Completeness**: In Trellis 3D, while the aged texture aligns with medieval themes, the model lacks structural precision and detail, which may compromise its overall believability. In Meshy AI, the model is more cohesive and complete , with proportional design and polished finishing, making it more convincing as a weapon. In summary, Meshy AI is the better model overall due to its superior structural refinement, detailed textures, and balanced realism. While Trellis3D captures ruggedness, it lacks the precision and detail required to compete with the more polished and visually engaging Meshy AI model. Building on the comparison between Trellis3D and Meshy AI, a similar focus on texture detail, realism, and structural refinement can be seen when evaluating Slitherwing Dragon Egg using Trellis3D and another image-to-3D Model,Tripo3D. ## **Slitherwing Dragon Egg** ![JPEG image of Slitherwing Dragon Egg that will be used as input ](https://cdn.sanity.io/images/pr53lcef/production/ff7346231efbb187013dea26324e2ea58a2959de-400x285.png?q=75&fit=clip&auto=format)Image of Slitherwing Dragon Egg that will be used as input ![GIF of the comparison of Trellis 3D API and Trippo 3D of the Slitherwing Dragon Egg Example](https://cdn.sanity.io/images/pr53lcef/production/3fc9d9dc474709cf6a5a8e03a2e20a111904f87f-600x362.gif?q=75&fit=clip&auto=format)Comparison of Trellis 3D API and Trippo 3D of the Slitherwing Dragon Egg Example **Comparing the two Models:** **Model Completeness:** The layering and arrangement of the petals in Trellis are more cohesive and natural, closely mimicking the input image . Each petal appears distinct, with clear thickness and spacing, showing meticulous design work that conveys the model's completeness. **Texture:** The **Tripo3D** texture appears smoother, with fewer harsh highlights or reflections. This provides a more refined and polished look compared to Trellis3D. Tripo3D displays better control over lighting and surface reflection, preventing oversaturated bright spots. This makes the texture more visually appealing and realistic. In Tripo3D, the color distribution seems more uniform and less patchy, enhancing the object's overall natural appearance. Tripo3D’s textures have a subtle gloss that gives the object a more organic, life-like feel, compared to the overly reflective or shiny look in Trellis3D. In summary, Trellis demonstrates greater attention to sharpness and high-contrast design, whereas Tripo3D provides better realism and natural texture. ## **Jean Claude Van Damme from bloodsport with red shorts** ![JPEG image of Jean Claude Van Damme tfrom bloodsport with red shorts that will be used as input](https://cdn.sanity.io/images/pr53lcef/production/d526eac654d4dfe6605e1bcbe388568027a44bc4-400x534.jpg?q=75&fit=clip&auto=format)Image of Jean Claude Van Damme tfrom bloodsport with red shorts that will be used as input![GIF of the comparison of Trellis 3D API and Trippo 3D for the Jean Claude Van Damme from bloodsport with red shorts example](https://cdn.sanity.io/images/pr53lcef/production/17e987c5fe69d9faed2455a8426928d370d5376c-800x508.gif?q=75&fit=clip&auto=format)Comparison of Trellis 3D API and Trippo 3D for the Jean Claude Van Damme from bloodsport with red shorts example **Comparing the two Models:** **Model Design and Realism:** In Trellis 3D, the model features sharper and more defined contours, with clear outlines and visible muscle structure. However, the lighting is harsher, making the model appear slightly less natural and organic. In Tripo3D, the model has a smoother and softer design, which gives it a more cohesive appearance. However, the lack of detail in textures and overly smooth surfaces detracts from its realism and believability. **Texture and Detail:** In Trellis 3D, textures are well-defined and exhibit noticeable contrast, particularly in the highlights and shadows, enhancing the model's features. However, the highlights may appear exaggerated, making the surface feel less lifelike. In Tripo3D, textures are more uniform and subdued, lacking the intricate highlights and shadows necessary for dynamic depth. This results in a flatter appearance and reduces the overall visual impact. **Cohesion and Completeness:** In Trellis 3D, the model demonstrates better definition and structure, with visible attention to proportion and details. However, the lighting contrast might feel overly sharp in certain areas, affecting its cohesion. In Tripo3D, the smoother and less detailed design gives a cohesive but overly simplified look. The absence of distinct textures and fine details impacts the model’s completeness and realism. In summary, Trellis3D is the better model due to its sharper design, clear textures, and better definition, which make it more visually appealing and believable. While Tripo3D offers a smoother and more cohesive appearance, it lacks the detail and realism needed to compete with the refined and dynamic Trellis3D model. ## **Conclusion** The comparisons throughout this analysis demonstrate the nuanced strengths and weaknesses of Trellis3D, Meshy AI, and Tripo3D in 3D model generation. Trellis3D stands out in many cases for its sharpness, structural clarity, and ability to deliver realistic, detailed models, making it a reliable option for producing polished assets. While Meshy AI and Tripo3D excel in smoothness, lighting balance, and modern aesthetics, their lack of refinement and cohesion in certain models highlights room for improvement. Trellis3D’s capability to achieve rugged realism, proportional accuracy, and cohesive design across different scenarios—from shoes to medieval weapons—showcases its versatility and adaptability for diverse applications. This combination of detailed textures and structural completeness gives Trellis3D an edge over its competitors in specific use cases. Ultimately, the choice of model depends on the priorities of the user—whether precision, realism, or stylistic elements are paramount. However, the examples explored in this blog underline Trellis3D’s capacity to deliver consistent and high-quality outputs, making it a compelling option in the realm of 3D content generation. And if you are interested in any of the other [AI APIs that PiAPI provides](https://piapi.ai/), feel free to check them out! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/6ad46085141bc306fa7e89c7359e5c4b08251969-2000x1000.webp?w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) ### [How I Made a Glass Fruit Cutting AI ASMR Video — Without Google Veo 3](https://piapi.ai/blogs/how-i-made-a-glass-fruit-cutting-ai-asmr-video-without-google-veo-3) July 23, 2025 [![](https://cdn.sanity.io/images/pr53lcef/production/271b94b38daad47fa05c109846c7bdff423bbb89-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) ### [Ghibli Style Image Generator using GPT 4o image generation API](https://piapi.ai/blogs/ghibli-style-image-generator-using-gpt-4o-image-generation-api) April 3, 2025 ![A logo of PiAPI](https://cdn.sanity.io/images/pr53lcef/production/07534b139db4060901db82869153c2954b0409d9-234x233.png?rect=1,0,233,233&w=90&h=90&fit=crop&auto=format) PiAPI ## PiAPI Workflow Guide [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/piapi-make/make-insturcution) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/piapi-make/make-insturcution) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/piapi-make/make-insturcution) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/piapi-make/make-insturcution) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog "Change Log") - [Output Storage](https://piapi.ai/docs/output-storage "Output Storage") - [Unified API Schema](https://piapi.ai/docs/unified-api-schema "Unified API Schema") - [Webhook](https://piapi.ai/docs/unified-webhook "Webhook") - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation "Bulk Generation Service") - [Billings](https://piapi.ai/docs/billings "Billings") - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server "PiAPI MCP Server") - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/piapi-make/make-insturcution) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/piapi-make/make-insturcution) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/piapi-make/make-insturcution) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Make Instruction: How to Use PiAPI to Build a Workflow on Make? ## Intorduction [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#intorduction) Hey there! Recently, to help more content creators easily use PiAPI for their projects, **Flux** by PiAPI has officially launched on the Make platform!For content creators or anyone without coding background who find API concepts challenging, this documentation will use visual guides to help you overcome these challenges.🙋Here’s what we’ll cover step by step listed as follows: 1. **Finding PiAPI's Flux Modules on Make Platform** 2. **Calling APIs on the PiAPI Platform** 3. **Understanding PiAPI's Endpoint Structure** 4. **Using the Flux App (PiAPI on Make) and Integrating It into your Workflow** 5. **Adjusting Module Parameters and Their Meanings**: Flux Module Selection and Parameter Configuration Guide 6. **Building a Simple Workflow Using PiAPI on Make** > 💡 If you have a technical background, you can quickly grasp Make's functionality and start building workflows to experiment with creative ideas. 🙌 We would be glad to see you: Share your workflow output on social media with us Join our [Discord](https://discord.com/ "") to discuss! All in all, we would be pleasant to see you share your workflow output in any social media with us and join our discord to make a discussion! ## How to find PiAPI's Flux Modules on Make Platform? [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#how-to-find-piapis-flux-modules-on-make-platform) Log in to the Make platform, locate **Scenarios** in the left Dashboard, click **Create Apps**, and you will enter the main workflow builder interface. Then search for "PiAPI/Flux" and you'll see the Flux API modules available for use.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352924/image-preview?onlineShareType=apidoc&locale=en-US)Now that you've learned how to find PiAPI's Flux Module on Make, let's explore PiAPI's endpoint structure and walk through the process of calling Flux APIs. This knowledge will help you: **Better understand** the architecture behind each module **Confidently configure** parameters when building workflows **Maximize the potential** of PiAPI's capabilities in Make We'll demonstrate the API calling process step-by-step, giving you practical insights to apply directly in your workflow development. ## Understanding PiAPI's Endpoint Structure [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#understanding-piapis-endpoint-structure) Before organizing your workflow automation, let's walk through the key concepts needed for successful API calls with PiAPI. You should familiarize yourself with: ### Core Concepts [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#core-concepts) **API Structure** and its components **Purpose** of each structural element **Endpoint Types** and their functions **Parameter Definitions** and requirements **Best Practices** for executing flawless API calls This foundation will ensure you can effectively work with PiAPI's endpoints when building your workflows.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352925/image-preview?onlineShareType=apidoc&locale=en-US)An endpoint in PiAPI consists of three core components: ### 1\. URL [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#1-url) The service path that directs your request. **Key Requirement**: You must use the correct address to successfully reach PiAPI. **HTTP Methods**: `POST` \- Used when you need to create a task. `GET` \- Used when retrieving task response. ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352942/image-preview?onlineShareType=apidoc&locale=en-US) These methods ( **POST** and **GET**) define your action type when making API calls. And there are some differences between the urls of different http methods. If you want to make an api call to make an API call, then you should choose POST. In this way could you send your request to Flux API. If you want to fetch your response, you should choose GET and could just send URL and Header Params then you could get your response (especially when you need to check or use an output in your workflow) in a specific task you have initiated. ### 2\. Header Params [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#2-header-params) Usually conludes your X-API-Key. ### 3\. Body Params [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#3-body-params) Model Task-type Input prompt width height ...... Tips: Usually the input params are mainly based on the model and task-type. You could check the section **Flux Module Selection and Parameter Configuration Guide** to check the params that could be concluded when you choose different task-type based on your need.Now, let's explore API calls on PiAPI to deepen your understanding of Make Modules. ## How to Make an API Call in PiAPI [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#how-to-make-an-api-call-in-piapi) In PiAPI, you have two methods to call Flux APIs (applicable to other APIs as well): 1. Using Playground: Fill in the required parameters for direct execution. ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352943/image-preview?onlineShareType=apidoc&locale=en-US) 2. Via Run API: Submit your API call, then retrieve the task results from the respective model's Task History section. ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352944/image-preview?onlineShareType=apidoc&locale=en-US) When using the Run API to call PiAPI platform APIs, you'll have a broader range of options. As mentioned earlier regarding API call structures, you can: 1. Refer to the parameter specifications below for task\_type selection 2. Configure input parameters according to your requirements Through understanding the constructure of every API reuqest, you could mainly create an API call on your own. Isn't that diffucult, right? 💪 Now you've understood how to create an API call on PiAPI, next let's learn how to make an API call in Make. ## How to make an API call in Make? [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#how-to-make-an-api-call-in-make) According to http methods which depends on whether you want to create a task (POST) or get your task response (GET). ### Set up a POST Module [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#set-up-a-post-module) ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352945/image-preview?onlineShareType=apidoc&locale=en-US) 1. Connect your PiAPI account Make sure you're logged in first. 2. Prepare your request Create a JSON module (this is where you type your settings). Usually a JSON Module contains the structure of an endpoint's body including model, task-type and input. In this step, you need to construct your data structure based on the endpoint on your own. ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352946/image-preview?onlineShareType=apidoc&locale=en-US)![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352947/image-preview?onlineShareType=apidoc&locale=en-US) ### Set up a GET request [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#set-up-a-get-request) 1. Connect your PiAPI account Ensure you're properly logged in. 2. Select the API call node Choose "Make an API Call" from available options 3. Configure the request URL: Enter `/v1/task/` followed by your specific task\_id (Example: `/v1/task/12345`) Method: Select `GET` 4. Run the request Execute to retrieve your task results ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352948/image-preview?onlineShareType=apidoc&locale=en-US) ## Flux Node Selection and Parameter Configuration Guide [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#flux-node-selection-and-parameter-configuration-guide) ### What is LoRA & Accessing LoRA Options [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#what-is-lora--accessing-lora-options) Simply put, LoRA is a style filter for AI art. To choose a LoRA, check the available styles in [PiAPI's Flux Documentation](https://piapi.ai/docs/available-lora-and-controlnet ""). Check this page to get your ideal style of LoRA.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352949/image-preview?onlineShareType=apidoc&locale=en-US) ### What is ControlNet & Accessing ControlNet Options [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#what-is-controlnet--accessing-controlnet-options) ControlNet is a neural network structure designed to precisely control AI image generation by incorporating additional input conditions (e.g., edge maps, depth maps, human poses). It acts as a "steering wheel" for models like Stable Diffusion, ensuring generated images strictly adhere to structural constraints while following text prompts.Check [PiAPI's Flux Documentation](https://piapi.ai/docs/available-lora-and-controlnet "") to get ControlNet type.Congratulations! Now that you understand both **LoRA** and **ControlNet** and know where to get the type list, you’re ready to explore beyond the PiAPI platform. On Make, you can: Select different task\_type options to experiment with various LoRA and ControlNet combinations. Customize these features based on your specific needs Understanding this structure will empower you to generate higher-quality images!Next, I’ll walk you through each module’s parameters. You’ll learn to: Configure parameters effectively Make optimized Flux API calls ## Module Types and Param Configuration Setting [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#module-types-and-param-configuration-setting) Based on these instructions, you can understand the purpose of each module's parameters and adjust them as needed until they meet your requirements. ### Extend an Image [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#extend-an-image) Expands the boundaries of an image. The user uploads an image, and the system generates new background or scenery based on the original content. Suitable for extending the image’s view into a broader scene.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352950/image-preview?onlineShareType=apidoc&locale=en-US) | Parameter Name | Description | Constraints&Details | | --- | --- | --- | | `image` | Image URL | URL format. | | `prompt` | Content to show in the extended part | string | | `outpaint_left` | Expand canvas pixels to the left | Total delta pixel size < 1024×1024 | | `outpaint_right` | Expand canvas pixels to the right | Total delta pixel size < 1024×1024 | | `outpaint_top` | Expand canvas pixels to the top | Total delta pixel size < 1024×1024 | | `outpaint_bottom` | Expand canvas pixels to the bottom | Total delta pixel size < 1024×1024 | | `denoise` | Controls noise/artifact removal strength in AI-generated images | Range: 0.1 to 1 | | `guidance_scale` | Adjusts adherence between generated content and text prompt | Range: 1.5 to 5.0 | ### Generate an Image from an Image [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#generate-an-image-from-an-image) Generates a new image based on an input image. The user uploads an existing image, and the system modifies or transforms it to generate a new version. ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352951/image-preview?onlineShareType=apidoc&locale=en-US) | Parameter Name | Description | Constraints&Details | | --- | --- | --- | | `image` | Image URL | URL format. | | `prompt` | Content to display in the extended part | string
Example: `"A lovely puppy"` | | `negative_prompt` | Elements to avoid during generation | string | | `denoise` | Proportion of input images (controls noise removal) | float (0.1-1.0) | | `guidance_scale` | Controls adherence between generated content and text prompt | float (1.5-5.0) | ### Generate an Image from an Image with LoRA [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#generate-an-image-from-an-image-with-lora) Generates a modified image based on the LoRA model.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352953/image-preview?onlineShareType=apidoc&locale=en-US) | Parameter | Description | Constraints&Details | | --- | --- | --- | | `Image` | Image URL | URL format. | | `Prompt` | Desired image description | string
Example: `"A lovely puppy"` | | `Lora_type` | Art style selection | Choose from PiAPI's available LoRA options | | `Lora_strength` | LoRA style intensity | • Range: `0.1` (faint) to `1.0` (strong) | | `Guidance_scale` | Prompt adherence level | • Range: `1.5` (creative) to `5.0` (strict) | | `Negative_prompt` | Elements to exclude | Optional
Example: `"blurry, distorted hands"` | | `Width`/ `Height` | Image dimensions | In pixels (e.g., `1024×768`)
Max: `2048×2048` | ### Generate an Image from Text [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#generate-an-image-from-text) Creates an image based on a text description.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352955/image-preview?onlineShareType=apidoc&locale=en-US) | Parameter Name | Description | Constraints&Details | | --- | --- | --- | | `Batch_size` | Batch image generation count | • **Type**: Integer
• **Range**: 1 to 4
• **Default**: 1 | | `image` | Source image URL | • **Type**: String (URL format) | | `prompt` | Description of desired image content | string
Example: `"A lovely puppy"` | | `negative_prompt` | Elements to avoid in generation | **Optional** | | `guidance_scale` | Controls prompt adherence strength | **Range**: 1.5 to 5.0 | ### Generate Image with Text based on Lora [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#generate-image-with-text-based-on-lora) Creates an image based on a text description using LoRA for fine-tuned generation.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352956/image-preview?onlineShareType=apidoc&locale=en-US) | Parameter | Description | Details& Constraints | | --- | --- | --- | | **Prompt** | Describe your desired image | string
Example: `"A lovely puppy"` | | **Lora\_type** | Select an art style | Available PiAPI LoRA options | | **Lora\_strength** | LoRA style effect intensity | • Default: `1.0` (maximum effect)
• Range: `0.1` (faint) - `1.0` (strong) | | **Guidance\_scale** | AI prompt adherence level | Range: `1.5` (random) - `5.0` (strict) | | **Negative\_prompt** | Elements to exclude | Optional
Example: `"blurry, distorted hands"` | | **Width/Height** | Output image dimensions | In pixels (e.g., `1024×768`) | ### Generate an Image with ControlNet and LoRA [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#generate-an-image-with-controlnet-and-lora) Generates an image using ControlNet and LoRA.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352957/image-preview?onlineShareType=apidoc&locale=en-US) | Parameter | Description | Constraints&Details | | --- | --- | --- | | **Image** | Source image URL | (URL format) | | **Prompt** | Desired image description | string
Example: `"A lovely puppy"` | | **control\_type** | ControlNet type | • `depth` (default)
• `soft_edge`
• `canny`
• `openpose` | | **control\_strength** | ControlNet effect intensity | Range: `0.0` \- `5.0` | | **Lora\_type** | Art style selection | Select from PiAPI's LoRA options | | **Lora\_strength** | LoRA style intensity | Range: `0.1` (faint) - `1.0` (strong) | | **denoise** | Input image proportion | Range: `0.1` \- `1.0` | | **Guidance\_scale** | Prompt adherence level | Range: `0.0` (random) - `5.0` (strict) | ### Generate a Variation of an Image [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#generate-a-variation-of-an-image) Creates a new variation of an image based on the original input.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352958/image-preview?onlineShareType=apidoc&locale=en-US) | Parameter | Description | Constraints&Details | | --- | --- | --- | | **Batch\_size** | Batch image generation count | Default: `1`
• Range: `1`- `4` | | **image** | Source image URL | (valid URL) | | **prompt** | Content for extended image part | string
Example: `"A lovely puppy"` | | **width** | Image length in pixels | Recommended: ≤ `2048` | | **height** | Image width in pixels | Recommended: ≤ `2048` | | **denoise** | Noise removal strength | Range: `0.1`- `1.0` | | **guidance\_scale** | Prompt adherence strength | Range: `0.0`- `5.0` | ### Remove the Background from an Image [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#remove-the-background-from-an-image) Removes the background from an image, leaving a transparent or solid-color background. ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352959/image-preview?onlineShareType=apidoc&locale=en-US) | Parameter | Type | Description | Example | | --- | --- | --- | --- | | `image` | `string` | Source image URL | `https://example.com/image.jpg` | ### Restore an Image [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#restore-an-image) Restores a damaged image. The user uploads an image with some parts missing or damaged, and the system fills in these gaps based on the user's description.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352960/image-preview?onlineShareType=apidoc&locale=en-US) | Parameter | Description | Constraints&Details | | --- | --- | --- | | **Batch\_size** | Batch image generation count | Default: `1`
• Range: `1`- `4` | | **image** | Source image URL | valid URL format | | **prompt** | Content for extended image part | string
Example: `"A lovely puppy"` | | **denoise** | Noise/artifact removal strength | Range: `0.1`- `1.0` | | **guidance\_scale** | Prompt adherence strength | Default: `2.5`
• Range: `0.0`- `5.0` | | **service\_mode** | Payment method selection | • `ppu` (pay-per-use)
• `byoa` (bring-your-own-account) | ## How to Build a Simple Workflow Using PiAPI on Make [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#how-to-build-a-simple-workflow-using-piapi-on-make) In this section, I will show you how to make a simple workflow with google sheets and Flux API.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352961/image-preview?onlineShareType=apidoc&locale=en-US) First, input your parameters (such as prompt and lora\_strength) into a Google Sheet based on your selected module type. Next, choose the Google Sheet trigger node . In this case, I've selected "Watch New Rows," which means the workflow will only execute when new row data is added. You may alternatively select other Google Sheet trigger nodes to suit different needs. The "Limit" setting determines how many rows are fetched per execution - I've configured it to retrieve only one row at a time.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/353006/image-preview?onlineShareType=apidoc&locale=en-US)![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/353008/image-preview?onlineShareType=apidoc&locale=en-US) Add a Flux node and input all required parameters.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352964/image-preview?onlineShareType=apidoc&locale=en-US) The final step involves configuring a node to capture your output results—you can either check the small bubble notification in the upper-right corner after each workflow execution, or implement a more structured approach. For this example, I’ve selected "Update a Row" to automatically store the target image’s URL at the end of the input row upon workflow completion. This ensures seamless traceability by appending results directly to your Google Sheet.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352965/image-preview?onlineShareType=apidoc&locale=en-US) Click Run Once![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352966/image-preview?onlineShareType=apidoc&locale=en-US) And you could check the url feedback.![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352967/image-preview?onlineShareType=apidoc&locale=en-US)![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352968/image-preview?onlineShareType=apidoc&locale=en-US) And finally, you could fetch your output here. The workflow has been constructed successfully. ## Join Our Discord [\#](https://piapi.ai/docs/piapi-make/make-insturcution\#join-our-discord) Join our Discord community to showcase your work or get troubleshooting help. Our contact details are available on the [homepage](https://piapi.ai/ ""). ![image.png](https://piapi.ai/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/352969/image-preview?onlineShareType=apidoc&locale=en-US) We are looking forward to friendly and constructive discussions. Plus, we would be so glad to see your creative workflows🙌! Modified at2025-04-02 09:24:58 [Previous\\ \\ Quickstart](https://piapi.ai/docs/quickstart) [Next\\ \\ Endpoints](https://piapi.ai/docs/endpoints) ## Kling API Get Task [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples "Lipsync With PiAPI Kling API Examples") - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples "Motion Brush With PiAPI Kling API Example") - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements "Kling Elements Video Generation API") - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects "Kling Effects Video Generation") - Cancel Task - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task\\ \\ GET](https://piapi.ai/docs/kling-api/get-task "Get Task") - [Create Task\\ \\ POST](https://piapi.ai/docs/kling-api/create-task "Create Task") - [Kling Virtual Try-On\\ \\ POST](https://piapi.ai/docs/kling-api/virtual-try-on-api "Kling Virtual Try-On") - [Kling Effects\\ \\ POST](https://piapi.ai/docs/kling-api/kling-effects-api "Kling Effects") - [Kling Sound\\ \\ POST](https://piapi.ai/docs/kling-api/kling-sound-api "Kling Sound") - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/kling-api/get-task) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/kling-api/get-task) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/kling-api/get-task) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/kling-api/get-task) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/kling-api/get-task) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/kling-api/get-task) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/kling-api/get-task) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/kling-api/get-task) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Get Task GET https://api.piapi.ai/api/v1/task/{task\_id} Try it This is provided as part of the [Kling API](https://piapi.ai/kling-api "") from PiAPI. This endpoint could get video generation progress or result of Kling task. ## Request Path Params Generate Code task\_id string required Header Params Generate Code x-api-key string required Your API Key used for request authorization ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request GET 'https://api.piapi.ai/api/v1/task/' \ --header 'x-api-key;' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code code integer required data object required task\_id string required model string required task\_type string required status enum required Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged Allowed values: CompletedProcessingPendingFailedStaged input object required output object required meta object required detail null required logs array\[object\] required error object required message string required If you get non-null error message, here are some steps you chould follow: Check our [common error message](https://climbing-adapter-afb.notion.site/Common-Error-Messages-6d108f5a8f644238b05ca50d47bbb0f4 "") Retry for several times If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon. Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "data": { "task_id": "b3efc0ab-3fdb-4b88-b20a-94eef777e125", "model": "kling", "task_type": "video_generation", "status": "completed", "config": { "service_mode": "private", "webhook_config": { "endpoint": "", "secret": "" } }, "input": {}, "output": { "type": "m2v_txt2video_hq", "status": 99, "works": [\ {\ "status": 99,\ "type": "m2v_txt2video_hq",\ "cover": {\ "resource": "https://xxx.png",\ "resource_without_watermark": "",\ "height": 1440,\ "width": 1440,\ "duration": 0\ },\ "video": {\ "resource": "https://xxx.mp4",\ "resource_without_watermark": "https://storage.goapi.ai/xxx.mp4",\ "height": 1440,\ "width": 1440,\ "duration": 5100\ }\ }\ ] }, "meta": {}, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` Modified at2025-03-19 06:53:16 [Previous\\ \\ Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) [Next\\ \\ Create Task](https://piapi.ai/docs/kling-api/create-task) ## Hailuo Director Mode [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode "Hailuo Director Mode Example") - [Generate Video\\ \\ POST](https://piapi.ai/docs/hailuo-api/generate-video "Generate Video") - [Get Task\\ \\ GET](https://piapi.ai/docs/hailuo-api/get-task "Get Task") - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Hailuo Director Mode Example ## Overview [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#overview) Hailuo has introduced two new models `t2v-01-director` `i2v-01-director` which supports camera movement parameters. These camera movements can be controlled directly through the prompt syntax. ## API Endpoint [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#api-endpoint) ### Request Format [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#request-format) ```_code_4jcsy_1 hljs hljs-json { "model": "hailuo", "task_type": "video_generation", "input": { "prompt": "[Push in,Pedestal up]walking man", "model": "t2v-01-director", //or i2v-01-director "expand_prompt": true } } ``` ## Camera Movement Parameters [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#camera-movement-parameters) ### Syntax Rules [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#syntax-rules) Camera movement parameters must be enclosed in square brackets `[]` No space is allowed between the closing bracket `]` and the prompt text Multiple camera movements can be combined within a single set of brackets Maximum of 3 camera movements per bracket ### Available Camera Movements [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#available-camera-movements) The following camera movements are supported: #### Basic Movements [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#basic-movements) `Truck left` / `Truck right`: Camera moves horizontally left or right `Pan left` / `Pan right`: Camera rotates horizontally left or right `Push in` / `Push out`: Camera moves forward or backward `Pedestal up` / `Pedestal down`: Camera moves vertically up or down `Tilt up` / `Tilt down`: Camera rotates vertically up or down `Zoom in` / `Zoom out`: Camera lens zooms in or out `Shake`: Camera shake effect `Tracking shot`: Following shot #### Special Movement [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#special-movement) `Static shot`: Fixed camera position Note: `Static shot` is mutually exclusive with all other camera movements ### Important Notes [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#important-notes) 1. There is no input validation or correction for camera movement parameters 2. Camera movement parameters are only effective with the `t2v-01-director` and `i2v-01-director` ### Example Prompts [\#](https://piapi.ai/docs/hailuo-api/hailuo-director-mode\#example-prompts) ```_code_4jcsy_1 hljs hljs- [Push in,Pedestal up]walking man [Static shot]person standing [Pan left,Tilt up,Zoom in]bird flying ``` Modified at2025-03-18 03:20:31 [Previous\\ \\ Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) [Next\\ \\ Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) ## Video Generation API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/hailuo-api/generate-video) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode "Hailuo Director Mode Example") - [Generate Video\\ \\ POST](https://piapi.ai/docs/hailuo-api/generate-video "Generate Video") - [Get Task\\ \\ GET](https://piapi.ai/docs/hailuo-api/get-task "Get Task") - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/hailuo-api/generate-video) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/hailuo-api/generate-video) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/hailuo-api/generate-video) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/hailuo-api/generate-video) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/hailuo-api/generate-video) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/hailuo-api/generate-video) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/hailuo-api/generate-video) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/hailuo-api/generate-video) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Generate Video POST https://api.piapi.ai/api/v1/task Try it Hailuo API provides video generation services with various models supporting text-to-video and image-to-video conversions. ## Pricing [\#](https://piapi.ai/docs/hailuo-api/generate-video\#pricing) ### Hailuo v1 [\#](https://piapi.ai/docs/hailuo-api/generate-video\#hailuo-v1) | Model | Price (USD) | Special Requirements | | --- | --- | --- | | t2v-01 | $0.20 | None | | i2v-01 | $0.20 | None | | t2v-01-director | $0.20 | None | | i2v-01-director | $0.20 | None | | i2v-01-live | $0.20 | None | | s2v-01 | $0.30 | Must detect human face in input image | ### Hailuo v2 [\#](https://piapi.ai/docs/hailuo-api/generate-video\#hailuo-v2) | Model | Price (USD) | duration | resolution | | --- | --- | --- | --- | | t2v-02, i2v-02 | $0.25 | 6 | 768 | | t2v-02, i2v-02 | $0.50 | 10 | 768 | | t2v-02, i2v-02 | $0.80 | 6 | 1080 | ## Model Requirements [\#](https://piapi.ai/docs/hailuo-api/generate-video\#model-requirements) ### Text-to-Video (t2v-01, t2v-01-director) [\#](https://piapi.ai/docs/hailuo-api/generate-video\#text-to-video-t2v-01-t2v-01-director) **Required fields**: `prompt` **Optional fields**: `expand_prompt` `image_url` should not be provided ### Text-to-Video (t2v-02) [\#](https://piapi.ai/docs/hailuo-api/generate-video\#text-to-video-t2v-02) **Required fields**: `prompt` **Optional fields**: `expand_prompt`, `duration`, `resolution` `image_url` should not be provided ### Image-to-Video (i2v-01, i2v-01-live, i2v-01-director) [\#](https://piapi.ai/docs/hailuo-api/generate-video\#image-to-video-i2v-01-i2v-01-live-i2v-01-director) **Required fields**: `image_url` **Optional fields**: `prompt`, `expand_prompt` ### Image-to-Video (i2v-02) [\#](https://piapi.ai/docs/hailuo-api/generate-video\#image-to-video-i2v-02) **Required fields**: `image_url` **Optional fields**: `prompt`, `expand_prompt`, `duration`, `resolution` ### Subject Reference Video (s2v-01) [\#](https://piapi.ai/docs/hailuo-api/generate-video\#subject-reference-video-s2v-01) **Required fields**: `prompt`, `image_url` **Optional fields**: `expand_prompt` Input image must contain detectable human face Higher pricing tier ($0.30 per generation) ## Input Constraints [\#](https://piapi.ai/docs/hailuo-api/generate-video\#input-constraints) ### Text Prompt ( `prompt`) [\#](https://piapi.ai/docs/hailuo-api/generate-video\#text-prompt-) Maximum length: 2000 characters Required for: t2v-01, s2v-01, i2v-01-director, t2v-01-director Optional for: i2v-01, i2v-01-live ### Image Requirements ( `image_url`) [\#](https://piapi.ai/docs/hailuo-api/generate-video\#image-requirements-) **File formats**: JPG, PNG only **Size limit**: 10MB maximum **Dimensions**: Minimum: 300px (width or height) Maximum: 4096px (width or height) Aspect ratio: Must be between 2:5 and 5:2 Required for: i2v-01, i2v-01-live, s2v-01, i2v-01-director ### Hailuo v2 [\#](https://piapi.ai/docs/hailuo-api/generate-video\#hailuo-v2-1) **Duration**: 6, 10 **Resolution**: 768, 1080 1080p+10s is not supported ## Configuration Options [\#](https://piapi.ai/docs/hailuo-api/generate-video\#configuration-options) ### Service Mode [\#](https://piapi.ai/docs/hailuo-api/generate-video\#service-mode) Currently only supports `"public"` mode (or Pay-As-You-Go) ## Important Notes [\#](https://piapi.ai/docs/hailuo-api/generate-video\#important-notes) 1. For s2v-01 model: Face detection is mandatory in the input image Failed face detection will result in task failure Higher price (0.30vs0.20 for other models) 2. Image processing: All dimensions must be within 300px to 4096px range Aspect ratio must be between 2:5 and 5:2 Only JPG and PNG formats are accepted Images larger than 10MB will be rejected 3. Billing: Cost is calculated per generation Charges are applied upon **successful** task completion only ## Request Header Params Generate Code x-api-key string optional Body Params application/json Generate Code model enum required Model name, currently only supports 'hailuo' Allowed value: hailuo task\_type enum required Task type, currently only supports 'video\_generation' Allowed value: video\_generation input object required prompt string optional Required for t2v-01,t2v-01-director and s2v-01 models. Text prompt for video generation. <= 2000 characters model enum required Model type for video generation Allowed values: i2v-01i2v-01-livet2v-01s2v-01t2v-01-directori2v-01-director image\_url string optional Required for i2v-01, i2v-01-live, and s2v-01 models. Image URL must be jpg/png, 300px-4096px, aspect ratio between 2:5 and 5:2, max 10MB expand\_prompt boolean optional Whether to expand the input prompt duration enum optional The duration of generated video, only supported for hailuo v2. Allowed values: 610 Default: 6 resolution enum optional The resolution of generated video, only supported for hailuo v2. Allowed values: 7681080 Default: 768 config object required service\_mode enum required Service mode for the request Allowed value: public webhook\_config object optional Examples hailuo v1hailuo v2 ```_code_4jcsy_1 hljs hljs-json { "model": "hailuo", "task_type": "video_generation", "input": { "prompt": "autumn wind, wild", "model": "t2v-01", "expand_prompt": true }, "config": { "service_mode": "public", "webhook_config": { "endpoint": "https://webhook.site/e20b246e-07f9-4f04-aa70-07d8d1042b1b", "secret": "123456" } } } ``` ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURL hailuo v1hailuo v2 ```_code_4jcsy_1 hljs hljs-powershell curl --location --request POST 'https://api.piapi.ai/api/v1/task' \ --header 'x-api-key;' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "hailuo", "task_type": "video_generation", "input": { "prompt": "autumn wind, wild", "model": "t2v-01", "expand_prompt": true }, "config": { "service_mode": "public", "webhook_config": { "endpoint": "https://webhook.site/e20b246e-07f9-4f04-aa70-07d8d1042b1b", "secret": "123456" } } }' ``` ## Responses 🟢200OK application/json Successful response Body Generate Code code enum required Response status code Allowed value: 200 message string required Response message data object required task\_id string required Unique task identifier model string required Model used for generation task\_type string required Type of task performed status string required Current status of the task config object optional input object required output object required meta object required error object optional Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "message": "string", "data": { "task_id": "736fde4d-9029-4915-8189-01353d6982cb", "model": "string", "task_type": "string", "status": "string", "config": {}, "input": {}, "output": { "percent": 0, "cover_url": "http://example.com", "video_url": "http://example.com", "download_url": "http://example.com", "desc": "string", "prompt_img_url": "string", "status": 0, "user_origin_prompt": true, "width": 0, "height": 0, "model_id": "string", "message": "string" }, "meta": { "created_at": "2019-08-24T14:15:22Z", "started_at": "2019-08-24T14:15:22Z", "ended_at": "2019-08-24T14:15:22Z", "usage": { "type": "string", "frozen": 0, "consume": 0 }, "is_using_private_pool": true }, "error": { "code": 0, "raw_message": "string", "message": "string", "detail": {} } } } ``` Modified at2025-07-09 07:46:29 [Previous\\ \\ Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) [Next\\ \\ Get Task](https://piapi.ai/docs/hailuo-api/get-task) ## Get Task API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/hailuo-api/get-task) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode "Hailuo Director Mode Example") - [Generate Video\\ \\ POST](https://piapi.ai/docs/hailuo-api/generate-video "Generate Video") - [Get Task\\ \\ GET](https://piapi.ai/docs/hailuo-api/get-task "Get Task") - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/hailuo-api/get-task) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/hailuo-api/get-task) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/hailuo-api/get-task) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/hailuo-api/get-task) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/hailuo-api/get-task) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/hailuo-api/get-task) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/hailuo-api/get-task) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/hailuo-api/get-task) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Get Task GET https://api.piapi.ai/api/v1/task/{task\_id} Try it This endpoint from [PiAPI's Hailuo API](https://piapi.ai/hailuo "") retrieves the output of the Hailuo task. ## Request Path Params Generate Code task\_id string required Header Params Generate Code x-api-key string required Your API Key used for request authorization ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request GET 'https://api.piapi.ai/api/v1/task/' \ --header 'x-api-key;' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code code integer required data object required task\_id string required model string required task\_type string required status enum required Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged Allowed values: CompletedProcessingPendingFailedStaged input object required output object required meta object required detail null required logs array\[object\] required error object required message string required If you get non-null error message, here are some steps you chould follow: Check our [common error message](https://climbing-adapter-afb.notion.site/Common-Error-Messages-6d108f5a8f644238b05ca50d47bbb0f4 "") Retry for several times If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon. Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "data": { "task_id": "b21a4d03-8560-4d7e-b2db-711f1911f0c3", "model": "hailuo", "task_type": "video_generation", "status": "pending", "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "string" } }, "input": { "expand_prompt": true, "image_url": "https://static.flomoapp.com/file/2024-10-17/895452/1729167170.4526029_AnvNGfHP.jpg?OSSAccessKeyId=LTAI5tAXfrgN5cBQ7Bym1EcM&Expires=1742647898&Signature=238q7hJ7cQWShQ9FYwGHb%2B2hNng%3D", "model": "i2v-01", "prompt": "The flower slowly unfolds" }, "output": { "percent": 0, "cover_url": "", "video_url": "", "download_url": "", "desc": "", "prompt_img_url": "", "status": 0, "user_origin_prompt": false, "width": 0, "height": 0, "model_id": "", "message": "" }, "meta": { "created_at": "2025-03-19T12:53:47.893012908Z", "started_at": "0001-01-01T00:00:00Z", "ended_at": "0001-01-01T00:00:00Z", "usage": { "type": "point", "frozen": 2000000, "consume": 0 }, "is_using_private_pool": false }, "detail": null, "logs": null, "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` Modified at2025-03-19 06:58:02 [Previous\\ \\ Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) [Next\\ \\ Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) ## LoRA and ControlNet [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "Flux with LoRA and Controlnet") - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet "Available LoRA and Controlnet") - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint "Flux API with Redux Variation, Fill, Inpaint and Outpaint") - Create Task - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task \\ \\ GET](https://piapi.ai/docs/flux-api/get-task "Get task ") - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Flux with LoRA and Controlnet This service is provided by [PiAPI](https://piapi.ai/ "") in collaboration with Qubico's specialized inference hardware, designed to optimize LoRA (Low-Rank Adaptation) and ControlNet functionalities for advanced model control in various Flux tasks. ## Flux API (Task Creation with LoRA and ControlNet) [\#](https://piapi.ai/docs/flux-with-lora-and-controlnet\#flux-api-task-creation-with-lora-and-controlnet) ### Model, Task Type and LoRA Numbers [\#](https://piapi.ai/docs/flux-with-lora-and-controlnet\#model-task-type-and-lora-numbers) | **Model Name** | **Task Type** | **LoRA Capacity** | **Controlnet Capacity** | | --- | --- | --- | --- | | Qubico/flux1-dev-advanced | txt2img-lora | 1 | 0 | | Qubico/flux1-dev-advanced | img2img-lora | 1 | 0 | | Qubico/flux1-dev-advanced | controlnet-lora | 0 or 1 | 1 | | Qubico/flux1-dev-advanced | contact us if you need a complex workflow customization | >1 | >1 | **Note: `Qubico/flux1-dev-advanced` is the only model that supports LoRA and controlnet in PiAPI's [Flux API](https://piapi.ai/docs/flux-api/text-to-image "").** You can explore [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet "") to find out what LoRA or Controlnet model that best fit your need. ### Example: Request Body of Text-to-Image Task with ControlNet and LoRA [\#](https://piapi.ai/docs/flux-with-lora-and-controlnet\#example--request-body-of-text-to-image-task-with-controlnet-and-lora) ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev-advanced", "task_type": "controlnet-lora", "input": { "prompt": "spiderman", "control_net_settings": [\ {\ "control_type": "depth",\ "control_image": "https://example.com/control_image2.png"\ }\ ], "lora_settings": [\ {\ "lora_type": "mjv6"\ }\ ] }, "config": { "webhook_config": { "endpoint": "https://webhook.site/d35ab4aa-95f9-4855-af82-32fbfbb67063", "secret": "" } } } ``` ### Request Example Using cURL [\#](https://piapi.ai/docs/flux-with-lora-and-controlnet\#request-example-using-curl) ```_code_4jcsy_1 hljs hljs-bash ``` ### Example: Request Body of Task Creation with LoRA only [\#](https://piapi.ai/docs/flux-with-lora-and-controlnet\#example-request-body-of-task-creation-with-lora-only) Input Example: ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev-advanced", "task_type": "txt2img-lora", "input": { "prompt": "spiderman", "lora_settings": [\ {\ "lora_type": "mjv6"\ }\ ] }, "config": { "webhook_config": { "endpoint": "https://webhook.site/d35ab4aa-95f9-4855-af82-32fbfbb67063", "secret": "" } } } ``` ### Example: Task Creation with controlnet Canny [\#](https://piapi.ai/docs/flux-with-lora-and-controlnet\#example-task-creation-with-controlnet-canny) ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev-advanced", "task_type": "controlnet-lora", "input": { "steps": 28, "prompt": "A girl in city, 25 years old, cool, futuristic", "negative_prompt": "low quality, ugly, distorted, artefacts", "guidance_scale": 2.5, "control_net_settings": [\ {\ "control_type": "canny",\ "control_image": "https://i.ibb.co/yX07dwV/Comfy-UI-controlnet.webp",\ "control_strength": 0.45,\ "return_preprocessed_image": true\ }\ ], "lora_settings": [\ {\ "lora_type": "graphic-portrait",\ "lora_strength": 1\ }\ ] }, "config": { "webhook_config": { "endpoint": "", "secret": "" } } } ``` | Canny Result 1 | Canny Result 2 | | --- | --- | | ![Alt text 1](https://i.ibb.co/fG5C6kz/canny1.png) | ![Alt text 2](https://i.ibb.co/FwQqhmz/canny2.png) | ### Example: Task Creation with controlnet Depth [\#](https://piapi.ai/docs/flux-with-lora-and-controlnet\#example-task-creation-with-controlnet-depth) ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev-advanced", "task_type": "controlnet-lora", "input": { "steps": 28, "prompt": "A girl in city, 25 years old, cool, futuristic", "negative_prompt": "low quality, ugly, distorted, artefacts", "guidance_scale": 2.5, "control_net_settings": [\ {\ "control_type": "depth",\ "control_image": "https://i.ibb.co/yX07dwV/Comfy-UI-controlnet.webp",\ "control_strength": 0.45,\ "return_preprocessed_image": true\ }\ ], "lora_settings": [\ {\ "lora_type": "geometric-woman",\ "lora_strength": 1\ }\ ] }, "config": { "webhook_config": { "endpoint": "", "secret": "" } } } ``` | Depth Result 1 | Depth Result 2 | | --- | --- | | ![Alt text 1](https://i.ibb.co/HNSzwWx/depth1.png) | ![Alt text 2](https://i.ibb.co/8Kf1P9P/depth2.png) | ### Example: Task Creation with controlnet SoftEdge [\#](https://piapi.ai/docs/flux-with-lora-and-controlnet\#example-task-creation-with-controlnet-softedge) ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev-advanced", "task_type": "controlnet-lora", "input": { "steps": 28, "prompt": "A girl in city, 25 years old, cool, futuristic", "negative_prompt": "low quality, ugly, distorted, artefacts", "guidance_scale": 2.5, "control_net_settings": [\ {\ "control_type": "soft_edge",\ "control_image": "https://i.ibb.co/yX07dwV/Comfy-UI-controlnet.webp",\ "control_strength": 0.55,\ "return_preprocessed_image": true\ }\ ], "lora_settings": [\ {\ "lora_type": "remes-abstract-poster-style",\ "lora_strength": 1\ }\ ] }, "config": { "webhook_config": { "endpoint": "https://webhook.site/0edf5555-22ba-4aae-898a-f707440effa4", "secret": "" } } } ``` | Softedge Result 1 | Softedge Result 2 | | --- | --- | | ![Alt text 1](https://i.ibb.co/Pxqm9NM/softedge1.png) | ![Alt text 2](https://i.ibb.co/p3N6ZtF/softedge2.png) | ### Example: Task Creation with controlnet OpenPose [\#](https://piapi.ai/docs/flux-with-lora-and-controlnet\#example-task-creation-with-controlnet-openpose) ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev-advanced", "task_type": "controlnet-lora", "input": { "steps": 28, "prompt": "person enjoying a day at the park, full hd, cinematic", "negative_prompt": "low quality, ugly, distorted, artefacts", "guidance_scale": 4.0, "control_net_settings": [\ {\ "control_type": "openpose",\ "control_image": "https://i.ibb.co/vkCbMZY/3-pose-1024.jpg",\ "control_strength": 0.7,\ "return_preprocessed_image": true\ }\ ], "lora_settings": [\ {\ "lora_type": "mjv6",\ "lora_strength": 1\ }\ ] }, "config": { "webhook_config": { "endpoint": "https://webhook.site/0edf5555-22ba-4aae-898a-f707440effa4", "secret": "" } } } ``` | OpenPose Control Image INPUT | OpenPose Result | | --- | --- | | ![Alt text 1](https://i.ibb.co/WtZ0mcq/pose1.png) | ![Alt text 2](https://i.ibb.co/0FvWxqH/pose2.png) | Modified at2025-04-22 06:31:15 [Previous\\ \\ Get Task](https://piapi.ai/docs/hailuo-api/get-task) [Next\\ \\ Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) ## LoRA and ControlNet Models [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/available-lora-and-controlnet) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "Flux with LoRA and Controlnet") - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet "Available LoRA and Controlnet") - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint "Flux API with Redux Variation, Fill, Inpaint and Outpaint") - Create Task - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task \\ \\ GET](https://piapi.ai/docs/flux-api/get-task "Get task ") - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/available-lora-and-controlnet) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/available-lora-and-controlnet) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/available-lora-and-controlnet) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/available-lora-and-controlnet) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/available-lora-and-controlnet) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/available-lora-and-controlnet) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/available-lora-and-controlnet) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Available LoRA and Controlnet **This page lists all available LoRA and ControlNet models for [PiAPI's Flux API](https://piapi.ai/flux-api ""), including examples of their settings and image results.** You can try these models by following our instruction [Flux with LoRA and controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "") ## Available LoRA Models [\#](https://piapi.ai/docs/available-lora-and-controlnet\#available-lora-models) | **LoRA Model Name** | **Source** | **JSON Setting Structure Example** | **Example Image** | | --- | --- | --- | --- | | Anime | [https://huggingface.co/XLabs-AI/flux-lora-collection](https://huggingface.co/XLabs-AI/flux-lora-collection "") | `{"lora_type": "anime"}` | ![Anime Example](https://i.ibb.co/rvy8k31/anime.png) | | Art | [https://huggingface.co/XLabs-AI/flux-lora-collection](https://huggingface.co/XLabs-AI/flux-lora-collection "") | `{"lora_type": "art"}` | ![Art Example](https://i.ibb.co/HYgMHpF/art.png) | | Disney | [https://huggingface.co/XLabs-AI/flux-lora-collection](https://huggingface.co/XLabs-AI/flux-lora-collection "") | `{"lora_type": "disney"}` | ![Disney Example](https://i.ibb.co/cDDG7zn/disney.png) | | Furry | [https://huggingface.co/XLabs-AI/flux-lora-collection](https://huggingface.co/XLabs-AI/flux-lora-collection "") | `{"lora_type": "furry"}` | ![Furry Example](https://i.ibb.co/g4JJbyJ/furry.png) | | MJv6 | [https://huggingface.co/XLabs-AI/flux-lora-collection](https://huggingface.co/XLabs-AI/flux-lora-collection "") | `{"lora_type": "mjv6"}` | ![MJv6 Example](https://i.ibb.co/G7RRqZh/mjv6.png) | | Realism | [https://huggingface.co/XLabs-AI/flux-lora-collection](https://huggingface.co/XLabs-AI/flux-lora-collection "") | `{"lora_type": "realism"}` | ![Realism Example](https://i.ibb.co/YNLwkRj/realism.png) | | Scenery | [https://huggingface.co/XLabs-AI/flux-lora-collection](https://huggingface.co/XLabs-AI/flux-lora-collection "") | `{"lora_type": "scenery"}` | ![Scenery Example](https://i.ibb.co/vxX2fqx/scenery.png) | | Collage Artstyle | [https://civitai.com/models/748468/retro-collage-art](https://civitai.com/models/748468/retro-collage-art "") | `{"lora_type": "collage-artstyle"}` | ![Collage Artstyle Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/14991cfb-04d3-49bb-86a9-1a1b5cb5e16d/original=true,quality=10/1d1ec133-3187-4f2a-9fd1-1a19fa2741f6.jpeg) | | Creepycute | [https://civitai.com/models/788990/creepycute](https://civitai.com/models/788990/creepycute "") | `{"lora_type": "creepcute"}` | ![Creepycute Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/f7e9e831-7cc9-4991-b457-9341eb4e0b5a/original=true,quality=10/1.jpeg) | | Cyberpunk Anime Style | [https://civitai.com/models/128568/cyberpunk-anime-style](https://civitai.com/models/128568/cyberpunk-anime-style "") | `{"lora_type": "cyberpunk-anime-style"}` | ![Cyberpunk Anime Style Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/eec5618a-f36d-4587-8b15-e6a27878aad3/original=true,quality=10/flux_00568_.jpeg) | | Deco Pulse | [https://civitai.com/models/720587/decopulse-flux](https://civitai.com/models/720587/decopulse-flux "") | `{"lora_type": "deco-pulse"}` | ![Deco Pulse Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/475aad1a-939e-460d-a1fe-f601fc2088d4/original=true,quality=10/VS12.jpeg) | | Deep Sea Particle Enhancer | [https://civitai.com/models/15452/paseer-moxin-assist-for-adding-colorful](https://civitai.com/models/15452/paseer-moxin-assist-for-adding-colorful "") | `{"lora_type": "deep-sea-particle-enhencer"}` | ![Deep Sea Particle Enhancer Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/d76cf937-0877-44b2-a7e7-85733d030c18/original=true,quality=10/particle-001.jpeg) | | Faetastic Details | [https://civitai.com/models/643886/flux-faetastic-details](https://civitai.com/models/643886/flux-faetastic-details "") | `{"lora_type": "faetastic-details"}` | ![Faetastic Details Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/5613fa67-ddea-4784-bba5-9468f66e24ee/original=true,quality=10/MarkuryFLUX_00527_.jpeg) | | Fractal Geometry | [https://civitai.com/models/269592/fractal-geometry-style-fluxsdxl15](https://civitai.com/models/269592/fractal-geometry-style-fluxsdxl15 "") | `{"lora_type": "fractal-geometry"}` | ![Fractal Geometry Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/6e5287e0-c662-4515-b48e-442ce46fdc32/original=true,quality=10/00019-3128378175.jpeg) | | Galactixy Illustrations Style | [https://civitai.com/models/747833/galactixy-illustrations-style](https://civitai.com/models/747833/galactixy-illustrations-style "") | `{"lora_type": "galactixy-illustrations-style"}` | ![Galactixy Illustrations Style Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/82074182-d56a-4857-b7b6-c02963ab8268/original=true,quality=10/2024-09-14-133324.jpeg) | | Geometric Woman | [https://civitai.com/models/103528/geometric-woman](https://civitai.com/models/103528/geometric-woman "") | `{"lora_type": "geometric-woman"}` | ![Geometric Woman Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/de6f6f38-9749-4cd1-8e6f-b40eb754a0e1/original=true,quality=10/flux_00283_.jpeg) | | Graphic Portrait | [https://civitai.com/models/170039/graphic-portrait](https://civitai.com/models/170039/graphic-portrait "") | `{"lora_type": "graphic-portrait"}` | ![Graphic Portrait Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/0f1b2f23-acb6-471d-a4b1-439dbd117560/original=true,quality=10/flux_03654_.jpeg) | | Mat Miller Art | [https://civitai.com/models/894974/mat-miller-art-style](https://civitai.com/models/894974/mat-miller-art-style "") | `{"lora_type": "mat-miller-art"}` | ![Mat Miller Art Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/f5ba9cd2-8d76-40aa-b8b3-338cdf208dfa/original=true,quality=10/ComfyUI_00131_.jpeg) | | Moebius Style | [https://civitai.com/models/682651/moebius-style-flux](https://civitai.com/models/682651/moebius-style-flux "") | `{"lora_type": "moebius-style"}` | ![Moebius Style Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/ffebd187-21a0-488b-bb92-70d3bab07d78/original=true,quality=10/PEQ1V9K5V038EDM5DDK8GQR5E0.jpeg) | | OB3D Isometric 3D Room | [https://civitai.com/models/555323/ob3d-isometric-3d-room-v20](https://civitai.com/models/555323/ob3d-isometric-3d-room-v20 "") | `{"lora_type": "ob3d-isometric-3d-room"}` | ![OB3D Isometric 3D Room Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/ab78c3ac-5582-4dc2-9e00-715803eb063b/original=true,quality=10/772392869706130877.jpeg) | | Paper Quilling and Layering Style | [https://civitai.com/models/860403/paper-quilling-and-layering-style-flux](https://civitai.com/models/860403/paper-quilling-and-layering-style-flux "") | `{"lora_type": "paper-quilling-and-layering-style"}` | ![Paper Quilling Example](https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/d6167ae2-8d41-40b4-8141-dfc3d5dcd9f1/original=true,quality=10/ComfyUI_00005_.jpeg) | ## Available ControlNet Models [\#](https://piapi.ai/docs/available-lora-and-controlnet\#available-controlnet-models) | **ControlNet Model Name** | **Description** | **JSON Setting Structure Example** | **Example Image Result** | | --- | --- | --- | --- | | Depth | ControlNet model for depth map-based control | `{"control_type": "depth", "control_image": "https://example.com/depth_example.png"}` | ![Depth Example](https://i.ibb.co/YZZWSqq/depth.png) | | Soft Edge | ControlNet model for soft edge detection and control | `{"control_type": "soft_edge", "control_image": "https://example.com/soft_edge_example.png"}` | ![Soft Edge Example](https://i.ibb.co/MBCSWVZ/soft-edge.png) | | Canny | ControlNet model for Canny edge detection control | `{"control_type": "canny", "control_image": "https://example.com/canny_example.png"}` | ![Canny Example](https://i.ibb.co/MfR9Cg4/canny.png) | ## Help Us Grow the List! [\#](https://piapi.ai/docs/available-lora-and-controlnet\#help-us-grow-the-list) We are constantly expanding our available LoRA and ControlNet models. If you have any suggestions or requests for specific models, feel free to join our Discord community(Shortcut to our discord is on the right-top corner) and submit your feature requests. Help us upload more LoRAs and ControlNets to enhance the capabilities of our API! Modified at2024-12-03 13:59:35 [Previous\\ \\ Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) [Next\\ \\ Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) ## Text to Image API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview) - [Quickstart](https://piapi.ai/docs/quickstart) - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution) - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/flux-api/text-to-image) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "Flux with LoRA and Controlnet") - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet "Available LoRA and Controlnet") - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint "Flux API with Redux Variation, Fill, Inpaint and Outpaint") - Create Task - [Text to Image\\ \\ POST](https://piapi.ai/docs/flux-api/text-to-image "Text to Image") - [Image to Image\\ \\ POST](https://piapi.ai/docs/flux-api/image-to-image "Image to Image") - [Kontext\\ \\ POST](https://piapi.ai/docs/flux-api/kontext "Kontext") - [Get task \\ \\ GET](https://piapi.ai/docs/flux-api/get-task "Get task ") - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/flux-api/text-to-image) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/flux-api/text-to-image) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/flux-api/text-to-image) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/flux-api/text-to-image) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/flux-api/text-to-image) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/flux-api/text-to-image) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/flux-api/text-to-image) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Text to Image POST https://api.piapi.ai/api/v1/task Try it This is provided as part of the [Flux API](https://piapi.ai/flux-api "") from PiAPI. available models: Qubico/flux1-dev Qubico/flux1-schnell Qubico/flux1-dev-advanced Check [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "") to learn how to send Flux with LoRA and Controlnet task. Check [Flux with Redux and Fill](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint "") to learn how to send Flux with variation, inpaint and out paint task. Below is an example of a _**text-to-image**_ request and response. ## Request Header Params Generate Code X-API-Key string required Your API KEY used for request authorization Body Params application/json Generate Code model enum required the model name, can be `Qubico/flux1-dev` or `Qubico/flux1-schnell` or `Qubico/flux1-dev-advanced` Allowed values: Qubico/flux1-schnellQubico/flux1-devQubico/flux1-dev-advanced task\_type enum required Allowed values: txt2imgimg2imgtxt2img-loraimg2img-lorafill-inpaintfill-outpaintredux-variationcontrolnet-lora input object required the input param of the flux task prompt string required negative\_prompt string optional denoise number optional <= 1\> 0 Default: 0.7 guidance\_scale number optional Guidance scale for image generation. High guidance scales improve prompt adherence at the cost of reduced realism. >= 1.5<= 5 width integer optional can be used in txt2img ONLY, width\*height cannot exceed 1048576 height integer optional can be used in txt2img ONLY, width\*height cannot exceed 1048576 batch\_size number optional number of images, only works for schnell at the moment. Price will be batch\_size \* (price for one generation) >= 1<= 4 Default: 1 lora\_settings array\[object {2}\] optional Check [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "") control\_net\_settings array\[object {2}\] optional Check [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "") config object optional webhook\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](https://piapi.ai/docs/unified-webhook "") for detail. service\_mode enum optional This allows users to choose whether this specific task will get processed under PAYG or HYA mode. If unspecified, then this task will get processed under whatever mode (PAYG or HYA) the user chose on the workspace setting of your account. `public` means this task will be processed under PAYG mode. `private` means this task will be processed under HYA mode. Allowed values: publicprivate Example ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev", "task_type": "txt2img", "input": { "prompt": "a little cat", "width": 1024, "height": 1024 } } ``` ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request POST 'https://api.piapi.ai/api/v1/task' \ --header 'X-API-Key;' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "Qubico/flux1-dev", "task_type": "txt2img", "input": { "prompt": "a little cat", "width": 1024, "height": 1024 } }' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code code integer required data object required task\_id string required model string required task\_type string required status enum required Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged Allowed values: CompletedProcessingPendingFailedStaged input object required output object required meta object required detail null required logs array\[object\] required error object required message string required If you get non-null error message, here are some steps you chould follow: Check our [common error message](https://climbing-adapter-afb.notion.site/Common-Error-Messages-6d108f5a8f644238b05ca50d47bbb0f4 "") Retry for several times If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon. Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "message": "success", "data": { "task_id": "0f647527-12bd-48b1-b813-111111111", "model": "Qubico/flux1-dev", "task_type": "txt2img", "status": "", // pending/processing/failed/completed "input": {}, "output": {}, "meta": { }, "logs": [], "error": { "code": 1100, "message": "" } } } ``` Modified at2025-05-09 08:55:27 [Previous\\ \\ Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) [Next\\ \\ Image to Image](https://piapi.ai/docs/flux-api/image-to-image) ## Get Task API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/flux-api/get-task) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "Flux with LoRA and Controlnet") - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet "Available LoRA and Controlnet") - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint "Flux API with Redux Variation, Fill, Inpaint and Outpaint") - Create Task - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task \\ \\ GET](https://piapi.ai/docs/flux-api/get-task "Get task ") - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/flux-api/get-task) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/flux-api/get-task) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/flux-api/get-task) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/flux-api/get-task) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/flux-api/get-task) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/flux-api/get-task) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/flux-api/get-task) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Get task GET https://api.piapi.ai/api/v1/task/{task\_id} Try it This endpoint from [PiAPI's Flux API](https://piapi.ai/flux-api "") retrieves the output of a Flux task. ## Request Path Params Generate Code task\_id string required Header Params Generate Code x-api-key string required Your GoAPI Key used for request authorization ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request GET 'https://api.piapi.ai/api/v1/task/' \ --header 'x-api-key;' ``` ## Responses 🟢200Success application/jsonGenerate Code Body Generate Code code integer required data object required task\_id string required important for retriving task result using Fetch API task\_type string required status enum required Allowed values: pendingstartingprocessing successfailedretry task\_info object required task\_result object required message string required Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "data": { "task_id": "a62ba0d0-184f-xxxx79f", "model": "Qubico/flux1-dev", "task_type": "txt2img", "status": "success", "config": { "service_mode": "", "webhook_config": { "endpoint": "", "secret": "" } }, "input": { "prompt": "a bear" }, "output": { "image_url": "https://ixxxxe3f.png", "image_base64": "" }, "meta": { "created_at": "2024-10-23T10:35:31.039487176Z", "started_at": "0001-01-01T00:00:00Z", "ended_at": "0001-01-01T00:00:00Z" }, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` Modified at2025-05-09 08:56:38 [Previous\\ \\ Kontext](https://piapi.ai/docs/flux-api/kontext) [Next\\ \\ Get Task](https://piapi.ai/docs/ai-hug-api/get-task) ## Flux API Overview [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet "Flux with LoRA and Controlnet") - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet "Available LoRA and Controlnet") - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint "Flux API with Redux Variation, Fill, Inpaint and Outpaint") - Create Task - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task \\ \\ GET](https://piapi.ai/docs/flux-api/get-task "Get task ") - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog) - [Output Storage](https://piapi.ai/docs/output-storage) - [Unified API Schema](https://piapi.ai/docs/unified-api-schema) - [Webhook](https://piapi.ai/docs/unified-webhook) - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation) - [Billings](https://piapi.ai/docs/billings) - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server) - [Workspace Manual](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - [Announcements](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Flux API with Redux Variation, Fill, Inpaint and Outpaint ## Flux API (Task Creation with fill or redux) [\#](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint\#flux-api-task-creation-with-fill-or-redux) ### Model, Task Type and Usage [\#](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint\#model-task-type-and-usage) | **Model Name** | **Task Type** | **Usage** | | --- | --- | --- | | Qubico/flux1-dev-advanced | fill-inpaint | inpaint a masked area of a given image | | Qubico/flux1-dev-advanced | fill-outpaint | outpaint/pan/expand a given image | | Qubico/flux1-dev-advanced | redux-variation | remix/variation on a given image | | Contact Us | contact us if you need a complex workflow customization | - | **Note: `Qubico/flux1-dev-advanced` is the only model that supports `fill-inpaint`, `fill-outpaint` and `redux-variation` in PiAPI's [Flux API](https://piapi.ai/docs/flux-api/create-task "").** ### Example: Request Body of Inpaint Task [\#](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint\#example--request-body-of-inpaint-task) ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev-advanced", "task_type": "fill-inpaint", "input": { "prompt": "a girl in blue and red skirt", "image": "https://i.ibb.co/TH7xMvd/girl-mask.png"//should come with a white pixel masked area }, "config": { "webhook_config": { "endpoint": "", "secret": "" } } } ``` ### Example: Request Body of Outpaint Task [\#](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint\#example--request-body-of-outpaint-task) ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev-advanced", "task_type": "fill-outpaint", "input": { "prompt": "a girl in a great grass sea", "image": "https://i.ibb.co/TH7xMvd/girl-mask.png", "custom_settings": [ //the total delta pixel size should be less than 1024*1024\ {\ "setting_type": "outpaint",\ "outpaint_left": 500,\ "outpaint_right": 500,//this result in a 2024x1024 final image\ "outpaint_top": 0,\ "outpaint_bottom": 0\ }\ ] }, "config": { "webhook_config": { "endpoint": "", "secret": "" } } } ``` ### Example: Request Body of Variation(remix) Task [\#](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint\#example--request-body-of-variationremix-task) ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/flux1-dev-advanced", "task_type": "redux-variation", "input": { "prompt": "a superman", "image": "https://i.ibb.co/TH7xMvd/girl-mask.png" }, "config": { "webhook_config": { "endpoint": "", "secret": "" } } } ``` Modified at2024-12-03 15:04:21 [Previous\\ \\ Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) [Next\\ \\ Text to Image](https://piapi.ai/docs/flux-api/text-to-image) ## Create Task Guide [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/ai-hug-api/create-task) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task\\ \\ GET](https://piapi.ai/docs/ai-hug-api/get-task "Get Task") - [Create Task\\ \\ POST](https://piapi.ai/docs/ai-hug-api/create-task "Create Task") - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/ai-hug-api/create-task) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog "Change Log") - [Output Storage](https://piapi.ai/docs/output-storage "Output Storage") - [Unified API Schema](https://piapi.ai/docs/unified-api-schema "Unified API Schema") - [Webhook](https://piapi.ai/docs/unified-webhook "Webhook") - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation "Bulk Generation Service") - [Billings](https://piapi.ai/docs/billings "Billings") - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server "PiAPI MCP Server") - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/ai-hug-api/create-task) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/ai-hug-api/create-task) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/ai-hug-api/create-task) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Create Task POST https://api.piapi.ai/api/v1/task Try it This service allows you to generate a hugging video of two people from an image using Qubico's hardware. It uses Qubico's unified task structure. ## Request Header Params Generate Code X-API-Key string required Your API Key for request authorization Content-Type enum required Allowed value: application/json Body Params application/json Generate Code model enum required Allowed value: Qubico/hug-video task\_type enum required Allowed value: image\_to\_video input object required Input parameters including the image URL image\_url string required config object optional webhook\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](https://piapi.ai/docs/unified-webhook "") for detail. service\_mode enum optional This allows users to choose whether this specific task will get processed under PAYG or HYA mode. If unspecified, then this task will get processed under whatever mode (PAYG or HYA) the user chose on the workspace setting of your account. `public` means this task will be processed under PAYG mode. `private` means this task will be processed under HYA mode. Allowed values: publicprivate Example ```_code_4jcsy_1 hljs hljs-json { "model": "Qubico/hug-video", "task_type": "image_to_video", "input": { "image_url": "https://i.ibb.co/znPyjxy/person2.jpg" } } ``` ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request POST 'https://api.piapi.ai/api/v1/task' \ --header 'X-API-Key;' \ --header 'Content-Type: application/json' \ --data-raw '{ "model": "Qubico/hug-video", "task_type": "image_to_video", "input": { "image_url": "https://i.ibb.co/znPyjxy/person2.jpg" } }' ``` ## Responses 🟢200OK application/json OK-Successful Response. Body Generate Code code integer required data object required task\_id string required model string required task\_type string required status enum required Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged Allowed values: CompletedProcessingPendingFailedStaged input object required output object required meta object required detail null required logs array\[object\] required error object required message string required If you get non-null error message, here are some steps you chould follow: Check our [common error message](https://climbing-adapter-afb.notion.site/Common-Error-Messages-6d108f5a8f644238b05ca50d47bbb0f4 "") Retry for several times If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon. Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "data": { "task_id": "49439a00-465c-4501-9ce2-14581e01f616", "model": "Qubico/hug-video", "task_type": "image_to_video", "status": "",// pending/processing/failed/completed "config": { "webhook_config": { "endpoint": "", "secret": "" } }, "input": { }, "output": {}, "meta": {}, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` 🟠400Bad Request 🟠401Unauthorized Modified at2025-02-19 13:32:16 [Previous\\ \\ Get Task](https://piapi.ai/docs/ai-hug-api/get-task) [Next\\ \\ Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) ## Get Task API [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) Copy Page - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task\\ \\ GET](https://piapi.ai/docs/ai-hug-api/get-task "Get Task") - [Create Task\\ \\ POST](https://piapi.ai/docs/ai-hug-api/create-task "Create Task") - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog "Change Log") - [Output Storage](https://piapi.ai/docs/output-storage "Output Storage") - [Unified API Schema](https://piapi.ai/docs/unified-api-schema "Unified API Schema") - [Webhook](https://piapi.ai/docs/unified-webhook "Webhook") - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation "Bulk Generation Service") - [Billings](https://piapi.ai/docs/billings "Billings") - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server "PiAPI MCP Server") - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/ai-hug-api/get-task) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/ai-hug-api/get-task) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/ai-hug-api/get-task) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) Copy Page # Get Task GET https://api.piapi.ai/api/v1/task/{task\_id} Try it This is provided as part of the [AI Hug API from PiAPI](https://piapi.ai/ ""). This endpoint checks the status of a hugging video generation task. ## Request Path Params Generate Code task\_id string required Header Params Generate Code X-API-Key string required Your API KEY used for request authorization ## Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R Request Request Example Shell JavaScript Java Swift cURLcURL-WindowsHttpiewgetPowerShell ```_code_4jcsy_1 hljs hljs-powershell curl --location --request GET 'https://api.piapi.ai/api/v1/task/' \ --header 'X-API-Key;' ``` ## Responses 🟢200OK application/json OK-Returns the status and result of the task Body Generate Code code integer required data object required task\_id string required model string required task\_type string required status enum required Hover on the "Completed" option and you coult see the explaintion of all status: completed/processing/pending/failed/staged Allowed values: CompletedProcessingPendingFailedStaged input object required output object required meta object required detail null required logs array\[object\] required error object required message string required If you get non-null error message, here are some steps you chould follow: Check our [common error message](https://climbing-adapter-afb.notion.site/Common-Error-Messages-6d108f5a8f644238b05ca50d47bbb0f4 "") Retry for several times If you have retried for more than 3 times and still not work, file a ticket on Discord and our support will be with you soon. Example ```_code_4jcsy_1 hljs hljs-json { "code": 200, "message": "success", "data": { "task_id": "0f647527-12bd-48b1-b813-111111111", "model": "Qubico/hug-video", "task_type": "image_to_video", "status": "", // pending/processing/failed/completed "input": {}, "output": {}, "meta": { }, "logs": [], "error": { "code": 1100, "message": "" } } } ``` 🟠401Unauthorized 🟠404Record Not Found Modified at2024-10-08 02:31:31 [Previous\\ \\ Get task](https://piapi.ai/docs/flux-api/get-task) [Next\\ \\ Create Task](https://piapi.ai/docs/ai-hug-api/create-task) ## PiAPI Documentation [![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)\\ **PiAPI**](https://piapi.ai/docs) [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [Home](https://piapi.ai/ "Home") [Workspace](https://app.piapi.ai/ "Workspace") [![Join Discord](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg)](https://discord.gg/ZEtUTgYbwS) - Get Started - [Overview](https://piapi.ai/docs/overview "Overview") - [Quickstart](https://piapi.ai/docs/quickstart "Quickstart") - [Make Instruction: How to Use PiAPI to Build a Workflow on Make?](https://piapi.ai/docs/piapi-make/make-insturcution "Make Instruction: How to Use PiAPI to Build a Workflow on Make?") - [Endpoints](https://piapi.ai/docs/endpoints "Endpoints") - Song(Udio) - [Song API Task Creation Examples](https://piapi.ai/docs/music-api/music-task-examples) - [\[Udio\] Song Extend](https://piapi.ai/docs/song-api/udio-song-extend) - [Create Task](https://piapi.ai/docs/music-api/create-task) - [\[Udio\] Generate Lyrics](https://piapi.ai/docs/song-api/udio-generate-lyrics) - Kling - [Lipsync With PiAPI Kling API Examples](https://piapi.ai/docs/kling-api/lipsync-examples) - [Motion Brush With PiAPI Kling API Example](https://piapi.ai/docs/kling-api/motion-brush-examples) - [Kling Elements Video Generation API](https://piapi.ai/docs/kling-api/kling-elements) - [Kling Effects Video Generation](https://piapi.ai/docs/kling-api/kling-effects) - [Cancel Task](https://piapi.ai/docs/gpts-gizmo-name) - [Cancel Tasks](https://piapi.ai/docs/kling-api/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/kling-api/cancel-task) - [Get Task](https://piapi.ai/docs/kling-api/get-task) - [Create Task](https://piapi.ai/docs/kling-api/create-task) - [Kling Virtual Try-On](https://piapi.ai/docs/kling-api/virtual-try-on-api) - [Kling Effects](https://piapi.ai/docs/kling-api/kling-effects-api) - [Kling Sound](https://piapi.ai/docs/kling-api/kling-sound-api) - Hailuo - [Hailuo Director Mode Example](https://piapi.ai/docs/hailuo-api/hailuo-director-mode) - [Generate Video](https://piapi.ai/docs/hailuo-api/generate-video) - [Get Task](https://piapi.ai/docs/hailuo-api/get-task) - Flux - [Flux with LoRA and Controlnet](https://piapi.ai/docs/flux-with-lora-and-controlnet) - [Available LoRA and Controlnet](https://piapi.ai/docs/available-lora-and-controlnet) - [Flux API with Redux Variation, Fill, Inpaint and Outpaint](https://piapi.ai/docs/flux-redux-fill-variation-inpaint-outpaint) - [Create Task](https://piapi.ai/docs/gpts-gizmo-name) - [Text to Image](https://piapi.ai/docs/flux-api/text-to-image) - [Image to Image](https://piapi.ai/docs/flux-api/image-to-image) - [Kontext](https://piapi.ai/docs/flux-api/kontext) - [Get task](https://piapi.ai/docs/flux-api/get-task) - AI Hug - [Get Task](https://piapi.ai/docs/ai-hug-api/get-task) - [Create Task](https://piapi.ai/docs/ai-hug-api/create-task) - LLM - [Use Cases for GPT-4o Image API](https://piapi.ai/docs/gpt-4o-image/use-case) - [How To Avoid Timeouts in Completion API](https://piapi.ai/docs/llm-timeout) - [GPT-4o Image Generation API](https://piapi.ai/docs/llm-api/gpt-4o-image-generation-api) - [LLM API \| Basic Completions](https://piapi.ai/docs/llm-api/completions) - [Get Task](https://piapi.ai/docs/llm-get-task) - Faceswap - [Multi Faceswap](https://piapi.ai/docs/multi-face-swap/create-task) - [Image Faceswap](https://piapi.ai/docs/faceswap-api/create-task) - [Video Faceswap](https://piapi.ai/docs/faceswap-api/video-faceswap) - [Get Task](https://piapi.ai/docs/faceswap-api/get-task) - TTS - [Zeroshot Text-to-Speech F5-TTS](https://piapi.ai/docs/tts-api/f5-tts) - [Get Task](https://piapi.ai/docs/tts-get-task) - Trellis - [Create Task](https://piapi.ai/docs/trellis-api/create-task) - [Get Task](https://piapi.ai/docs/trellis-api/get-task) - Luma Dream Machine - [Cancel Task](https://piapi.ai/docs/gpts-gizmo-name) - [Cancel Tasks](https://piapi.ai/docs/dream-machine/cancel-tasks) - [Cancel Task](https://piapi.ai/docs/dream-machine/cancel-task) - [Create Task](https://piapi.ai/docs/dream-machine/create-task) - [Get Task](https://piapi.ai/docs/dream-machine/get-task) - WanX - [Generate WanX Task with LoRA Using PiAPI](https://piapi.ai/docs/wanx_lora/tutorial) - [Available LoRA Types for Wanx](https://piapi.ai/docs/wanx-lora-type) - [Use Cases for Wanx LoRA](https://piapi.ai/docs/wanx-lora/use-case) - [Use Cases for Wanx Control Camera](https://piapi.ai/docs/wanx-api/camera-control) - [Create Task](https://piapi.ai/docs/wanx-api/create-task) - [Get Task](https://piapi.ai/docs/wanx-api/get-task) - Skyreels - [Create Task](https://piapi.ai/docs/skyreels-api/create-task) - [Get Task](https://piapi.ai/docs/skyreels-api/get-task) - Framepack - [Create Task](https://piapi.ai/docs/framepack-api/create-task) - [Get Task](https://piapi.ai/docs/framepack-api/get-task) - Hunyuan Video - [How to Make a Hunyuan API Call](https://piapi.ai/docs/hunyuan-api-doc) - [Get Task](https://piapi.ai/docs/hunyuan-api/get-task) - [Generate Video](https://piapi.ai/docs/hunyuan-video/txt2video-api) - Mmaudio - [Get Task](https://piapi.ai/docs/mmaudio-api/get-task) - [Generate Audio](https://piapi.ai/docs/mmaudio-api/create-task) - DiffRhythm - [Generate Audio](https://piapi.ai/docs/diffrhythm-api/create-task) - [Get Task](https://piapi.ai/docs/diffrhythm/get-task) - Ace Step - [Create Task](https://piapi.ai/docs/gpts-gizmo-name) - [Text to Audio](https://piapi.ai/docs/ace-step-api/text-to-audio) - [Audio to Audio](https://piapi.ai/docs/ace-step-api/audio-to-audio) - [Audio Edit](https://piapi.ai/docs/ace-step-api/audio-edit) - [Audio Extend](https://piapi.ai/docs/ace-step-api/audio-extend) - [Get Task](https://piapi.ai/docs/ace-step-api/get-task) - Joycaption - [Image Caption](https://piapi.ai/docs/joycaption-api/create-task) - [Get Task](https://piapi.ai/docs/joycaption/get-task) - Tools - [File Upload API](https://piapi.ai/docs/tools/file-upload) - [Video Upscale](https://piapi.ai/docs/tools/video-upscale-api) - [Video Upscale-Get Task](https://piapi.ai/docs/video-upscale/get-scale) - [Remove Background API](https://piapi.ai/docs/image-editing-api/remove-background-api) - [Remove Background-Get Task](https://piapi.ai/docs/remove-background/get-task) - [Segment With Prompt API](https://piapi.ai/docs/image-editing-api/segment-with-prompt-api) - [Segment With Prompt API-Get Task](https://piapi.ai/docs/segment-with-prompt/get-task) - [Image Upscale(Super Resolution) API](https://piapi.ai/docs/image-editing-api/super-resolution-api) - [Image Upscale-Get Task](https://piapi.ai/docs/image-upscale/get-task) - PiAPI Account Management - [PiAPI Account Info](https://piapi.ai/docs/account-info-api) - [Task List Info](https://piapi.ai/docs/task-list-api) - [User Task History](https://piapi.ai/docs/piapi-user-history-query) - Resources - [Change Log](https://piapi.ai/docs/changelog "Change Log") - [Output Storage](https://piapi.ai/docs/output-storage "Output Storage") - [Unified API Schema](https://piapi.ai/docs/unified-api-schema "Unified API Schema") - [Webhook](https://piapi.ai/docs/unified-webhook "Webhook") - [Bulk Generation Service](https://piapi.ai/docs/bulk-generation "Bulk Generation Service") - [Billings](https://piapi.ai/docs/billings "Billings") - [PiAPI MCP Server](https://piapi.ai/docs/mcp-server "PiAPI MCP Server") - Workspace Manual - [Host-your-account (HYA) \| Back-up Account](https://piapi.ai/docs/hya-backup-account) - [Host-your-account (HYA) \| Debug Checklist](https://piapi.ai/docs/hya-debug-checklist) - [Host-your-account (HYA) \| Connected Account Status](https://piapi.ai/docs/hya-connected-account-status) - Announcements - [PiAPI 2025 January 1st Pricing Update](https://piapi.ai/docs/announcements/2025-jan-pricing-update) - Legacy Documentation - [Face Swap](https://piapi.ai/docs/gpts-gizmo-name) - [Video Faceswap](https://piapi.ai/docs/legacy/faceswap-api/faceswap) - [Multi-face-swap](https://piapi.ai/docs/15210914e0) - [Fetch](https://piapi.ai/docs/faceswap-api/fetch) - [Dream Machine](https://piapi.ai/docs/gpts-gizmo-name) - [Video Generation](https://piapi.ai/docs/legacy/dream-machine/video-creation) - [Video Extend](https://piapi.ai/docs/legacy/dream-machine/video-extend) - [Get Video Generation](https://piapi.ai/docs/legacy/dream-machine/get-video) - [Kling](https://piapi.ai/docs/gpts-gizmo-name) - [Video Generation](https://piapi.ai/docs/legacy/kling-api/video-generation) - [Video Extend](https://piapi.ai/docs/legacy/kling-api/video-extend) - [Get Video Generation](https://piapi.ai/docs/kling-api/get-video) 404 Page not found Reload