# piapi.ai/full llms-full.txt ## Overview ### What is PiAPI? [\\#](\\#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 [\\#](\\#key-features) [![](https://cdn.sanity.io/images/pr53lcef/production/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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 ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/d0d4f0a35b6157f9465da531df3eb70a568334ff-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/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](/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)](/blogs/openai-realtime-api-vs-moshi-api) ### [OpenAI's Realtime API (powering ChatGPT Advanced Voice Mode) vs Moshi API](/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)](/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)!](/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)](/blogs/crush-it-melt-it-through-pika-api-kling-api-and-luma-api) ### [Crush it Melt it through Pika API , Kling API & Luma API](/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)](/blogs/the-motion-brush-feature-through-kling-api) ### [The Motion Brush Feature through Kling API](/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 [![](https://cdn.sanity.io/images/pr53lcef/production/9687c49e8140700e93fb4148fa96e3f92e4c9b58-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/using-kling-api-and-midjourney-api-to-create-an-animated-custom-wallpaper) ### [Using Kling API & Midjourney API to Create an Animated Custom Wallpaper](/blogs/using-kling-api-and-midjourney-api-to-create-an-animated-custom-wallpaper) September 23, 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/9fa45eb1459d1ff78f831502395866eca480c94f-2560x1440.png?rect=0,80,2560,1280&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-5-vs-1-0-a-comparison-through-kling-api) ### [Kling 1.5 vs 1.0 - A Comparison through Kling API](/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 [![](https://cdn.sanity.io/images/pr53lcef/production/a02a61525e85f308c20fec69ec9cce6045436290-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/luma-api-and-midjourney-api-exploring-the-marvel-multiverse) ### [Luma API & Midjourney API - Exploring the Marvel Multiverse](/blogs/luma-api-and-midjourney-api-exploring-the-marvel-multiverse) September 14, 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/c46e57d4498c007b1585344d72b55611732b8f11-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/midjourney-api-auto-captcha-solver) ### [Midjourney API's Auto-CAPTCHA-Solver](/blogs/midjourney-api-auto-captcha-solver) September 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/382f82204c3877ae7623ec4477ba33e51af0178f-821x1082.png?rect=149,0,524,262&w=2000&h=1000&fit=max&auto=format)](/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!](/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)](/blogs/luma-dream-machine-vs-kling-a-brief-comparsion-using-apis) ### [Luma Dream Machine vs Kling - A brief comparsion using APIs](/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)](/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](/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 [![](https://cdn.sanity.io/images/pr53lcef/production/40e5e0450323cd2fca0e988fe0d78d266cdaed59-1024x1024.webp?rect=0,256,1024,512&w=2000&h=1000&fit=max&auto=format)](/blogs/midjourey-v6-1-through-midjourney-api) ### [Midjourey V6.1 through Midjourney API](/blogs/midjourey-v6-1-through-midjourney-api) July 31, 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/cd4aa13c5c06962cf2eedf50dc3449037fcd416e-3468x2443.png?rect=0,355,3468,1734&w=2000&h=1000&fit=max&auto=format)](/blogs/access-suno-v3-5-through-piapi-suno-api) ### [Access Suno v3.5 through PiAPI's Suno API!](/blogs/access-suno-v3-5-through-piapi-suno-api) May 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/3f2a1594127ac8ccffb6c5991a2652fbc72fb765-1184x544.webp?rect=48,0,1088,544&w=2000&h=1000&fit=max&auto=format)](/blogs/how-to-integrate-midjourney-api-into-zapier) ### [How to integrate Midjourney API into Zapier](/blogs/how-to-integrate-midjourney-api-into-zapier) 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 [![](https://cdn.sanity.io/images/pr53lcef/production/f382de12e5ee4832004145703a7e0c08dd589b29-1919x783.png?rect=155,0,1566,783&w=2000&h=1000&fit=max&auto=format)](/blogs/how-to-use-faceswap-api-from-piapi-with-postman) ### [How to use Faceswap API from PiAPI with Postman](/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# 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](/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.01/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](/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](images/faceswap/How_to_use_FaceswapAPI_in_Postman_blog_Banner.webp) Faceswap API ### [How to use Faceswap API from PiAPI with Postman](/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 [contact@piapi.ai](mailto:contact@piapi.ai)\\- we'd love to listen to your feedback and explore potential collaborations!# Convert text prompts to music withSuno API! Our unofficial Suno API is built for developers to integrate the text-to-music generation capability of Suno into their AI applications! Thus enabling users worldwide to unleash their creativity in music creation! [Get started](https://piapi.ai/docs/music-api/create-task) [Documentation](https://piapi.ai/docs/music-api/create-task) [Join Discord](https://discord.gg/qRRvcGa7Wb) ## Features Integration Ready for V3 [Suno's V3 model](https://suno.com/blog/v3) is known to create radio-quality, two-minute long music in seconds! Try it out through our API! Infinite Music Creation! With superior audio quality, a wealth of different styles and genres, improved adherence to prompts and better music endings! Asynchronous API Calls Our aysnc calls allows our user to submit tasks and have their program continues on, until a \"callback\" function is executed. Suno Lyrics Generation Based on ChatGPT and a custom template, [this feature](https://www.suno.wiki/faq/getting-started/custom-mode-how-do-i-write-lyrics/) usually outputs 2 verse and 1 chorus. Now your users can try it through our API. \"Continue From This Clip\" feature supported! Want to extend your songs longer than the usual 1 minute? Your users can use this endpoint to add additional segments (60s each)! Comprehensive Access to Superior API Features With either usage options, you will get full access to the complete features of our Suno API, to be readily integrated into your apps! 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! \"Get the whole song\" feature supported! Does your users create multiple segments of a song and want to stitch them together? Now they can do so simply with this API! Pay-as-you-go and Host-your-account We offer two ways of using our API, host-your-own-Suno-account if you have your own, or just purchase PiAPI credits with pay-as-you-go (using our Suno accounts)! Bulk generation available Have a large amount of music generation tasks you are looking to complete? Either for populating your own website or curating your own audio dataset? Get in contact with us and we got you covered! ## Two Options to Get Started - Step 1: Sign up with PiAPI - Step 2: Subscribe to seat(s) - Step 3: Connect your own Suno account to the seat - Step 4: Start integration! - Step 1: Sign up with PiAPI - Step 2: Purchase Credits - Step 3: Start integration! ### 1\\. \"Host-your-account\" Option ### 2\\. \"Pay-as-you-go\" Option Have your own Suno account and don’t want to use shared accounts pool? Feel the waiting time is too long for using shared accounts? With our \"Host-your-account\" service, we can host your Suno accounts and provide stable API service from them! Don’t want to spend the time and energy buying and operating your own Suno accounts? Afraid of getting your own Suno accounts banned? Our \"Pay-as-you-go\" service perfectly suits your needs! Just sign-up, purchase credits and integrate our API right away! You will be using our own Suno account pools, so you don’t have to worry about their operation at all! ## Our Pricing Plans ## \"Pay-as-you-go\" Option ### Generation API Call $0.02/call ### Continuation API Call $0.04/call ### Lyrics Generation Free/call ## \"Host-your-account\" Option ### Flat Pricing #### What’s included - Connect your own Suno account - Access to all PiAPI Suno API endpoints - Hosting multiple accounts supported - Built-in Load Balancer for multiple accounts Simple and Easy $5/seat/month ## Check our Pricing page for more information [Detailed Suno Pricing](/pricing) [Get Started](https://piapi.ai/workspace/) ## Testimonials > “You made someone really happy today! (referring to the launch of the streaming-creation mode feature, helping to reduce wait time for the end users by providing partially created tracks for the users to listen to while waiting for the whole song).” infiniteDss > “The async design of the API is pretty easy to use, integrating was quite pain-free. Thank you for supporting V3 after it was released and appreciate the quick response time!” Leslie > “Get-the-full-song feature is great! I don‘t need to stitch different segments up myself! I love your API!” Sayine > “Thanks to the music generation API, we are able to save time in developing our website! Especially the lyrics generation endpoints, which are being called a lot.” Lindsay > “Great, thanks a lot for the \"Host-your-account\" option for Suno!” Anton > “Thank you for the quick responses and speedy fixes. Your support is AMAZING!!!” Mamo232 > “Haha love the \"Pay-as-you-go\" service! I don‘t have to manage my own Suno accounts pool! It really saves a lot of time!” Charles > “Able to host multiple accounts with the Suno API is great for our operation!” K. Tim > “Finding an API that easily integrates Suno into my app was pretty difficult until i found this one! Now, my users are using this API every day!” Carlos ## Our blog Check out our blog for related contents! ![An image of Suno v3.5 update](images/suno/Suno_v3.5_blog_banner.webp) Suno API ### [Access Suno v3.5 through PiAPI‘s Suno API!](/blogs/access-suno-v3-5-through-piapi-suno-api) Interested in trying out the new Suno v3.5 model? Check out this tutorial! ## Frequently asked questions What is Suno API? [Suno](https://suno.com/) is an advanced text-to-music model created by the Suno team based in Cambridge, MA. Suno does not provide an API service to their users, so PiAPI has created the unofficial Suno API for developers worldwide to embed the music-creation capability of Suno into their own apps! Who is the intended users for the Suno API? Our API is designed to serve a wide range of users including the follows: app developers who want to incorporate music generation functionality in their applications; musicians/content creators/filmmakers who are looking to generate a large amount of music based on textual prompts and require a programmatic way of doing so; and marketing teams/advertising agencies/education professional/students who need original, tailor-made music for campaigns or games, or who are just experimenting with music composition in general. What types of music can Suno API make? Suno can generate high-quality music of varying genres and styles, including symphony, rock, melody, minor, industrial metals, etc. And with Suno API, you can create as much music diversity as you could with Suno itself! What kind of prompts can I use with Suno API? You can be very creative with the prompts you use with Suno API, refer to [this](https://www.suno.wiki/faq/style-and-lyrics/styles-and-genres/) for a full list of genres available, refer to this [tutorial](https://www.suno.wiki/faq/getting-started/how-do-i-write-a-simple-prompt/) for how to write a prompt. Do take note that voice hallucinations (singing gibberish words) do happen and we encourage you try multiple times to get the best result! What is the Pricing for the API? For our \"Pay-as-you-go\" option, it costs $0.02 for each generation API call (which will generate two clips, and this is half of the price compared to the official Suno pricing), continue API call cost $0.04 each time, and lyrics generation is free. For our \"Host-your-account\" option, each seat costs $5/month/seat, and you can connect one of your own Suno accounts to each PiAPI Suno seat to be used an API. Note that the $5 monthly fee per seat does not include the cost of your Suno account(s). 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 documentation for details. Do you offer bulk generation for Suno Music? Yes we do, if you are looking to create a large amount of music from text prompts non-real-time, please get in contact with us and we can provide that custom solution for you. What is the \"Get the Whole Song\" feature? If your users have extended their music piece with more segments and would like to combine them into a single song, this endpoint is for them! Can I use the music from the API commercially? We don‘t recommend you commercially using the music created from our Suno API if you are on the \"Pay-as-you-go\" service. If you are using our \"Host-your-acount\" service, please refer to Suno‘s commerical use policy and your Suno account type to make your decision. 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 Suno API (specifically the \"Pay-as-you-go\" service) before making payments! How can I get in touch with your team? Please email us at [contact@piapi.ai](mailto:contact@piapi.ai)\\- we'd love to listen to your feedback and explore potential collaborations!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](#join) [Check out our other APIs!](/) ![A image of Moshi AI chat screenshot](/images/moshi/moshi-hero-image.webp) ## Get notified when our Moshi APIis ready! Email addressJoin the waitlist! ![A screenshot of Moshi API](/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 [contact@piapi.ai](mailto:contact@piapi.ai) ## Our blog Check out our blog for related contents! ![An image of Luma Dream Machine vs Kling](images/moshi/realtime_vs_moshi.webp) Moshi API ### [OpenAI's Realtime API (powering ChatGPT Advanced Voice Mode) vs Moshi API](/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! [![An image of a futuristic jet generated by PiAPI's Midjourney API](/images/Lumalab/Lumalab_otherAPIs_midjourney_image_white.webp)](/midjourney-api) ### [Midjourney API](/midjourney-api) We provide the most stable and cost effective (unofficial) Midjourney API on the market, supporting two usage mode (you can host your own Midjourney account, or use our Midjourney accounts and pay-as-you-go). With fast response time and high number of concurrent jobs, our Midjourney API is a favourite among developers worldwide! [![A face swapped image from PiAPI's Faceswap API](/images/Lumalab/Faceswap_banner.webp)](/faceswap-api) ### [Faceswap API](/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! [![A image of a sound wave illustrating PiAPI's Suno API](/images/Lumalab/Suno_banner.webp)](/suno-api) ### [Suno API](/suno-api) Also check out our unofficial Suno API - the API to the best text-to-music generation model out there! Our API is compatible with V3, supports lyrics generation and high concurrency. With the “continue feature” and both “pay-as-you-go” and “host-your-account” options, it’s designed to meet the development needs of creators and builders worldwide. ## 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!Login / Sign up # Kling Playground Overview Run API Task History API Settings Create Task: Text-to-Video MODELKling This endpoint from PiAPI's Kling API utilizes Kling AI model by Kuaishou to produce text/image-to-video generation. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string A description that enables Kling API to generate a video. negative promptstring Negative prompt of your video, can be empty. durationnumber 5s10s Duration of the generated video. Can only be 5s or 10s. Default value: 5 (duration can only be 5s in the playground) aspect\\_ratio\\*number 16:99:161:1 Aspect ratio of the video. creativitystring A number between 0 to 1, the lower the more creative. professional\\_modeboolean offon Advanced feature only available for paid Kling plan. In professional mode, the generated videos will have more details and better image quality. Default value: False (professional mode cannot be turned on in the playground) Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task This endpoint retrieves the output of the Kling’s video generation task. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization. # Kling Playground Overview Run API Task History API Settings Create Task: Text-to-Video MODELKling This endpoint from PiAPI's Kling API utilizes Kling AI model by Kuaishou to produce text/image-to-video generation. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string A description that enables Kling API to generate a video. negative promptstring Negative prompt of your video, can be empty. durationnumber 5s10s Duration of the generated video. Can only be 5s or 10s. Default value: 5 (duration can only be 5s in the playground) aspect\\_ratio\\*number 16:99:161:1 Aspect ratio of the video. creativitystring A number between 0 to 1, the lower the more creative. professional\\_modeboolean offon Advanced feature only available for paid Kling plan. In professional mode, the generated videos will have more details and better image quality. Default value: False (professional mode cannot be turned on in the playground) Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task This endpoint retrieves the output of the Kling’s video generation task. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization.Login / Sign up # Faceswap Playground Overview Run API Task History Create Task: face-swap MODELQubico/image-toolkit piapi’s Faceswap API is based on a custom AI model, which allows users to seamlessly swap one face with another. Header X-API-KEY\\*string Your default API Key used for request authorization. Body target image\\*string Choose a file File size must not exceed 2MB. 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 Choose a file File size must not exceed 2MB. 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. Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization. # Faceswap Playground Overview Run API Task History Create Task: face-swap MODELQubico/image-toolkit piapi’s Faceswap API is based on a custom AI model, which allows users to seamlessly swap one face with another. Header X-API-KEY\\*string Your default API Key used for request authorization. Body target image\\*string Choose a file File size must not exceed 2MB. 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 Choose a file File size must not exceed 2MB. 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. Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization.# Create your text-to-image apps withMidjourney API Integrate our unofficial Midjourney API to build your AI image applications - providing your users with infinite possibilities generating images from text inputs. [Get Started!](https://piapi.ai/workspace/midjourney) [API Docs](https://piapi.ai/docs/midjourney-api/imagine) [Join Discord](https://discord.gg/qRRvcGa7Wb) ## Features ![An image icon for one of Midjourney API's feature: Built-in Load Balancer](/images/midjourney/built_in_load_balancer.webp) Built-in Load Balancer ![An image icon for one of Midjourney API's features: Connect Multiple Accounts](/images/midjourney/connect_multiple_accounts.webp) Connect Multiple Accounts ![An image icon for one of Midjourney API's feature: Complete access to all endpoints ](/images/midjourney/complete_access_to_all_endpoints.webp) Complete access to all endpoints ![An image icon for one of Midjourney API's features: Workspace and Webhook ](/images/midjourney/workspace_and_webhook.webp) Workspace and Webhook ![An image icon for one of Midjourney API's features: Supports V6, sref and cref](/images/midjourney/supports_v6_sref_and_cref.webp) Supports V6, V6.1, sref and cref ![An image icon for one of Midjourney API's features: Midjourney Subscription Excluded ](/images/midjourney/midjourney_subscription_excluded.webp) Midjourney Subscription Excluded ## Supported Operations Imagine A single prompt generating 4 images in 2x2 grid Upscale Enhance the image quality with Midjourney’s upscaler Variation Create variants of the selected image Describe Provide descriptive texts for the image submitted Blend Combine two images into a new and original image Inpaint Change parts of the submitted image Zoom Extend the selected image beyond original boundary Pan Expand the image towards a chosen direction --sref Preserve consistency through style reference --cref Create images of the same character in different scenes ## Supported Modes ![An image displaying supported processing modes for the Midjourney API, including Relax Mode, Fast Mode and Turbo Mode](/images/midjourney/piapi_midjourney_supported_modes_graphic.webp) ## Two Ways Of Using The API: Host-Your-Account Service Step 1: Sign up with PiAPI Step 2: Subscribe to seat(s) (Each seat can host 1 Midjourney account) Step 3: Connect your own Midjourney account to the seat Step 4: Start integration! Have your own Midjourney account and don’t want to use shared accounts pool? With our Host-Your-Account service, we can host your Midjourney Accounts and provide stable API service from them! Want to try out our API? Sign up for our workspace! [Sign up](https://piapi.ai/workspace/midjourney) Pay-as-you-go Service Step 1: Sign up with PiAPI Step 2: Purchase credits Step 3: Start integration! Don't want to spend the time and energy buying and maintaining your own Midjourney Accounts? Afraid of getting your own Midjourney accounts banned? Our Pay-as-you-go service perfectly suits your needs! All you need to do is sign-up, purchase credits and you can then use our API right way! The service uses PiAPI’s Midjourney account pools, so you don’t have to worry about their operation at all! Want to try out our API? Sign up for our workspace! [Sign up](https://piapi.ai/workspace/midjourney) ## Our Pricing Plans ### Pay-as-you-go Option Relax Mode $0.015 per imagine task Fast Mode $0.045 per imagine task Turbo Mode $0.10 per imagine task ### Host-your-account Option Flat Pricing $8 /seat/month Connect your own Midjourney account Access to all PiAPI endpoints Access to all PiAPI functions [Check our Pricing page \\\\ \\\\ for more information](/pricing) [Get free credits by \\\\ \\\\ signing up for our Workspace!](https://piapi.ai/workspace/midjourney) ## Testimonials > “The built-in load balancer has transformed our workflow. It adeptly manages traffic distribution, ensuring consistent performance, no matter the workload. We‘ve seen a significant improvement in our application efficiency.” TechOracle > “Your workspace and webhook feature is a lifesaver for our team! It helps us reduce our development time and increased productivity.” Priya > “Our social media application has been transformed thanks to your API. It helped us to generate very nice images just from text inputs. Our user engagement went up a lot!” RadialRay > “Thanks! your API allows me to Connect Multiple Accounts effortlessly - it saves me so much time when working on many domains.” Alice B. > “With Excluded Midjourney Subscription, it is so much easier to scale our services without the burden of extra costs. It‘s a huge plus!” Tim Nguyen > “Your API is just what I need! This has taken our app to a whole new level. Keep it up!” Imara > “I’m working on a creative project, and your API has been a game-changer. Thank you for developing this and continue to add more APIs!” Rodriguez > “I have used various AI tools, but the diversity of your API is second to none. Your fast mode is amazing! Appreciate the service!” Mengyao > “Our apps have become so much more seamless because of your API. You’ve literally transformed how we work. Thank you!” Morris ## Our blog Check out our blog for related contents! ![An image of Kling And MJ](images/kling/kling_and_mj.webp) Midjourney API ### [Using Kling API & Midjourney API to Create an Animated Custom Wallpaper](/blogs/using-kling-api-and-midjourney-api-to-create-an-animated-custom-wallpaper) Using Kling API and Midjourney API to create visually stunning wallpapers! For example an anime wallpaper, a wallpaper of the character Yoshii Toragana from Shogun, and a Warhammer 40k Wallpaper. ![An image of Luma API & Midjourney API - Exploring the Marvel Multiverse](images/midjourney/exploring-the-marvel-multiverse.webp) Midjourney API ### [Luma API & Midjourney API - Exploring the Marvel Multiverse](/blogs/luma-api-and-midjourney-api-exploring-the-marvel-multiverse) Using Dream Machine API and Midjourney API we explored what famous marvel characters would look like if they were played by different actors. Such as a Tom Cruise Iron Man, Henry Cavill Wolverine, and finally RDJ Doom! ![An image of API's Auto-CAPTCHA-Solver](images/midjourney/auto_captcha_blog.webp) Midjourney API ### [Midjourney API's Auto-CAPTCHA-Solver](/blogs/midjourney-api-auto-captcha-solver) Tired of Midjourney's CAPTCHAs? Discover how PiAPI's Auto-CAPTCHA-Solver can help. Check out this blog to learn how to use it! ![An image of V6.1 Midjourney Model](images/midjourney/v6.1_blog.webp) Midjourney API ### [Midjourney V6.1 through Midjourney API](/blogs/midjourey-v6-1-through-midjourney-api) Excited to integrate the newest V6.1 Midjourney Model into your application? Want to see the difference in quality between V6.1 and V6? Check out this blog! ![An image of PiAPI's logo with Zapier's logo](images/midjourney/PiAPIxZapier_blog_banner.webp) Midjourney API ### [How to integrate Midjourney API into Zapier](/blogs/how-to-integrate-midjourney-api-into-zapier) Want to integrate Zapier‘s automation workflow with Midjourney‘s generation capabilities? Check out this tutorial! ## Frequently asked questions What is PiPAI's Midjourney API? [Midjourney](https://www.midjourney.com/home) provides one of the best text-to-image generative AI model in the market, used by graphics designers, photographers, and everyone who are looking to unleash their creativity through AI images. Midjourney does not provide API right now to its users so PiAPI created the unofficial Midjourney API for developers to integrate the SOTA (state-of-the-art) txt2img model into their own generative AI applications. Who is the intended user for the API? Because Midjourney is intended to be used by everyone, then all kinds of developers working on all kinds of apps are expected to benefit greatly from our Midjourney API! What is the difference between \"Host-your-account\" service vs. the \"Pay-as-you-go\" service? These are two different ways of using our API. The \"Host-your-account\" service will be using resources (i.e. fast hours) from your own Midjourney accounts, and you will need to subscribe seats from us to host your own accounts (one seat can be connected to one Midjourney account).The \"Pay-as-you-go\" service will be using our Midjourney accounts, thus you just need to sign up, purchase credits, and start using the API right away, without needing to buy your own Midjourney account. How to get started with integrating the API? After you have chosen the service options, 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? 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 the 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? Yes, all \"Pay-as-you-go\" users subscribed to free plan, creator plan, or pro plan will all have different number of concurrent jobs, please see our site for more details. \"Host-your-account\" users will be subject to the maximum number of concurrent jobs as per their own accounts pool. How does the API handle errors? Our documentation keeps track of a detailed list of errors that the API might return. You can reference it during the development process while building your applications! Can you provide bulk generation for Midjourney images? Yes absolutely, if you have a lot of prompts that need to be submitted to Midjourney, and if real-time is not of concern, then you can definitely contact us for a quote and an estimated delivery timeline. Is there customer support service for Midjourney API users? Yes, we provide customer support services for all our users, including detailed documentation, Discord customer service channel, and email for any collaboration or other inquiries. What is the pricing options for the API? For the \"Pay-as-you-go\" service option, you will have to pay for each endpoints you use, the detail pricing of each endpoint is on our website and documentation for your reference. For \"Host-your-account\" service option, you will only need to pay for your seats‘ subscription, since the Midjourney accounts are bought and operated by you. 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‘s Workspace, you are given free credits to try our Midjourney API (specifically the \"Pay-as-you-go\" service) before making payments! How can I get in touch with your team? Please email us at [contact@piapi.ai](mailto:contact@piapi.ai)\\- we'd love to listen to your feedback and explore potential collaborations!# Leverage ourAI APIsfor your AI application developments! Integrate our generative AI APIs and transform text into captivating visuals, prompts into impressive music, and perform seamless face swaps! [To Midjourney](/midjourney-api) [To Trellis 3D](/trellis-3d-api) [To Dream Machine](/dream-machine-api) [To Faceswap](/faceswap-api) [To Flux](/flux-api) [To Kling](/kling-api) ## Ignite your generative AI capabilities Midjourney API (unofficial) Dive into the next-gen image generative paradigm with Midjourney API! Easily integrated into your development process, allowing your users to easily create creative visual content faster using our unofficial Midjourney API. ![An image of a landscape with tall mountains. River water flowing in, calm and breezy wind blowing into the forest with a bright sunset sky generated by Midjourney API](/images/homepage/a_landscape_generated_by_Midjourney_API.webp) A landscape with tall mountains. River water flowing in, calm and breezy wind blowing into the forest with a bright sunset sky 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](/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 Suno API (unofficial) Embrace the Future of Music with Suno API Generate astounding music from any textual prompt. Our unofficial Suno API propels your applications into a future with limitless creative possibilities. ```python payload = json.dumps({ \"custom_mode\": False, \"input\": { \"prompt\": \"a song about spending a hot summer day onthe beach and drinking champagne\", #your simple prompt \"make_instrumental\": False } }) 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](/images/homepage/original_leonardo_dicaprio.webp) Suno API (unofficial) Embrace the Future of Music with Suno API Generate astounding music from any textual prompt. Our unofficial Suno API propels your applications into a future with limitless creative possibilities. ```python payload = json.dumps({ \"custom_mode\": False, \"input\": { \"prompt\": \"a song about spending a hot summer day onthe beach and drinking champagne\", #your simple prompt \"make_instrumental\": False } }) 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](/images/homepage/original_leonardo_dicaprio.webp) Midjourney API (unofficial) Dive into the next-gen image generative paradigm with Midjourney API! Easily integrated into your development process, allowing your users to easily create creative visual content faster using our unofficial Midjourney API. ![An image of a landscape with tall mountains. River water flowing in, calm and breezy wind blowing into the forest with a bright sunset sky generated by Midjourney API](/images/homepage/a_landscape_generated_by_Midjourney_API.webp) A landscape with tall mountains. River water flowing in, calm and breezy wind blowing into the forest with a bright sunset sky 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](/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 Suno API (unofficial) Embrace the Future of Music with Suno API Generate astounding music from any textual prompt. Our unofficial Suno API propels your applications into a future with limitless creative possibilities. ```python payload = json.dumps({ \"custom_mode\": False, \"input\": { \"prompt\": \"a song about spending a hot summer day onthe beach and drinking champagne\", #your simple prompt \"make_instrumental\": False } }) 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 [Midjourney API](/midjourney-api) Text-to-Image Transform texts into captivating visuals with our unofficial Midjourney API. [Suno API](/suno-api) Text-to-Music Convert texts into stunning music with our unofficial Suno API. [Faceswap API](/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](/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](/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 Midjourney (unofficial), Suno (unofficial), 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 contact@piapi.ai! (Note: all support emails will not be answered!) [Email us!](mailto:contact@piapi.ai)# PiAPI Pricing API ServiceSubscription Plan PIAPI offers two API access methods: Pay-as-you-go (PAYG) and Host-your-account (HYA) . Pay-as-you-go (PAYG) - Users leverage PIAPI’s self-managed account pool. - No need to own an account for the corresponding platform. - Charges are based on API call frequency and task type. - Ideal for users seeking flexibility and access to multiple APIs without long-term commitments. Host-your-account (HYA) - Users link their own platform accounts to PIAPI. - A fixed monthly account seat subscription fee applies for using HYA, with no additional charges during API usage. - Best for users who prioritize stability and already have platform accounts. Important Notes: - API call fees (for PAYG and HYA) and subscription plans are separate charges. - Not all APIs support both access methods. For details, please refer to the table below. ## Pricing Plans ### [Midjourney API](https://piapi.ai/midjourney-api) Host-your-account (HYA) $8/seat/month Pay-as-you-go (PAYG) Task Type Relax Mode (V5.2 & below) Fast Mode (V5.2 & below) Turbo Mode (V5.2 & below) Relax Mode (V6) Fast Mode (V6) Turbo Mode (V6) imagine $0.015 $0.045 $0.1 $0.03 $0.07 $0.14 Variation $0.01 $0.01 $0.01 $0.01 $0.01 $0.01 Pan $0.01 $0.01 $0.01 $0.01 $0.01 $0.01 OutPaint $0.01 $0.01 $0.01 $0.01 $0.01 $0.01 Inpaint $0.01 $0.01 $0.01 $0.01 $0.01 $0.01 Blend $0.01 $0.01 $0.01 $0.01 $0.01 $0.01 Reroll $0.01 $0.01 $0.01 $0.01 $0.01 $0.01 Describe $0.005 $0.005 $0.005 $0.005 $0.005 $0.005 Upscale (U1/2/3/4) $0.005 $0.005 $0.005 $0.005 $0.005 $0.005 ### [Kling API](https://piapi.ai/kling-api) Host-your-account (HYA) $10/seat/month Pay-as-you-go (PAYG) Task Type Video Generation (STD-5s) $0.13 Video Generation (STD-10s) $0.26 Video Generation (PRO-5s) $0.46 Video Generation (PRO-10s) $0.92 Lip Sync $0.1 Virtual Try-on $0.07/ image generated ### [Luma API](https://piapi.ai/dream-machine-api) Host-your-account (HYA) $10/seat/month Pay-as-you-go (PAYG) Task Type Video Generation $0.3 ### [Flux API](https://piapi.ai/flux-api) Pay-as-you-go (PAYG) Task Type Qubico/flux1-schnell Qubico/flux1-dev Qubico/flux1-dev-advanced Need Creator or higher subscription plan Text to Image $0.002 $0.015 / Image to Image $0.002 $0.015 / Text to Image - Lora / / $0.02 Image to Image - Lora / / $0.02 Redux variation / / $0.02 Fill-inpaint / / $0.02 Fill-outpaint / / $0.02 Controlnet / / $0.02 ### [Trellis 3D API](https://piapi.ai/trellis-3d-api) Pay-as-you-go (PAYG) Image to 3D $0.04 ### [Faceswap API](https://piapi.ai/faceswap-api) Pay-as-you-go (PAYG) Image Generation $0.01 ### [AI Hug API](https://piapi.ai/docs/ai-hug-api/create-task) Pay-as-you-go (PAYG) Video Generation $0.2 ### [LLM API](https://piapi.ai/docs/llm-api/completions) Pay-as-you-go (PAYG) - Based on Token Consumption gpt-4o-mini input 1M tokens = $0.1125 output 1M tokens = $0.45 gpt-4o input 1M tokens = $1.875 output 1M tokens = $7.5 Need Creator or higher subscription plan o1-mini input 1M tokens = $2.25 output 1M tokens = $9 Need Creator or higher subscription plan o1-preview input 1M tokens = $11.25 output 1M tokens = $45 Need Creator or higher subscription plan claude-3-5-haiku-20241022 input 1M tokens = $0.75 output 1M tokens = $3.75 Need Creator or higher subscription plan claude-3-5-sonnet-20240620 or claude-3-5-sonnet-20241022 input 1M tokens = $2.25 output 1M tokens = $11.25 Need Creator or higher subscription plan gpt-4-gizmo-\\*(gpts) input 1M tokens = $2.5 output 1M tokens = $10 Each completion call of this model has a $0.00005 minimum charge Need Creator or higher subscription plan ## 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?# 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) [API docs →](https://piapi.ai/docs) ![a picture of a Black Forest with the word Flux spelled out - generated by Flux-dev model](/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](/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! What type of images can I generate with FLUX.1 API? With the recent ELO score information for the FLUX-dev and FLUX-schnell model both exceeding than that of Midjourney, the possibility of using API for image generation is quite endless. It is expected that it would be significantly impacting industries ranging from entertainment, education, product design all the way to scientific visualization. Can I use videos 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 [contact@piapi.ai](mailto:contact@piapi.ai)\\- we'd love to talk more regarding our product offering!Previewing drafts. [Back to published](/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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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/f7a4c746682a67ba8a7d0de7133728f9088ddbcd-2400x1350.jpg?rect=0,75,2400,1200&w=2000&h=1000&fit=max&auto=format)](/blogs/openai-realtime-api-vs-moshi-api) ### [OpenAI's Realtime API (powering ChatGPT Advanced Voice Mode) vs Moshi API](/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) PiAPIPreviewing drafts. [Back to published](/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. Below is an image generated using [Midjourney API](https://piapi.ai/midjourney-api) of the Dallas Cowboy Wallpaper, which we'll use with a prompt to generate the videos for three workflows in this example. ![PNG image of a Dallas Cowboys player holding a football against a blue and black background, generated by Midjourney API](https://cdn.sanity.io/images/pr53lcef/production/34fb658f3028c0dd56527e68047d3d0c18c87f9d-224x400.png?q=75&fit=clip&auto=format)Prompt: \"A Dallas Cowboys NFL player in a blue background with paint effects moving, phone wallpaper, inspiring.\" 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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Blend `POST` https://api.piapi.ai/api/v1/task Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") merges two to five input images. This endpoint corresponds to the `Blend` command from the official Midjourney. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Body Params application/json Generate Code model enum required Allowed value: midjourney task\\_type enum required Allowed value: blend input object required image\\_urls array\\[string\\] required Provide two to five image URLs into this parameter >= 2 items<= 5 items process\\_mode enum optional This parameter indicates the operation process mode Allowed values: relaxfastturbo dimension enum optional This parameter sets the dimension field. Allowed values: squareportraitlandscape bot\\_id integer optional Only Host-Your-Account users on the Pro Plan can use this parameter. This parameter specifies which Midjourney account will process this task. config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```hljs hljs-json { \"model\": \"midjourney\", \"task_type\": \"blend\", \"input\": { \"image_urls\": [\\ \"https://aoyouer.com/posts/moyu-devlog-0/2022-11-24-00-59_hu3f1e0a40cb06392f97875a081976a63b_1192560_1600x0_resize_box_3.png\",\\ \"https://aoyouer.com/posts/hugo-with-codespace/2022-11-23%2013.34.47_hu1cc8e82c0c96924b0c8ea2f0980e2e30_140972_1600x0_resize_box_3.png\"\\ ], \"process_mode\": \"fast\", \"dimension\": \"\", \"bot_id\": 0 }, \"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 ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"42fc48d5-40ab-47e7-9b31-213dfcc075a3\", \"model\": \"midjourney\", \"task_type\": \"blend\", \"status\": \"pending\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"image_url\": \"\", \"image_urls\": null, \"temporary_image_urls\": null, \"discord_image_url\": \"\", \"actions\": [], \"progress\": 0, \"intermediate_image_urls\": null }, \"meta\": {}, \"detail\": null, \"logs\": [], \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: 2 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Create Task `POST`/api/v1/task Try it out ### Request Header Params Generate Code ### Request samples ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Get Task `GET` https://api.piapi.ai/api/v1/task/{task\\_id} Try it out 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 ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema 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 Copy ```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\" } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # LLM API \\| Basic Completions `POST` https://api.piapi.ai/v1/chat/completions Try it out INFO #### Discount [PiAPI](https://piapi.ai \"\") also provides different LLM API at cost effective pricing, sometimes at **25%~75%** of their official pricing. #### Availability Given the steep discount, we **sometimes face availability issues** thus we always recommend developers **to always have another back up API source ready** \\- take advantage of our low pricing when you can, and when availability becomes a problem switch to a higher cost solution to maintain overall system up-time. #### Using \"System\" 1. o1-preview & o1-mini does not support \"system\" role as part of the function call. | model name | pricing | Notes | | --- | --- | --- | | gpt-4o-mini | input 1M tokens = $0.1125
output 1M tokens = $0.45 | 75% of OpenAI's official pricing | | gpt-4o | input 1M tokens = $1.875
output 1M tokens = $7.5
Only for Creator Plan or Above | 75% of OpenAI's official pricing, as the original OpenAI's API model gpt-4o. | | o1-mini | input 1M tokens = $2.25
output 1M tokens = $9
Only for Creator Plan or Above | 75% of OpenAI's official pricing | | o1-preview | input 1M tokens = $11.25
output 1M tokens = $45
Only for Creator Plan or Above | 75% of OpenAI's official pricing | | claude-3-5-haiku-20241022 | input 1M tokens = $0.75
output 1M tokens = $3.75
Only for Creator Plan or Above | 75% of Anthropic's official pricing | | claude-3-5-sonnet-20240620 or claude-3-5-sonnet-20241022 | input 1M tokens = $2.25
output 1M tokens = $11.25
Only for Creator Plan or Above | 75% of Anthropic's official pricing | | gpt-4-gizmo-\\*(gpts) | input 1M tokens = $2.5
output 1M tokens = $10
each completion call of this model has a $0.005 minimum charge\\*
Only for Creator Plan or Above | equal to OpenAI gpt-4o price | Note: 1. OpenAI's input and output tokens, where 1k token roughly equals to 750 words. Thus 1 token roughly equates to 0.75 word. 2. The definition of minimum charge: if the actual token (input+output) usage for that particular completion is less than that value, we will round it that value. ### Request Header Params Generate Code Authorization string required Your API KEY for authorization Body Params application/json Generate Code model string required The name of the model to be used **How to get Gizmo model name**: Go to ChatGPT official website, explore the GPTs and enter chat with the GPT of your choice, you will see webpage address like [https://chatgpt.com/g/g-gFt1ghYJl-logo-creator](https://chatgpt.com/g/g-gFt1ghYJl-logo-creator \"\"). Then the model name you should use is gpt-4-gizmo-g-gFt1ghYJl. messages array\\[string\\] required A list of messages comprising the conversation so far functions array\\[string\\] optional A list of functions the model may generate JSON inputs for. function\\_call string optional Controls how the model calls functions. \"none\" means the model will not call a function and instead generates a message. \"auto\" means the model can pick between generating a message or calling a function. Specifying a particular function via {name:my\\_function} forces the model to call that function. \"none\" is the default when no functions are present. \"auto\" is the default if functions are present. temperature number optional Defaults to 1. What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. top\\_p number optional Defaults to 1. An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top\\_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. n integer optional Defaults to 1. How many chat completion choices to generate for each input message. stream boolean optional Defaults to false. If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data:\\[none\\] message stop string\\|array optional Defaults to null. Up to 4 sequences where the API will stop generating further tokens. max\\_tokens number optional Defaults to the maximum number of tokens to generate in the chat completion. presence\\_penalty number optional Defaults to 0. Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. frequency\\_penalty number optional Defaults to 0. Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. logit\\_bias string optional Defaults to null. Modify the likelihood of specified tokens appearing in the completion. Example Copy ```hljs hljs-json //Request Example - No Streaming curl https://api.piapi.ai/v1/chat/completions \\ -H \"Content-Type: application/json\" \\ -H \"Authorization: Bearer API_KEY\" \\ -d '{ \"model\": \"gpt-3.5-turbo\", \"messages\": [\\ {\\ \"role\": \"system\",\\ \"content\": \"You are a helpful assistant.\"\\ },\\ {\\ \"role\": \"user\",\\ \"content\": \"Hello!\"\\ }\\ ] }' //Request Example - Streaming curl https://api.piapi.ai/v1/chat/completions \\ -H \"Content-Type: application/json\" \\ -H \"Authorization: Bearer API_KEY\" \\ -d '{ \"model\": \"gpt-3.5-turbo\", \"messages\": [\\ {\\ \"role\": \"system\",\\ \"content\": \"You are a helpful assistant.\"\\ },\\ {\\ \"role\": \"user\",\\ \"content\": \"Hello!\"\\ }\\ ], \"stream\": true }' ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json Data Schema Generate Code id string required object string required created integer required model string required choices array \\[object {3}\\] required index integer optional message object optional finish\\_reason string optional usage object required prompt\\_tokens integer required completion\\_tokens integer required total\\_tokens integer required Example Success- No Streaming Copy ```hljs hljs-json { \"id\": \"chatcmpl-83jZ61GDHtdlsFUzXDbpGeoU193Mj\", \"object\": \"chat.completion\", \"created\": 1695900828, \"model\": \"gpt-3.5-turbo\", \"choices\": [\\ {\\ \"index\": 0,\\ \"message\": {\\ \"role\": \"assistant\",\\ \"content\": \"Hello! How can I assist you today?\"\\ },\\ \"finish_reason\": \"stop\"\\ }\\ ], \"usage\": { \"prompt_tokens\": 19, \"completion_tokens\": 9, \"total_tokens\": 28 } } ``` Last modified: a month agoLogin / Sign up # Midjourney Playground Overview Run API Task History API Settings Create Task: Text-to-Image MODELMidjourney The imagine endpoint generates up to 4 images from a text prompt. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string The prompt for image processing. Skip Prompt Checkboolean falsetrue Bypass internal prompt validation process. Default value: False (prompt check cannot be turned off in the playground) aspect\\_ratiostring Aspect ratio of the image. Default value: “1:1” process\\_modestring (valid values: relax/ fast/ turbo) Which mode to use for processing. Default value: relax (only fast mode is available in the playground) Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization. # Midjourney Playground Overview Run API Task History API Settings Create Task: Text-to-Image MODELMidjourney The imagine endpoint generates up to 4 images from a text prompt. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string The prompt for image processing. Skip Prompt Checkboolean falsetrue Bypass internal prompt validation process. Default value: False (prompt check cannot be turned off in the playground) aspect\\_ratiostring Aspect ratio of the image. Default value: “1:1” process\\_modestring (valid values: relax/ fast/ turbo) Which mode to use for processing. Default value: relax (only fast mode is available in the playground) Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization.![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # How To Find GPTs Gizmo Name? The [LLM API \\| Basic Completions](/docs/llm-api/completions \"\") From [PiAPI](https://piapi.ai \"\") enables users to automate interactions with various public ChatGPT's GPTs via the standard OpenAI Completions API. **Note that only public GPTs are supported by this endpoint, and file upload/download functionality or third-party authorization is not available.** ## Pricing [\\#](\\#pricing) The GPTS Gizmo API follows a token-based pricing model with minimal charges. For detailed pricing information, please refer to [LLM API \\| Basic Completions](/docs/llm-api/completions \"\"). ## How to Retrieve the Gizmo Model Name [\\#](\\#how-to-retrieve-the-gizmo-model-name) To obtain the Gizmo model name, visit the official ChatGPT website, browse through the available GPTs, and initiate a conversation with the GPT of your choice. The model name will appear in the webpage URL, for example: `https://chatgpt.com/g/g-gFt1ghYJl-logo-creator`. The model name to use would be `gpt-4-gizmo-g-gFt1ghYJl`. ## Request Example (cURL) [\\#](\\#request-example-curl) ```hljs hljs-bash curl --location --request POST 'https://api.piapi.ai/v1/chat/completions' --header 'Content-Type: application/json' --header 'Authorization: Bearer YOUR_API_KEY' --data-raw '{ \"model\": \"gpt-4-gizmo-g-pmuQfob8d\", \"messages\": [\\ {\\ \"role\": \"user\",\\ \"content\": \"red hair girl\"\\ }\\ ] }' ``` ## Response Example [\\#](\\#response-example) ```hljs hljs-json { \"choices\": [\\ {\\ \"finish_reason\": \"stop\",\\ \"index\": 0,\\ \"message\": {\\ \"content\": \"{\\ \"size\": \"1024x1024\",\\ \"prompt\": \"A girl with long, flowing red hair. Her vibrant red locks cascade down her back, with a few strands gently blowing in the wind. The background is simple, focusing on her radiant hair, and her expression is serene, highlighted by soft natural lighting.\",\\ \"image\": \"https://files.oaiusercontent.com/file-12345-4753-8ba0-8c24a9439564.webp\"\\ } Here is the image of a girl with long, flowing red hair. Let me know if you'd like to adjust any details!\",\\ \"role\": \"assistant\"\\ }\\ }\\ ], \"created\": 1726205460, \"id\": \"chatcmpl-1726205460587259321\", \"model\": \"gpt-4-gizmo-g-pmuQfob8d\", \"object\": \"chat.completion\", \"usage\": { \"completion_tokens\": 277, \"prompt_tokens\": 8, \"total_tokens\": 285 } } ``` Last modified: 3 months ago [Pricing](#pricing \"\") [How to Retrieve the Gizmo Model Name](#how-to-retrieve-the-gizmo-model-name \"\") [Request Example (cURL)](#request-example-curl \"\") [Response Example](#response-example \"\")![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Create Task `POST` https://api.piapi.ai/api/v1/task Try it out 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 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. ### 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](/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 Copy ```hljs hljs-json ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema 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 Copy ```hljs hljs-json ``` Last modified: 11 days ago# 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](/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](/pricing) [Get Started](https://piapi.ai/workspace/trellis) ## 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 [contact@piapi.ai](mailto:contact@piapi.ai)\\- we'd love to talk more regarding our product offering!Login / Sign up # Flux Playground Overview Run API Task History Create Task: Text-to-Image MODELQubico/flux1-schnell Flux.1 \\[schnell\\] is a fast and efficient text-to-image model for personal use, offering quick, high-quality outputs and easy access for developers. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string The prompt for image processing. widthinteger Width of the image. The unit of width measurement is \"px\" (pixel). Default value: 1024 heightinteger Height of the image. The unit of height measurement is \"px\" (pixel). Default value: 1024 Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization. # Flux Playground Overview Run API Task History Create Task: Text-to-Image MODELQubico/flux1-schnell Flux.1 \\[schnell\\] is a fast and efficient text-to-image model for personal use, offering quick, high-quality outputs and easy access for developers. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string The prompt for image processing. widthinteger Width of the image. The unit of width measurement is \"px\" (pixel). Default value: 1024 heightinteger Height of the image. The unit of height measurement is \"px\" (pixel). Default value: 1024 Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization.Login / Sign up # LLM Playground Overview Run API Task History ## What can I help with? Use the toolbar on the right to adjust settings and manage the results. Ask for information Solve a math problem Summarize an article Write an email Model gpt-4o-mini Parameters temperature top\\_p presence\\_penalty frequency\\_penalty max\\_tokens # LLM Playground Overview Run API Task History ## What can I help with? Use the toolbar on the right to adjust settings and manage the results. Ask for information Solve a math problem Summarize an article Write an email Model gpt-4o-mini Parameters temperature top\\_p presence\\_penalty frequency\\_penalty max\\_tokensPreviewing drafts. [Back to published](/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: - • [Midjourney API](https://piapi.ai/midjourney-api) - • [Faceswap API](https://piapi.ai/faceswap-api) - • [Suno API](https://piapi.ai/suno-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: - • Midjourney API: 30 concurrent jobs, task Logs that last 30 days, bot\\_id selection, intermediate image URLs, Auto-CAPTCHA solver - • Faceswap API: 200 calls / month for free - • Suno API: 30 concurrent jobs, free lyrics generation, upload audio, extend music - • 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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Text to Image `POST` https://api.piapi.ai/api/v1/task Try it out 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](/docs/flux-with-lora-and-controlnet \"\") to learn how to send Flux with LoRA and Controlnet task. Check [Flux with Redux and Fill](/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 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](/docs/flux-with-lora-and-controlnet \"\") control\\_net\\_settings array \\[object {2}\\] optional Check [Flux with LoRA and Controlnet](/docs/flux-with-lora-and-controlnet \"\") config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```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 ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema 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 Copy ```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\": \"\" } } } ``` Last modified: 25 days ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Outpaint `POST` https://api.piapi.ai/api/v1/task Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") extends the canvas of an upscaled image beyond the its original size while retaining the details of the original image. This endpoint corresponds to the `Zoom Out` tool from the official Midjourney. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Body Params application/json Generate Code model enum required Allowed value: midjourney task\\_type enum required Allowed value: outpaint input object required origin\\_task\\_id string required The task ID of the parent task. zoom\\_ratio string optional This parameter controls how much to zoom out on an image Valid values: For Midjourney Discord button \"zoom out 1.5x\" - use: 1.5 For Midjourney Discord button \"zoom out 2x\" - use: 2 For Midjourney Discord button \"custom zoom\" - use: (1, 2\\] For Midjourney Discord button \"make square\" - use: 1 prompt string optional This prompt for this operation. aspect\\_ratio string optional This parameter dictating the ouput image's aspect ratio value. Default: 1:1 skip\\_prompt\\_check boolean optional Use this parameter to skip our internal prompt check. Default: false config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```hljs hljs-json { \"model\": \"midjourney\", \"task_type\": \"outpaint\", \"input\": { \"origin_task_id\": \"741ca8f8-be31-45cd-a33f-c21b8bff8ad8\", \"zoom_ratio\": \"2\", \"prompt\": \"flying night city\", \"aspect_ratio\": \"16:9\", \"skip_prompt_check\": false }, \"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 ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"672eced8-11fc-4dad-830a-688a6bf91435\", \"model\": \"midjourney\", \"task_type\": \"outpaint\", \"status\": \"pending\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"image_url\": \"\", \"image_urls\": null, \"temporary_image_urls\": null, \"discord_image_url\": \"\", \"actions\": [], \"progress\": 0, \"intermediate_image_urls\": null }, \"meta\": {}, \"detail\": null, \"logs\": [], \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: 2 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Quickstart Let's make your first API call to access AI functionalities using the service from [PiAPI](https://piapi.ai \"\")! ## Generate an API key [\\#](\\#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 [\\#](\\#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 [\\#](\\#make-your-first-api-call) Let's take **Flux API** for an example. 1. **Set URL endpoint**: With our [Unified API Schema](/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: ```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. ```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](/docs/flux-api/text-to-image \"\") about the params above. 4. **Send the request**: ```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 [\\#](\\#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 2. **api.midjourneyapi.xyz** \\- the backup domain for all API endpoints Last modified: a month ago [Generate an API key](#generate-an-api-key \"\") [Set Base URL](#set-base-url \"\") [Make your first API call](#make-your-first-api-call \"\") [Alternate Domains](#alternate-domains \"\")![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Get Task `GET` https://api.piapi.ai/api/v1/task/{task\\_id} Try it out 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 ### Responses OK(200) Unauthorized(401) Record Not Found(404) HTTP Code: 200 Content Type : JSONapplication/json OK-Returns the status and result of the task Data Schema 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 Copy ```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\": \"\" } } } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Cancel Task `DELETE` https://api.piapi.ai/api/v1/task/{task\\_id} Try it out This endpoint from [PiAPI's Kling API](https://piapi.ai/kling-api \"\") allows you to cancel a task hat have not yet started, i.e., tasks in the `pending` state. Once a task has entered the `processing` state, it can no longer be canceled. ### Request Path Params Generate Code task\\_id string required The task\\_id of the task you want to cancel. 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 ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema Generate Code code integer required message string required Example Copy ```hljs hljs-json { \"code\": 200, \"message\": \"task 170b8a42-xxxx-xxxx-xxxx-xxxxxxx8c79e canceled\" } ``` Last modified: 2 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Variation `POST` https://api.piapi.ai/api/v1/task Try it out This enpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") generates different versions of the selected image, corresponding to the `Variations` commands from the offical Midjourney. ### Request Header Params Generate Code X-API-Key string required Your API Key for authorization Body Params application/json Generate Code model enum required Allowed value: midjourney task\\_type enum required Allowed value: variation input object required The task ID of the parent task. origin\\_task\\_id string required index enum required Image index to do the variation - valid values can be 1, 2, 3, 4, high\\_variation, & low\\_variation. High\\_variation and low\\_variation are only valid for both V5.2 and V6 tasks (high\\_variation means vary\\_strong, low\\_variation stands for vary\\_subtle; high\\_variation and low\\_variation are meant to use upon upscaled(u1/u2/u3/u4) task, not original imagine/blend task Allowed values: 1234high\\_variationlow\\_variation prompt string required The prompt for the operation. aspect\\_ratio string optional This parameter dictates the ouput image's aspect ratio value. Default: 1:1 skip\\_prompt\\_check boolean optional Use this parameter to skip our internal prompt check. Default: false config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```hljs hljs-json { \"model\": \"midjourney\", \"task_type\": \"variation\", \"input\": { \"origin_task_id\": \"8409f94e-dd6a-4e5d-874d-3a074e72dcd0\", \"index\": \"1\", \"prompt\": \"angry cat wearing a hat\", \"aspect_ratio\": \"16:9\", \"skip_prompt_check\": false }, \"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 ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful Response Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"6a216a6c-f775-4318-9200-16afe2bd2584\", \"model\": \"midjourney\", \"task_type\": \"variation\", \"status\": \"pending\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"image_url\": \"\", \"image_urls\": null, \"temporary_image_urls\": null, \"discord_image_url\": \"\", \"actions\": [], \"progress\": 0, \"intermediate_image_urls\": null }, \"meta\": {}, \"detail\": null, \"logs\": [], \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: 2 months agoPreviewing drafts. [Back to published](/api/disable-draft) # Access Suno v3.5 through PiAPI's Suno 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/cd4aa13c5c06962cf2eedf50dc3449037fcd416e-3468x2443.png?rect=0,355,3468,1734&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 29, 2024 Hi everyone! As you all might have already heard, [Suno](https://suno.com/) just dropped their early access to their new v3.5 model, which is now available to Pro and Premier members, and it will be available to all the free users as early as this week! ## What is Suno? If you didn't already know, Suno is a text-to-music generative AI that creates music through a simple prompt. Its smart AI model will spark your (or your users') creativity and turn them into your very own music, regardless of your musical expertise. ## v3.5 vs. v3.0 In case you might not know, v3.0 is Suno's first model capable of producing radio-quality music. v3.0 enables you (or your users') to make full, two-minute songs in seconds and is still currently accessible to all users. So what is the difference between the two versions? According to Suno's official update, the v3.5 model is an updated version of the v3.0 model and here are improvements: ![An image of a comparison table between Suno v3.5 model with 4-minute max clip length and 2-minute max song extension, and the v3.0 model with 2-minute max song extension and up to 1-mintute song extension.](https://cdn.sanity.io/images/pr53lcef/production/7159a32125954f5ca74024ccd1e7ffcb8cde0ae1-999x220.webp?q=75&fit=clip&auto=format)An comparison table between Suno v3.0 and v3.5 models For the v3.0 model, the max song extension of ~1 min was listed in this article from [suno.wiki](https://www.suno.wiki/faq/making-music/extend-from-time/#:~:text=New%20in%20v3%20%E2%80%93%20Extend%20from,clip%20from%20before%20the%20problem.) and tested by us. About the difference in music quality, we have generated a song using the same prompt on both v3.0 and v3.5 models: \"make a song that feels like falling in love\"; and below are the generated music. This is the music generated using v3.0: [v3.0 model generated song](https://jmp.sh/eyYfv1Sx) Now the long-awaited v3.5 music is here: [v3.5 model generated song](https://jmp.sh/39dqUxd6) Personally, the improvements are minimal and aren't very noticeable. Nonetheless, the overall music of the 3.5 model does sound pretty good to us and it seems like there isn't as much echo as there were compared to the v3.0 model. However, these are some of our opinions. Let us know what yours are! ## How to generate v3.5 music using our API in Postman You are probably wondering how to generate a Suno v3.5 song using an API, so we are going to show you how to do so using [PiAPI's Suno API](https://piapi.ai/suno-api) and test it on [Postman](https://www.postman.com/) (Postman is an API platform for building and using APIs targeting mostly developers. You may use either their desktop or web version for this tutorial). Let's begin. First of all, you will need to open up or download Postman. Once you arrive at the homepage, you will need to create a new HTTP request, change the request to POST and add the endpoint beside the POST request. Then under headers, you will need to enter 'X-API-KEY' under Key, and your API key under Value. ![An image of Suno v3.5 music generation using PiAPI's Suno API on Postman](https://cdn.sanity.io/images/pr53lcef/production/2a3531bcbd78090b0d1b4a5263d9eaff7f7ac64b-697x350.webp?q=75&fit=clip&auto=format)Entering PiAPI's Suno API endpoint address, the API Key entry, and associated value in Postman Now, click on \"Body\", copy and insert the code from our docs into the empty body section. Make sure to the \"mv\" parameter is set to \"chirp-v3-5\" as shown in the example below. Once you're finished with this step, click \"Send\" and save the returned task id for later use. ![An image of a Suno API request to generate an task ](https://cdn.sanity.io/images/pr53lcef/production/1383b328db12e812a8a0d61351a1b34182fb88e5-705x375.webp?q=75&fit=clip&auto=format)The request body for generating a Suno tasking using model v3.5 For the next step, create a new HTTP request but this time retain the \"GET\" request. Copy the endpoint in our docs and insert it into the url and change the {task id} with the task id provided from the POST request. Afterwards, press \"Send\" (you can leave the \"Body\" section empty) ![An image of a GET request implemented in Postman using the Suno API GET endpoint](https://cdn.sanity.io/images/pr53lcef/production/52741290d01fc82c6c74c33ad7162441a4c1d47d-630x301.webp?q=75&fit=clip&auto=format)Request HTTP for fetching the Suno v3.5 song When you encounter a \"pending\" or \"processing\" status, it means that you will have to wait for a short moment before resending the GET request. Once the result status shows the task is completed, you may click on the audio link in the response to download your song! And there you go! This is how you create your very own Suno v3.5 song through an API! Thanks for reaching to the end of this tutorial! If you are interested in trying out our API, you can sign up for our workspace, and please share this tutorial with anyone who might be interested! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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) PiAPIPreviewing drafts. [Back to published](/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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Get Task `GET` https://api.piapi.ai/api/v1/task/{task\\_id} Try it out 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 API KEY used for request authorization ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema Generate Code code integer optional data object optional task\\_id string optional model string optional task\\_type string optional status string optional input object optional output null optional meta object optional detail null optional logs array \\[object\\] optional error object optional message string optional Example Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"49638cd2-4689-4f33-9336-164a8f6bef07\", \"model\": \"Qubico/flux1-dev\", \"task_type\": \"txt2img\", \"status\": \"pending\", \"input\": { \"prompt\": \"a bear\" }, \"output\": null, \"meta\": { \"account_id\": 0, \"account_name\": \"Qubico_test_user\", \"created_at\": \"2024-08-16T16:13:21.194049Z\", \"started_at\": \"\", \"completed_at\": \"\" }, \"detail\": null, \"logs\": [], \"error\": { \"code\": 0, \"message\": \"\" } }, \"message\": \"success\" } ``` Last modified: 2 months agoPreviewing drafts. [Back to published](/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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # 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) [\\#](\\#flux-api-task-creation-with-lora-and-controlnet) ### Model, Task Type and LoRA Numbers [\\#](\\#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](/docs/flux-api/create-task \"\").** You can explore [Available LoRA and Controlnet](/docs/flux-api/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 [\\#](\\#example--request-body-of-text-to-image-task-with-controlnet-and-lora) ```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 [\\#](\\#request-example-using-curl) ```hljs hljs-bash curl --location --request POST 'https://api.piapi.ai/api/v1/task' --header 'X-API-KEY: YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{ \"model\": \"Qubico/flux1-dev-advanced\", \"task_type\": \"controlnet-lora\", \"input\": { \"prompt\": \"spiderman\", \"control_net_settings\": [\\ {\\ \"control_type\": \"depth\",\\ \"control_image\": \"https://example.com/control_image1.png\"\\ }\\ ], \"lora_settings\": [\\ {\\ \"lora_type\": \"mjv6\"\\ }\\ ] }, \"config\": { \"webhook_config\": { \"endpoint\": \"https://webhook.site/d35ab4aa-95f9-4855-af82-32fbfbb67063\", \"secret\": \"\" } } }' ``` ### Example: Request Body of Task Creation with LoRA only [\\#](\\#example-request-body-of-task-creation-with-lora-only) Input Example: ```hljs hljs-json { \"model\": \"Qubico/flux1-dev-advanced\", \"task_type\": \"controlnet-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 [\\#](\\#example-task-creation-with-controlnet-canny) ```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 [\\#](\\#example-task-creation-with-controlnet-depth) ```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 [\\#](\\#example-task-creation-with-controlnet-softedge) ```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 [\\#](\\#example-task-creation-with-controlnet-openpose) ```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) | Last modified: 24 days ago [Flux API (Task Creation with LoRA and ControlNet)](#flux-api-task-creation-with-lora-and-controlnet \"\") [Model, Task Type and LoRA Numbers](#model-task-type-and-lora-numbers \"\") [Example: Request Body of Text-to-Image Task with ControlNet and LoRA](#example--request-body-of-text-to-image-task-with-controlnet-and-lora \"\") [Request Example Using cURL](#request-example-using-curl \"\") [Example: Request Body of Task Creation with LoRA only](#example-request-body-of-task-creation-with-lora-only \"\") [Example: Task Creation with controlnet Canny](#example-task-creation-with-controlnet-canny \"\") [Example: Task Creation with controlnet Depth](#example-task-creation-with-controlnet-depth \"\") [Example: Task Creation with controlnet SoftEdge](#example-task-creation-with-controlnet-softedge \"\") [Example: Task Creation with controlnet OpenPose](#example-task-creation-with-controlnet-openpose \"\")![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Song API Task Creation Examples(Udio and more) This document provides examples and descriptions for tasks supported by the Song API. Below are the available modes and configurations for the `music-u` and `music-s` models. ## Music-u (Udio API) [\\#](\\#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 [\\#](\\#request-body-example-of-udio-simple-prompt) This mode generates music based on a textual description prompt. It is similar to Suno's description mode. ```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 [\\#](\\#request-body-example-of-udio-instrumental) This mode generates instrumental music. ```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 [\\#](\\#request-body-example-of-udio-full-lyrics) This mode generates music using user-provided lyrics. ```hljs hljs-json { \"model\": \"music-u\", \"task_type\": \"generate_music\", \"input\": { \"prompt\": \"[Verse]\ In the gentle evening air,\ Whispers dance without a care.\ Stars ignite our dreams above,\ Wrapped in warmth, we find our love.\ [Chorus]\ \", \"negative_tags\": \"\", \"lyrics_type\": \"user\", \"seed\": -1 }, \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } } } ``` * * * ## Music-s [\\#](\\#music-s) The `Music-s` model is in testing phase thus it has following restrictions: Custom mode does not support clip-related parameters (e.g., `continue_clip_id`). Only model version `v4` is supported. ### Request Body Example of Description Mode [\\#](\\#request-body-example-of-description-mode) This mode generates music based on a descriptive text prompt. ```hljs hljs-json { \"model\": \"music-s\", \"task_type\": \"generate_music\", \"input\": { \"gpt_description_prompt\": \"night breeze\", \"make_instrumental\": false }, \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } } } ``` ### Request Body Example of Custom Mode [\\#](\\#request-body-example-of-custom-mode) This mode generates music with user-provided details such as title, lyrics, and tags. ```hljs hljs-json { \"model\": \"music-s\", \"task_type\": \"generate_music_custom\", \"input\": { \"title\": \"night breeze\", \"prompt\": \"[Verse]\ In the gentle evening air,\ Whispers dance without a care.\ Stars ignite our dreams above,\ Wrapped in warmth, we find our love.\ [Chorus]\ \", \"tags\": \"exotica, cello\", \"negative_tags\": \"\" }, \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } } } ``` Last modified: 10 days ago [Music-u (Udio API)](#music-u-udio-api \"\") [Request Body Example of Udio Simple Prompt](#request-body-example-of-udio-simple-prompt \"\") [Request Body Example of Udio Instrumental](#request-body-example-of-udio-instrumental \"\") [Request Body Example of Udio Full Lyrics](#request-body-example-of-udio-full-lyrics \"\") [Music-s](#music-s \"\") [Request Body Example of Description Mode](#request-body-example-of-description-mode \"\") [Request Body Example of Custom Mode](#request-body-example-of-custom-mode \"\")![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Flux API with Redux Variation, Fill, Inpaint and Outpaint ## Flux API (Task Creation with fill or redux) [\\#](\\#flux-api-task-creation-with-fill-or-redux) ### Model, Task Type and Usage [\\#](\\#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](/docs/flux-api/create-task \"\").** ### Example: Request Body of Inpaint Task [\\#](\\#example--request-body-of-inpaint-task) ```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 [\\#](\\#example--request-body-of-outpaint-task) ```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 [\\#](\\#example--request-body-of-variationremix-task) ```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\": \"\" } } } ``` Last modified: a month ago [Flux API (Task Creation with fill or redux)](#flux-api-task-creation-with-fill-or-redux \"\") [Model, Task Type and Usage](#model-task-type-and-usage \"\") [Example: Request Body of Inpaint Task](#example--request-body-of-inpaint-task \"\") [Example: Request Body of Outpaint Task](#example--request-body-of-outpaint-task \"\") [Example: Request Body of Variation(remix) Task](#example--request-body-of-variationremix-task \"\")![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Inpaint `POST` https://api.piapi.ai/mj/v2/inpaint Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") alters a part of an upscaled image. This endpoint corresponds with the `Vary (Region)` command from the offical Midjourney. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Example: {{x-api-key}} Body Params application/json Generate Code origin\\_task\\_id string required The task ID of the parent task. mask string required Base64 encoded mask for the region to be modified. prompt string optional This prompt used to regenerate the selected region of the image. skip\\_prompt\\_check boolean optional Use this parameter to skip our internal prompt check. Default value: False. webhook\\_endpoint string optional Task notifications will be sent to the indicated address. The acceptable address can either be a domain or port 443. webhook\\_secret string optional This will be passed as the x-webhook-secret field in the headers during the request. The default value is empty Example Copy ```hljs hljs-json { \"origin_task_id\": \"222fea1d***************dd1957e18dae\", \"prompt\": \"mirror\", \"skip_prompt_check\": false, \"mask\": \"UklGRuoVAABXRUJQVl****************************************************************************u5kemQMX7Up9QGQYYFzbZAAAAA\", \"webhook_endpoint\": \"\", \"webhook_secret\": \"\" } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema Generate Code task\\_id string optional status string optional message string optional ExampleExample 1 Copy ```hljs hljs-json { \"task_id\": \"b2fb598a***************817b83714392\", \"status\": \"success\", \"message\": \"\" } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Faceswap `POST` https://api.piapi.ai/api/face\\_swap/v1/async Try it out This async endpoint from [PiAPI's Faceswap API](https://piapi.ai/faceswap-api \"\") swaps the face from the `swap_image` to the `target_image`. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Example: {{x-api-key}} Body Params application/json Generate Code target\\_image string required 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 required 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. result\\_type string optional The format should be: \"url\" or \"base64\". Default type is \"base64\". Example Copy ```hljs hljs-json { \"target_image\": \"Superman.png\", \"swap_image\": \"Leonardo_Dicaprio.png\", \"result_type\": \"url\" } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema Generate Code code integer optional data object optional task\\_id string optional message string optional ExampleExample 1 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"7a7ba527************1974d4316e22\" }, \"message\": \"success\" } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Webhook ## Introduction [\\#](\\#introduction) To ensure timely updates and notifications, [PiAPI](https://piapi.ai \"\") offer webhook services integrated with our [Unified API Schema](/docs/unified-api-schema \"\"). When you create a task, you can specify a webhook endpoint. Our API service will then send an HTTP POST request to this URL whenever a task _**succeeds or fails.**_ **Webhooks: Use Cases** 1 Persisting Result Data and Files Since input and output data (including any files) are automatically deleted after a set period, webhooks allow you to capture all metadata for completed tasks. This enables you to store the data in a database or save the output files to persistent storage before they are deleted. 2 Notification for Long-Running Tasks Some tasks may take several minutes to complete. By using a webhook handler, you can send notifications—such as an email or a Slack message—when a task is completed. 3 Building Model Pipelines Webhooks can capture the output of one long-running task and feed it into another model as input, enabling seamless automation across models. 📌 Webhooks are only supported in the [Unified API Schema](/docs/unified-api-schema \"\"). While the legacy version of the API remains fully functional, webhook capabilities are exclusive to the new unified API. ## Setting Up Webhooks [\\#](\\#setting-up-webhooks) To use webhooks, include the `webhook_config` field in the request body when creating a task. Specify the endpoint and secret. ```hljs hljs-json //POST https://api.piapi.ai/api/v1/task { \"model\": \"suno/v3-chorip\", \"task_type\": \"lyrics\", \"input\": {}, \"config\": { \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } } } ``` | Field | Description | Details | | --- | --- | --- | | endpoint | The URL where the webhook will be sent | Ensure that the receiving server is accessible by **Cloudflare workers**. | | secret | Used to verify the request source | If a secret is provided, it will be included in the `x-webhook-secret` header. | * * * ## Receiving Webhooks [\\#](\\#receiving-webhooks) ### When will PiAPI send webhook notification [\\#](\\#when-will-piapi-send-webhook-notification) When a task is created or completed (i.e., when a task enters the `completed` or `failed` status), PiAPI sends an HTTP POST request to the specified URL. Additionally, webhook notifications are also sent for certain tasks whenever there is a status update in the `processing` mode. These tasks include: 1. Music Generation tasks processed by Suno. 2. Tasks processed by Midjourney, created by users with the Creator Plan or higher. ### Request body [\\#](\\#request-body) The request body is in JSON format and includes two key fields: `timestamp` and `data`. The `timestamp` helps in identifying duplicate notifications (such as in cases of retry), while the `data` field mirrors the response from the unified fetch API. ```hljs hljs-json { \"timestamp\": 1723018391, \"data\": {} } ``` | Field | Description | Details | | --- | --- | --- | | timestamp | Unix timestamp | Useful for detecting duplicate notifications. | | data | Task data | Matches the structure from the unified fetch API. | The `output` field is critical in webhook notifications as it reflects the current result or progress of the task, with content varying depending on the model and task type. 🚀 Here is an _**example of a webhook request**_ for a Luma video generation task: ```hljs hljs-json { \"timestamp\": 1724511853, \"data\": { \"task_id\": \"58cb41b7-556d-46c0-b82e-1e116aa1a31a\", \"model\": \"luma\", \"task_type\": \"video_generation\", \"status\": \"completed\", \"config\": { \"webhook_config\": { \"endpoint\": \"https://webhook.site/xxxxx\", \"secret\": \"123456\" } }, \"input\": { \"aspect_ratio\": \"16:9\", \"expand_prompt\": true, \"image_end_url\": \"https://i.imgur.com/CSmEZud.png\", \"image_url\": \"https://i.imgur.com/eJkSUnA.png\", \"loop\": false, \"user_prompt\": \"\" }, \"output\": { \"generation\": { \"id\": \"ab9124ef-49d4-4da7-bf12-0c3891a3cca8\", \"prompt\": \"\", \"state\": \"completed\", \"created_at\": \"2024-08-24T15:01:52.727Z\", \"video\": { \"url\": \"https://storage.cdn-luma.com/dream_machine/49995d70-d0f3-4b0d-afb0-ec034107e4e2/watermarked_video08fe0802a4e104f1a80fb6c6c658710ee.mp4\", \"url_no_watermark\": \"https://img.midjourneyapi.xyz/ephemeral/db7420f9-8a24-48fd-ade5-ede803e835db.mp4\", \"width\": 1168, \"height\": 864, \"thumbnail\": \"\" }, \"like\": null, \"estimate_wait_seconds\": null } }, \"meta\": { \"created_at\": \"2024-08-24T23:01:12.3556324+08:00\", \"started_at\": \"2024-08-24T23:01:36.7432691+08:00\", \"ended_at\": \"2024-08-24T23:04:13.5301322+08:00\", \"usage\": { \"type\": \"luma_quota\", \"frozen\": 30, \"consume\": 30 } }, \"detail\": { \"account_id\": 1, \"is_using_private_pool\": false }, \"logs\": [], \"error\": { \"code\": 0, \"message\": \"\" } } } ``` In webhook notifications, the `output` field within the `data` structure is particularly important as it represents the result (or latest progress) of the task. The content of the `output` field mirrors that of the output field in the response from the `get task` endpoint. ## Handling Webhook Deliveries [\\#](\\#handling-webhook-deliveries) Your endpoint **must** return a _**successful status code (2xx)**_ quickly to avoid timeouts before performing any complex logic. To handle webhook requests, create an `HTTP` or `HTTPS` endpoint that accepts `POST` requests with a `JSON` payload. For local development, you can use `HTTP`, but once publicly accessible, the endpoint must support `HTTPS`. The endpoint should handle `POST` requests with the event object in `JSON` format. Always respond with a `2xx` status code before performing any extended logic. Here's an example of a Next.js webhook handler: ```hljs hljs-js // pages/api/piapi-webhook.js export default async function handler(req, res) { console.log(\"🪝 incoming webhook!\", req.body.data.taskid); const prediction = req.body; await saveToMyDatabase(prediction); await sendSlackNotification(prediction); res.end(); } ``` * * * ## Webhook Retries [\\#](\\#webhook-retries) If PiAPI does not receive a successful response (status `2xx`), or if it encounters a `4xx` or `5xx` error, it will retry the webhook after 5 seconds. Up to 3 attempts will be made for each notification. * * * ## Best Practices for Using Webhooks [\\#](\\#best-practices-for-using-webhooks) 1. **Use `HTTPS` for Security**: Ensure your server uses HTTPS to protect data in transit, preventing unauthorized access. 2. **Timestamp Verification**: The `timestamp` in webhook requests is crucial for: **Preventing Replay Attacks**: Compare the request’s `timestamp` with the current system time. If the difference is too large, reject the request. **Deduplication**: Use the `timestamp` to avoid processing the same event multiple times. 3. **Testing Webhooks**: We recommend services like [webhook.site](https://webhook.site/ \"\") to test and debug webhook requests before moving to production. Last modified: 2 months ago [Introduction](#introduction \"\") [Setting Up Webhooks](#setting-up-webhooks \"\") [Receiving Webhooks](#receiving-webhooks \"\") [When will PiAPI send webhook notification](#when-will-piapi-send-webhook-notification \"\") [Request body](#request-body \"\") [Handling Webhook Deliveries](#handling-webhook-deliveries \"\") [Webhook Retries](#webhook-retries \"\") [Best Practices for Using Webhooks](#best-practices-for-using-webhooks \"\")Previewing drafts. [Back to published](/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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Cancel Tasks Developing `DELETE` https://api.piapi.ai/api/v1/tasks Try it out This endpoint from [PiAPI's Kling API](https://piapi.ai/kling-api \"\") allows you to cancel tasks of Kling that were created before a specified time point. Only tasks that have not yet started, i.e., tasks in the `pending` state, can be canceled. Once a task has entered the `processing` state, it can no longer be canceled. ### Request Query Params Generate Code created\\_before integer required The time point at which you want to cancel tasks created before. It is Unix Timestamp. Example: 1728570429 model enum required The model name of tasks you want to cancel. If you want to cancel tasks by all models(midjourney+suno+kling+luma), set to `all` Allowed values: klingmidjourneysunolumaall Example: kling 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 ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema Generate Code code integer required message string required Example Copy ```hljs hljs-json { \"code\": 200, \"message\": \"tasks created before 2024-10-12 02:38:06 +0000 UTC for model 'kling' have been canceled\" } ``` Last modified: 2 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # 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 [\\#](\\#lipsync-with-existing-dubbingaudio) ```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 [\\#](\\#lipsync-with-kling-tts) Read [kling tts voice list](https://klingai.com/api/lip/sync/ttsList?type= \"\") before you proceed. ```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 [\\#](\\#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. Last modified: 2 months ago [LipSync with existing dubbing/audio](#lipsync-with-existing-dubbingaudio \"\") [LipSync with kling tts](#lipsync-with-kling-tts \"\") [Common lipsync errors](#common-lipsync-errors \"\")![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # How To Avoid Timeouts in Completion API We use CloudFlare as our CDN provider and API gateway, which enforces a default 120-second timeout for all requests. As a result, when using the `non-streaming` mode in the text completion API, the process may exceed this time limit. To prevent time-out errors and avoid wasting tokens, you can try one of the following workarounds: ## 1\\. Enable Stream Mode [\\#](\\#1-enable-stream-mode) Include `stream: true` in the request payload as shown in [LLM API \\| Basic Completions](/docs/llm-api/completions \"\"). This allows you to receive partial results as soon as the connection with the server is established, effectively bypassing the time-out issue. ## 2\\. Use the Alternative Domain `proxy.piapi.ai` [\\#](\\#2-use-the-alternative-domain) This endpoint does not use CloudFlare, providing longer time-out limits. However, it may introduce slightly higher latency. Last modified: 2 months ago [1\\. Enable Stream Mode](#1-enable-stream-mode \"\") [2\\. Use the Alternative Domain proxy.piapi.ai](#2-use-the-alternative-domain \"\")Previewing drafts. [Back to published](/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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Cancel `POST` https://api.piapi.ai/mj/v2/cancel Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") cancels a task before `processing` status. ### Request Body Params application/json Generate Code task\\_ids array required an array of task\\_ids to cancel Example Copy ```hljs hljs-json { \"task_ids\": [\\ null\\ ] } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema Generate Code object{0} Example Copy ```hljs hljs-json {} ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Output Storage On this page you will find information on how long [PiAPI](https://piapi.ai \"\") will store each of the API's outputs for. ## MidJourney API [\\#](\\#midjourney-api) ### Pay-as-you-go Option [\\#](\\#pay-as-you-go-option) Images generated are stored for 3 days after creation and automatically deleted thereafter. Operations on generated images (e.g., upscaling, variations) are valid for 3 hours post-creation. ### Host-your-account Option [\\#](\\#host-your-account-option) Images generated are stored for 3 days after creation and automatically deleted thereafter. Operations on generated images (e.g., upscaling, variations) are valid for 3 days post-creation. ## Luma Dream Machine API [\\#](\\#luma-dream-machine-api) Output videos are stored on Luma's CDN. Retention policy is managed by Luma's CDN terms. ## Kling API [\\#](\\#kling-api) Watermarked videos are stored on Kling's CDN. Retention policy is managed by Kling's CDN terms. Non-watermarked videos are stored on our servers for 3 days and automatically deleted thereafter. ## Suno API [\\#](\\#suno-api) Output audios are stored on Suno's CDN. Retention policy is managed by Suno's CDN terms. Generated audio files are available for further operations (e.g., concatenation) for 3 days post-creation. ## Flux API & Faceswap API [\\#](\\#flux-api--faceswap-api) Output images are stored on our servers for 3 days after creation and automatically deleted thereafter. ## AI Hug Video API [\\#](\\#ai-hug-video-api) Output images are stored on our servers for 1 days after creation and automatically deleted thereafter. Last modified: 3 months ago [MidJourney API](#midjourney-api \"\") [Pay-as-you-go Option](#pay-as-you-go-option \"\") [Host-your-account Option](#host-your-account-option \"\") [Luma Dream Machine API](#luma-dream-machine-api \"\") [Kling API](#kling-api \"\") [Suno API](#suno-api \"\") [Flux API & Faceswap API](#flux-api--faceswap-api \"\") [AI Hug Video API](#ai-hug-video-api \"\")Login / Sign up # Luma Dream Machine Playground Overview Run API Task History API Settings Create Task: Text-to-Video MODELLuma This endpoint from Dream Machine API utilizes Dream Machine model by Luma Labs to produce text/image-to-video generation. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string A description that enables Luma Dream Machine API to generate a video. expand\\_promptboolean offon Let the AI turn your simple concepts into detailed prompts. Default value: False (prompt enhancer cannot be turned on in the playground) Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization. # Luma Dream Machine Playground Overview Run API Task History API Settings Create Task: Text-to-Video MODELLuma This endpoint from Dream Machine API utilizes Dream Machine model by Luma Labs to produce text/image-to-video generation. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string A description that enables Luma Dream Machine API to generate a video. expand\\_promptboolean offon Let the AI turn your simple concepts into detailed prompts. Default value: False (prompt enhancer cannot be turned on in the playground) Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization.Login / Sign up # Luma Dream Machine Playground Overview Run API Task History API Settings Create Task: Text-to-Video MODELLuma This endpoint from Dream Machine API utilizes Dream Machine model by Luma Labs to produce text/image-to-video generation. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string A description that enables Luma Dream Machine API to generate a video. expand\\_promptboolean offon Let the AI turn your simple concepts into detailed prompts. Default value: False (prompt enhancer cannot be turned on in the playground) Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization. # Luma Dream Machine Playground Overview Run API Task History API Settings Create Task: Text-to-Video MODELLuma This endpoint from Dream Machine API utilizes Dream Machine model by Luma Labs to produce text/image-to-video generation. Header X-API-KEY\\*string Your default API Key used for request authorization. Body Prompt\\*string A description that enables Luma Dream Machine API to generate a video. expand\\_promptboolean offon Let the AI turn your simple concepts into detailed prompts. Default value: False (prompt enhancer cannot be turned on in the playground) Response Codes 200: OKSuccessful Response 400: Bad RequestThe request format does not meet the requirements 401: UnauthorizedThe API key is incorrect 500: Internal Server ErrorService is experiencing an error RunReset Get Task Enter the task ID obtained after running \"create task\" to retrieve the task results. URL Path Parameter Task ID\\*string Header X-API-KEY\\*string Your default API Key used for request authorization.# Kling AI & Kling API / remarkable image and video generation at your fingertips! PiAPI's Kling API supporting [Kling's 1.0, 1.5 & 1.6 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) ## Features Image-to-Video Supported! Kling AI 1.0, 1.5 & 1.6 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](/pricing) [Get Started!](https://piapi.ai/workspace/kling) ## Our blog Check out our blog for related contents! ![An image of Kling 1.6 Model](images/kling/kling_1_6.webp) Kling API ### [Kling 1.6 Model through Kling API](/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](images/kling/sora_vs_kling.webp) Kling API ### [Sora API vs Kling API - a comparison of AI video generation Models](/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](images/Lumalab/kling_api_and_luma_api.webp) Kling API ### [Crush it Melt it through Pika API , Kling API & Luma API](/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](images/kling/kling_blog.webp) Kling API ### [The Motion Brush Feature through Kling API](/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](images/kling/kling_and_mj.webp) Kling API ### [Using Kling API & Midjourney API to Create an Animated Custom Wallpaper](/blogs/using-kling-api-and-midjourney-api-to-create-an-animated-custom-wallpaper) Using Kling API and Midjourney API to create visually stunning wallpapers! For example an anime wallpaper, a wallpaper of the character Yoshii Toragana from Shogun, and a Warhammer 40k Wallpaper. ![An image of Kling 1.5 vs 1.0](images/kling/kling_vs.webp) Kling API ### [Kling 1.5 vs 1.0 - A Comparison through Kling API](/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](images/Lumalab/Luma_vs_Kling.webp) Kling API ### [Luma Dream Machine vs Kling - A brief comparsion using APIs](/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! ![An image of a futuristic jet generated by PiAPI's Midjourney API](/images/Lumalab/Lumalab_otherAPIs_midjourney_image_white.webp) ### [Midjourney API](/midjourney-api) We provide the most stable and cost effective (unofficial) Midjourney API on the market, supporting two usage mode (you can host your own Midjourney account, or use our Midjourney accounts and pay-as-you-go). With fast response time and high number of concurrent jobs, our Midjourney API is a favourite among developers worldwide! ![A screenshot of a video of a beautiful eye generated using our Dream Machine API](/images/Lumalab/Luma-Dream-Machine-API.webp) ### [Luma Dream Machine API](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! ![A image of a sound wave illustrating PiAPI's Suno API](/images/Lumalab/Suno_banner.webp) ### [Suno API](suno-api) Also check out our unofficial Suno API - the API to the best text-to-music generation model out there! Our API is compatible with V3, supports lyrics generation and high concurrency. With the “continue feature” and both “pay-as-you-go” and “host-your-account” options, it’s designed to meet the development needs of creators and builders worldwide. ## 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 [contact@piapi.ai](mailto:contact@piapi.ai)\\- we'd love to talk more regarding our product offering!![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Get Task `GET` https://api.piapi.ai/api/v1/task/{task\\_id} Try it out This endpoint from [PiAPI's Dream Machine API](https://piapi.ai/dream-machine-api \"\") retrieves the output of a Dream Machine task. ### Request Path Params Generate Code task\\_id string required Header Params Generate Code x-api-key string required Your API key for authorization ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"f7a6d8e5-249f-4a9e-a8f4-1e8af806ea15\", \"model\": \"luma\", \"task_type\": \"video_generation\", \"status\": \"completed\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"prompt\": \"\", \"internal_state\": \"completed\", \"created_at\": \"\", \"video\": { \"url\": \"https://xxx.mp4\", \"width\": 1360, \"height\": 752 }, \"video_raw\": { \"url\": \"https://xxx.mp4\", \"width\": 1360, \"height\": 752 }, \"thumbnail\": { \"url\": \"https://xxx.jpg\", \"width\": 1360, \"height\": 752 }, \"last_frame\": { \"url\": \"https://xxx.jpg\", \"width\": 1360, \"height\": 752 } }, \"meta\": {}, \"detail\": null, \"logs\": null, \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Multi Fetch `POST` https://api.piapi.ai/mj/v2/multi\\_fetch Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") fetches results from many task\\_ids at once. ### Request Body Params application/json Generate Code task\\_ids array\\[string\\] required A maximum of 50 task id strings in an array Example Copy ```hljs hljs-json { \"task_ids\": [\\ \"8c6549ed****************571df93ec731\"\\ ] } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema Generate Code code integer optional data object optional ed2ef4bd\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*9c32b9d175ce object optional message string optional ExampleExample 1 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"1921e0b2******************bd7608f03c87\": { \"task_id\": \"8c6549ed****************571df93ec731\", \"status\": \"finished\", \"process_time\": 205, \"retry_count\": 0, \"meta\": { \"account_id\": \"374\", \"task_type\": \"imagine\", \"origin_task_id\": \"\", \"bot_hash\": \"\", \"bot_id\": 0, \"model_version\": \"unknown\", \"process_mode\": \"relax\", \"quota_frozen\": 14, \"frozen_credit\": 0, \"created_at\": 1717057410, \"created_at_utc\": \"2024-05-30 08:23:30 +0000 UTC\", \"started_at\": 1717057418, \"started_at_utc\": \"2024-05-30 08:23:38 +0000 UTC\", \"ended_at\": 1717057623, \"ended_at_utc\": \"2024-05-30 08:27:03 +0000 UTC\", \"task_request\": { \"aspect_ratio\": \"\", \"auto_upload\": false, \"bot_id\": 0, \"notify_progress\": true, \"process_mode\": \"relax\", \"prompt\": \"a cute puppy\", \"skip_prompt_check\": false, \"skip_retry\": true, \"upload_prompt_image\": false, \"webhook_endpoint\": \"\", \"webhook_secret\": \"\" }, \"task_param\": { \"prompt\": \"a cute puppy--relax\", \"index\": \"\", \"zoom_ratio\": \"2\", \"aspect_ratio\": \"1:1\", \"direction\": \"\" } }, \"task_result\": { \"discord_image_url\": \"https://img.midjourneyapi.xyz/mj/8c6549ed****************571df93ec731.png\", \"image_url\": \"https://img.midjourneyapi.xyz/mj/8c6549ed****************571df93ec731.png\", \"image_urls\": [], \"permanent_url\": \"\", \"task_progress\": 0, \"intermediate_image_urls\": null, \"image_id\": \"\", \"seed\": \"\", \"result_message_id\": \"\", \"quota_used\": 6, \"credit\": 0, \"message\": \"\", \"warning\": \"\", \"error_messages\": [], \"need_retry\": true, \"actions\": [\\ \"reroll\",\\ \"upscale1\",\\ \"upscale2\",\\ \"upscale3\",\\ \"upscale4\",\\ \"variation1\",\\ \"variation2\",\\ \"variation3\",\\ \"variation4\"\\ ] } } }, \"message\": \"success\" } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Endpoints 💡 All APIs under this directory are of the _**unified schema**_ \\-\\- meaning they share the _**same call & response format**_. Check [Unified API Schema](/unified-api-schema \"\") for more details. Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Get Task `GET` https://api.piapi.ai/api/v1/task/{task\\_id} Try it out This endpoint from [PiAPI's Faceswap API](https://piapi.ai/faceswap-api \"\") retrieves the output of a Faceswap 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 ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"90efd2db-bcfc-413f-a0be-c893850c9d68\", \"model\": \"Qubico/image-toolkit\", \"task_type\": \"face-swap\", \"status\": \"completed\", \"config\": { \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": {}, \"meta\": {}, \"detail\": null, \"logs\": [], \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: 3 months agoPreviewing drafts. [Back to published](/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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # 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` [\\#](\\#structure-of-the) ```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 [\\#](\\#color-indexing-for-masks) The index of each mask corresponds to specific fixed color regions in the mask image. The relationship is as follows: ```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](/docs/raiz5jee8eiph0eeFooV/api/v1/projects/675356/resources/347095/image-preview) `\"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 [\\#](\\#full-example-of-image-to-video-task-with-motion-brush) ```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}\\ ]}\\ ] } } } ``` Last modified: 2 months ago [Structure of the motion\\_brush](#structure-of-the \"\") [Color Indexing for Masks](#color-indexing-for-masks \"\") [Full Example of Image-to-video Task with Motion Brush](#full-example-of-image-to-video-task-with-motion-brush \"\")Previewing drafts. [Back to published](/api/disable-draft) # Midjourney API's Auto-CAPTCHA-Solver ![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/c46e57d4498c007b1585344d72b55611732b8f11-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 10, 2024 ## **What is Midjourney's CAPTCHA feature?** Around June 2024, Midjourney introduced the CAPTCHA feature for users of their Discord bot to generate images. Being a security feature, Midjourney has not announced or released any public information regarding its implementation, thus we at PiAPI aren't sure about the exact launch date of this feature. After doing some brief research, it seems that others have [**posted about the CAPTCHA feature on X**](https://x.com/fofrAI/status/1659638958760902657) as early as May 2023. ![A screenshot of an X user's tweet about Midjourney implementing a CAPTCHA security feature](https://cdn.sanity.io/images/pr53lcef/production/6399f80c75ce1c488f1fae429290eda862d381e4-485x813.png?q=75&fit=clip&auto=format)A user's tweet on X about Midjourney's CAPTCHA security feature back in 2023 May. So what is Midjourney's CAPTCHA feature? [CAPTCHA](https://support.google.com/a/answer/1217728?hl=en#:~:text=CAPTCHA%20(Completely%20Automated%20Public%20Turing,known%20as%20challenge%2Dresponse%20authentication.), which stands for \"Completely Automated Public Turing test to tell Computers and Humans Apart\", is a type of security measure known as challenge-response authentication. Essentially, it is a small test or puzzle that websites and apps use to check if you're a real person rather than a robot. It might ask you to click on certain images, type in some letters, or solve a simple puzzle. If you have spent time online, you more than likely have done one before. Thus, why did Midjourney introduce this feature? Most likely, Midjourney introduced this feature to deter bot abuse and prevent automation attempts. However, CAPTCHAs have some problems. Firstly, it negatively impacts user experience. CAPTCHAs sometimes has unclear or distorted text for human readability, which often results in multiple failed attempts, causing frustration among users. Also, CAPTCHAs obviously impose extra manual work for users, causing workflow disruptions. Thus, it is not a surprise that [77% of IT and security leaders agree that eliminating CAPTCHA would greatly enhance the user experience](https://www.kasada.io/wp-content/uploads/2023/10/Kasada-2023-State-of-Bot-Mitigation-Report.pdf). Secondly, CAPTCHAs fail at their core purpose because [AI and bots now outperform humans in solving even the most challenging ones](https://www.usenix.org/system/files/usenixsecurity23-searles.pdf), rendering them ineffective. Naturally, developers using Midjourney API would also be negatively affected by CAPTCHAs. When developers discover a CAPTCHA has shown up, it already means that their website/app service is being disrupted, and they'd have to manually solve the CAPTCHA as well. Therefore, is there a better way to deal with this issue? [PiAPI's Midjourney API](https://piapi.ai/midjourney-api) has the solution! ## **PiAPI's Midjourney API Auto-CAPTCHA Feature** We at PiAPI have taken the initiative to develop and test our auto-CAPTCHA-solving service, and it consists of the following steps: ### **Step 1** When a CAPTCHA is triggered within your own Midjourney account(s), PiAPI will automatically detect this, and suspend this account as shown below: ![A screenshot of a suspended account in PiAPI's workspace due to CAPTCHA](https://cdn.sanity.io/images/pr53lcef/production/8b6d683e25372df9309087c971a86662c6056b6f-1280x263.jpg?q=75&fit=clip&auto=format)The connected Midjourney account being suspended due to CAPTCHA popping up in PiAPI's Workspace ### **Step 2** To get notified that your Midjourney account(s) is suspended: 1. 1\\. For **Free Plan Users ($0/month)**, you would have to manually go to [PiAPI's Midjourney Workspace page](https://app.piapi.ai/midjourney) and check its status; 3. 2\\. For **Creator Plan users ($8/month)** and **Pro plan users ($50/month)**, you can set up an [Account Notification Webhook](https://app.piapi.ai/notifications) to automatically receive updates about your suspended account(s). ![A screenshot of the Account Notifications section on PiAPI's workspace page with two red squares: one highlighting what PiAPI notifies you about, and the other highlighting the account notification webhook section](https://cdn.sanity.io/images/pr53lcef/production/81a05fb679fb8a37d8aff72e371647b1ad527781-1272x750.png?q=75&fit=clip&auto=format)The Account notifications section on PiAPI's Workspace page ### **Step 3** 1. 1\\. For **Free Plan users ($0/month)** and **Creator Plan users ($8/month)** 1. a. If it has been **within** 30 minutes since PiAPI first detected that the CAPTCHA was triggered on your account. You can go to [PiAPI's Midjourney Workspace page](https://app.piapi.ai/midjourney), click on \"Get CAPTCHA link\", solve the CAPTCHA manually, and click on \"reactivate\" for that particular connected account. 3. b. If 30 minutes **have passed** since PIAPI first detected that CAPTCHA has been triggered on your account. You will have to go to that particular Midjourney's account on Discord to solve the CAPTCHA manually (you need to send a new task first to trigger the CAPTCHA again - unfortunately, this might increase the risk of banning). Then, go back to [PiAPI's Midjourney Workspace page](https://app.piapi.ai/midjourney) and click on \"Reactivate\" for that particular connected account. Note: If you've solved the CAPTCHA, clicked on \"reactivate\", and the account still does not work - just delete the account and re-connect it again. 1. 2\\. For **Pro Plan users ($50/month)**, PiAPI offers our **Automated CAPTCHA Solver** to help users automatically solve the Midjourney CAPTCHA. All you need to do is simply turn on the switch and that is it! ![a screenshot of PiAPI's Midjourney Workspace page with a red box highlighting where to turn on the Automated CAPTCHA Solver](https://cdn.sanity.io/images/pr53lcef/production/edb89193bbcd060d96e61506e7b5a1d34dca594b-1272x477.png?q=75&fit=clip&auto=format)PiAPI's Midjourney Workspace Page showing the Automated CAPTCHA Solver ## **Conclusion** The difficulties for developers caused by Midjourney's CAPTCHA feature are pretty obvious and painful, from frequent disruption to inefficiencies in their operation. We at PiAPI are committed to improving your experience with our **Auto-CAPTCHA-Solver** feature, designed to overcome these hurdles effortlessly. We hope you'll like this feature that we worked on! Please check out our [other AI APIs](https://piapi.ai/) if you are interested! Happy building! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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) PiAPIPreviewing drafts. [Back to published](/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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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) PiAPIPreviewing drafts. [Back to published](/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 Midjourney 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 Midjourney API, which was then used as input for Kling API in this example. ![An image of Superman flying in the sky generated by Midjourney](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 Midjourney 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 Midjourney 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 Midjourney](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 Midjourney 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 Midjourney 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 Midjourney](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 Midjourney 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/d0d4f0a35b6157f9465da531df3eb70a568334ff-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/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](/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)](/blogs/openai-realtime-api-vs-moshi-api) ### [OpenAI's Realtime API (powering ChatGPT Advanced Voice Mode) vs Moshi API](/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) PiAPIPreviewing drafts. [Back to published](/api/disable-draft) # Using Kling API & Midjourney API to Create an Animated Custom Wallpaper ![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! By pairing our [Kling API](https://piapi.ai/kling-api) and our [Midjourney API](https://piapi.ai/midjourney-api), you can first generate high-quality wallpaper according to your preferences, and then bring it to life with dynamic animation. 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 1: Midjourney to Kling** Below is the AI Anime image that we have generated using Midjourney API, with the prompt in its description (all the prompts used in this blog are edited by GPT). ![PNG image of a girl with her back towards the camera, looking at the sky, in the anime art style, generated by Midjourney API](https://cdn.sanity.io/images/pr53lcef/production/b8c2b0d41cb7a350ea65025c7b36eefbed1f4942-400x224.png?q=75&fit=clip&auto=format)Prompt: \"Anime wallpaper of a girl with her back to the camera, long flowing hair swaying gently in the breeze, gazing up at a vast, starry night sky filled with bright constellations and a glowing full moon, with soft clouds and a serene atmosphere\" Now that we have the image generated, we will insert that image alongside a new but similar prompt into Kling API, as shown below: ![GIF of a girl looking at the night sky, focusing on the glowing moon with the clouds moving, her hair gently swaying in the breeze, in the anime art style, generated by Kling API with an image generated by Midjourney API as input.](https://cdn.sanity.io/images/pr53lcef/production/c9a9951abfd3eefc5b1bdfce03e02abdb3645ea9-600x314.gif?q=75&fit=clip&auto=format)Prompt: \"Anime girl with long flowing hair stands with her hair back to the camera, her hair gently swaying in the breeze. she gazes up at an anime-starry sky and a glowing full moon. Soft clouds float, creating a serene, calm, night. Shot from a low-angle view with ambient moonlight and soft shadows for a tranquil atmosphere.\" ### **Workflow 2: Online image to Kling** In the second workflow, we found an image online that closely matches our Midjourney prompt, an anime girl with her back to the camera, gazing at the sky. ![JPEG image of an anime girl looking at the sky with her back turned to the camera](https://cdn.sanity.io/images/pr53lcef/production/2d2068b3afde9a345788e337177b3ef5f23e3a3a-400x224.png?q=75&fit=clip&auto=format)An image of an anime girl looking at the sky with her back turned to the camera to be used as an input to Kling Then, we will use this image alongside the same prompt we used in Workflow 1 to generate the video by using Kling API, with the output shown below. ![GIF of an anime girl looking at the sky with her back turned to the camera, generated by Kling with an online image as additional input](https://cdn.sanity.io/images/pr53lcef/production/de687cd6c72794b77225e1a290575ed122f4d6be-600x314.gif?q=75&fit=clip&auto=format)Prompt: Same prompt as Workflow 1 ### **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** After reviewing the results, we believe that the output from Workflow 1 (Midjourney to Kling) delivers the clearest and most detailed live anime wallpaper, with the added benefit of the initial wallpaper being customizable according to your preferences. 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 Midjourney'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 Midjourney. ## **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 Midjourney 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 Midjourney 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 Midjourney API first. ![PNG image of a Warhammer 40k Space Marine walking through an alien desert with a red planet in the background, generated by Midjourney 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 [Midjourney API](https://piapi.ai/midjourney-api) is the best choice for creating your very own animated custom wallpaper. The combination of Midjourney images and Kling's animation creates highly detailed results, With Midjourney 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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Imagine `POST` https://api.piapi.ai/api/v1/task Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") generates 4 unique images in a 2x2 grid from a text description also known as prompt. This endpoint corresponds with the `/imagine` command from the offical Midjourney. ### Request Header Params Generate Code x-api-key string required Your API Key for authorization. Body Params application/json Generate Code model enum required Allowed value: midjourney task\\_type enum required Allowed value: imagine input object required prompt string required A prompt is a description that enables Midjourney API to produce an image. aspect\\_ratio string optional This parameter dictates the ouput image's aspect ratio value. Default: 1:1 process\\_mode enum optional This parameter indicates the operation process mode Allowed values: relaxfastturbo skip\\_prompt\\_check boolean optional Use this parameter to skip our internal prompt check. Default: false bot\\_id integer optional Only Host-Your-Account users on the Pro Plan can use this parameter. This parameter specifies which Midjourney account will process this task. config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```hljs hljs-json { \"model\": \"midjourney\", \"task_type\": \"imagine\", \"input\": { \"prompt\": \"flying night city\", \"aspect_ratio\": \"16:9\", \"process_mode\": \"fast\", \"skip_prompt_check\": false, \"bot_id\": 0 }, \"config\": { \"service_mode\": \"\", \"webhook_config\": { \"endpoint\": \"https://webhook.site/\", \"secret\": \"123456\" } } } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"39631ce-xxxx-xxxx-xxxx-6de760cd2053\", \"model\": \"midjourney\", \"task_type\": \"imagine\", \"status\": \"pending\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"image_url\": \"\", \"image_urls\": null, \"temporary_image_urls\": null, \"discord_image_url\": \"\", \"actions\": [], \"progress\": 0, \"intermediate_image_urls\": null }, \"meta\": {}, \"detail\": null, \"logs\": [], \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: 2 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Endpoints 💡 All APIs under this directory are of the _**unified schema**_ \\-\\- meaning they share the _**same call & response format**_. Check [Unified API Schema](/unified-api-schema \"\") for more details. Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Seed `POST` https://api.piapi.ai/api/v1/task Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") obtains the seed information of a completed task. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Body Params application/json Generate Code model enum required Allowed value: midjourney task\\_type enum required Allowed value: seed input object required origin\\_task\\_id string required Tthe task\\_id of the task for which you are trying to obtain the seed information. config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```hljs hljs-json { \"model\": \"midjourney\", \"task_type\": \"seed\", \"input\": { \"origin_task_id\": \"513db975-d329-4717-b7c9-6272542f1c13\" }, \"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 ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"e0a4a115-6946-4bc1-af36-0a0263fad6a1\", \"model\": \"midjourney\", \"task_type\": \"seed\", \"status\": \"pending\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"seed\": \"\" }, \"meta\": {}, \"detail\": null, \"logs\": [], \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: 2 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Upscale `POST` https://api.piapi.ai/api/v1/task Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") upscales the resolution of the chosen image (and isolates it). This endpoint corresponds to the `upscale` command from the official Midjourney. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Body Params application/json Generate Code model enum required Allowed value: midjourney task\\_type enum required Allowed value: upscale input object required origin\\_task\\_id string required The task ID of the parent task. index enum required The parameter upscales the selected image. Light/beta are available for V4 model UPSCALED tasks only; 2x/4x for V5 model UPSCALED tasks only; subtle/creative for V6 UPSCALED tasks models only. Allowed values: 1234lightbeta2x4xsubtlecreative config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```hljs hljs-json { \"model\": \"midjourney\", \"task_type\": \"upscale\", \"input\": { \"origin_task_id\": \"ee6f1989-5de2-4e4a-b860-b059ad57a023\", \"index\": \"3\" }, \"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 ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"f82d8ace-xxxx-xxxx-xxxx-xxxxxx72038d\", \"model\": \"midjourney\", \"task_type\": \"upscale\", \"status\": \"pending\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"image_url\": \"\", \"image_urls\": null, \"temporary_image_urls\": null, \"discord_image_url\": \"\", \"actions\": [], \"progress\": 0, \"intermediate_image_urls\": null }, \"meta\": {}, \"detail\": null, \"logs\": [], \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: 2 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Kling Virtual Try-On `POST` https://api.piapi.ai/api/v1/task Try it out 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 flux 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 Copy ```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 ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema Generate Code object{0} Example Copy ```hljs hljs-json {} ``` Last modified: 7 days ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Reroll `POST` https://api.piapi.ai/api/v1/task Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") regenerates the images based on the new prompt and the parent task. This endpoint corresponds to the `Re-run` or `Re-roll` button from the offcial Midjourney. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Body Params application/json Generate Code model enum required Allowed value: midjourney task\\_type enum required Allowed value: reroll input object required origin\\_task\\_id string required The task ID of the parent task. prompt string optional Use this parameter to modify the original prompt from the parent task. aspect\\_ratio string optional This parameter dictates the ouput image's aspect ratio value. Default: 1:1 skip\\_prompt\\_check boolean optional Use this parameter to skip our internal prompt check. Default: false config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```hljs hljs-json { \"model\": \"midjourney\", \"task_type\": \"reroll\", \"input\": { \"origin_task_id\": \"4b12f7bf-028b-417e-9bcd-b600a6b0a03c\", \"prompt\": \"angry cat wearing hat, smoking\", \"aspect_ratio\": \"16:9\", \"skip_prompt_check\": false }, \"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 ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"ed4b09f0-1989-41f1-80ab-11570897096e\", \"model\": \"midjourney\", \"task_type\": \"reroll\", \"status\": \"pending\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"image_url\": \"\", \"image_urls\": null, \"temporary_image_urls\": null, \"discord_image_url\": \"\", \"actions\": [], \"progress\": 0, \"intermediate_image_urls\": null }, \"meta\": {}, \"detail\": null, \"logs\": [], \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: 2 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # PiAPI Penalties on Midjourney Usage These guidelines outline the appropriate usage of shared account pools for [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") Pay-As-You-Go users. Please note that these guidelines **do not apply** to Midjourney API Host-Your-Account users. INFO _(What is Pay-As-You-Go and Host-Your-Account? Check our [billings introduction](/docs/billings \"\") to learn more.)_ ## Bulk Generation Service [\\#](\\#bulk-generation-service) For inquiries regarding massive offline generation (greater than 10,000 images) using only the `Imagine` feature, please contact us. We can offer a significantly more efficient bulk solution tailored to your needs. Contact us through discord for bulk generation request!(Shortcut to our discord is on the right-top corner) ## Error Task Penalty [\\#](\\#error-task-penalty) **Penalties apply to PiAPI users who submit tasks that Midjourney considers incorrect. This applies exclusively to Pay-As-You-Go users.** Incorrect tasks include but are not limited to: 1. Banned image prompts 2. Cancellations due to image filters 3. Prompts containing banned keywords 4. Empty prompts 5. Invalid prompts 6. Invalid parameters 7. Invalid links ### Daily Limit on Incorrect Tasks [\\#](\\#daily-limit-on-incorrect-tasks) | Subscription Plan | Incorrect Tasks Allowed Per Day | Consequence of Exceeding Limit | | :-: | :-: | :-: | | Free Plan | 30 incorrect tasks / day | No more PPU tasks allowed for the day | | Creator Plan & Pro Plan | 60 incorrect tasks / day | Frozen credits from additional incorrect tasks will not be refunded | The daily limit is reset at the start of each day, following UTC time (London, UK timezone). ## Relax Task Penalty [\\#](\\#relax-task-penalty) ### Daily Relax Task Limit [\\#](\\#daily-relax-task-limit) | Subscription Plan | Daily Relax Task Limit | | :-: | :-: | | Free Plan | 100 relax tasks / day | | Creator Plan | 500 relax tasks / day | | Pro Plan | 1,500 relax tasks / day | ### Additional Relax Tasks [\\#](\\#additional-relax-tasks) **Need more relax jobs per day?** For every successful fast or turbo imagine or blend task you submit, you will gain one additional relax task allowance for the day, applicable to both imagine and blend tasks. **Exceeding the relax job limit?** For every relax job submitted beyond the daily limit, the cost of the relax job will double. **Why limit the number of relax tasks?** Firstly, Midjourney may suspend accounts that are used exclusively for relax tasks. Secondly, relax tasks take considerably longer to process compared to fast tasks. Users who submit a large number of relax tasks can significantly slow down the entire account pool system, resulting in long delays for other users. The daily limit is reset at the start of each day, following UTC time (London, UK timezone). Last modified: 2 months ago [Bulk Generation Service](#bulk-generation-service \"\") [Error Task Penalty](#error-task-penalty \"\") [Daily Limit on Incorrect Tasks](#daily-limit-on-incorrect-tasks \"\") [Relax Task Penalty](#relax-task-penalty \"\") [Daily Relax Task Limit](#daily-relax-task-limit \"\") [Additional Relax Tasks](#additional-relax-tasks \"\")# 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](/pricing) [Get Started!](https://piapi.ai/workspace/luma) ## Our blog Check out our blog for related contents! ![An image of Kling API & Luma API](images/Lumalab/kling_api_and_luma_api.webp) Dream Machine API ### [Crush it Melt it through Pika API , Kling API & Luma API](/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 API & Midjourney API - Exploring the Marvel Multiverse](images/midjourney/exploring-the-marvel-multiverse.webp) Dream Machine API ### [Luma API & Midjourney API - Exploring the Marvel Multiverse](/blogs/luma-api-and-midjourney-api-exploring-the-marvel-multiverse) Using Dream Machine API and Midjourney API we explored what famous marvel characters would look like if they were played by different actors. Such as a Tom Cruise Iron Man, Henry Cavill Wolverine, and finally RDJ Doom! ![An image of Luma's Dream Machine 1.6](images/Lumalab/luma_1_6.webp) Dream Machine API ### [Luma's Dream Machine 1.6 - Testing Camera Motion Feature through Luma API!](/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](images/Lumalab/Luma_vs_Kling.webp) Dream Machine API ### [Luma Dream Machine vs Kling - A brief comparsion using APIs](/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](images/Lumalab/Luma_vs.webp) Dream Machine API ### [Luma Dream Machine 1.5 vs 1.0 - Comparison through Luma API](/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! And, we also provide custom model deployment solutions! ![An image of a futuristic jet generated by PiAPI's Midjourney API](/images/Lumalab/Lumalab_otherAPIs_midjourney_image_white.webp) ### [Midjourney API](/midjourney-api) We provide the most stable and cost effective (unofficial) Midjourney API on the market, supporting two usage mode (you can host your own Midjourney account, or use our Midjourney accounts and pay-as-you-go). With fast response time and high number of concurrent jobs, our Midjourney API is a favourite among developers worldwide! ![A face swapped image from PiAPI's Faceswap API](/images/Lumalab/Faceswap_banner.webp) ### [Faceswap API](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! ![A image of a sound wave illustrating PiAPI's Suno API](/images/Lumalab/Suno_banner.webp) ### [Suno API](suno-api) Also check out our unofficial Suno API - the API to the best text-to-music generation model out there! Our API is compatible with V3, supports lyrics generation and high concurrency. With the “continue feature” and both “pay-as-you-go” and “host-your-account” options, it’s designed to meet the development needs of creators and builders worldwide. ## 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 [contact@piapi.ai](mailto:contact@piapi.ai)\\- we'd love to listen to your feedback and explore potential collaborations!![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Detailed Explaination on Midjourney Task Result This page gives detailed explaination on [PiAPI's MidjourneyAPI](https://piapi.ai/midjourney-api \"\") task result. | Parameter | Description | | :-: | --- | | discord\\_image\\_url | The exact output URL provided by the Midjourney bot. Check the second part of this page for more details. | | image\\_url | A temporary URL for the result image. Retention policies in [API Output Storage](/docs/output-storage \"\"). | | temporary\\_image\\_urls | An array of four image URLs split from the original image hosted on Midjourney CDN. Check the second part of this page for more details. | | task\\_progress | Represents the task progress as a percentage (0-100). Check the second part of this page for more details. | | intermediate\\_image\\_urls | An array of preview images displayed by Midjourney while the job is in progress. Check the second part of this page for more details. | | seed | The seed value used to generate the image, available only through the Seed operation. | | message | The message generated by PiAPI. | | error\\_messages | Error messages generated by PiAPI and Midjourney, crucial for troubleshooting. | | actions | The available next steps for this task. | ## Access to Optional Task Result Parameters [\\#](\\#access-to-optional-task-result-parameters) Certain optional parameters are only visible to users based on their subscription plans, as outlined here: [https://piapi.ai/pricing#plan#midjourney-api](https://piapi.ai/pricing#plan#midjourney-api \"\") Last modified: 4 hours ago [Access to Optional Task Result Parameters](#access-to-optional-task-result-parameters \"\")Previewing drafts. [Back to published](/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/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Create Task `POST` https://api.piapi.ai/api/v1/task Try it out INFO # Trellis 3D API The Create Task Endpoint for Trellis 3D Model Generation! Deploying the official [Trellis3D project](https://github.com/microsoft/TRELLIS \"\") from Microsoft Research $0.04 per generation ### Request Header Params Generate Code x-api-key string required your api key Body Params application/json Generate Code model string required Qubico/trellis Default: Qubico/trellis task\\_type string required image-to-3d Default: image-to-3d input object required image string required the base64 OR the url of your input image. Max image size is 1024x1024 seed integer optional random seed, default is 0 ss\\_sampling\\_steps integer optional less step means faster but less quality >= 10<= 50 Default: 50 slat\\_sampling\\_steps integer optional less step means faster but less quality >= 10<= 50 Default: 50 ss\\_guidance\\_strength number optional <= 10\\> 0 Default: 7.5 slat\\_guidance\\_strength number optional <= 10\\> 0 Default: 3 config object optional webhook\\_config object optional Example Copy ```hljs hljs-json { \"model\": \"Qubico/trellis\", \"task_type\": \"image-to-3d\", \"input\": { \"image\": \"string\", \"seed\": 0, \"ss_sampling_steps\": 50, \"slat_sampling_steps\": 50, \"ss_guidance_strength\": 7.5, \"slat_guidance_strength\": 3 }, \"config\": { \"webhook_config\": { \"endpoint\": \"string\", \"secret\": \"string\" } } } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema Generate Code completed\\_at string required created\\_at null required error null required id null required input object required generate\\_color boolean required generate\\_model boolean required generate\\_normal boolean required image string required mesh\\_simplify number required randomize\\_seed boolean required seed integer required slat\\_guidance\\_strength integer required slat\\_sampling\\_steps integer required ss\\_guidance\\_strength number required ss\\_sampling\\_steps integer required texture\\_size integer required logs string required metrics object required predict\\_time number required output object required no\\_background\\_image string required combined\\_video string required model\\_file string required started\\_at string required status string required version null required Example Copy ```hljs hljs-json { \"completed_at\": \"2024-12-11T12:50:29.319432+00:00\", \"created_at\": null, \"error\": null, \"id\": null, \"input\": { \"generate_color\": true, \"generate_model\": true, \"generate_normal\": true, \"image\": \"https://i.ibb.co/NY6W1r6/trellis.png\", \"mesh_simplify\": 0.9, \"randomize_seed\": true, \"seed\": 0, \"slat_guidance_strength\": 3, \"slat_sampling_steps\": 50, \"ss_guidance_strength\": 7.5, \"ss_sampling_steps\": 50, \"texture_size\": 1024 }, \"logs\": \"INFO:predict:Loading and preprocessing input image...\ INFO:predict:Saved image without background\ INFO:predict:Using randomized seed: 996765520\ INFO:predict:Running TRELLIS pipeline...\ Sampling: 0%| | 0/50 [00:00 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](/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 Copy ```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 ### Responses OK(200) Bad Request(400) Unauthorized(401) HTTP Code: 200 Content Type : JSONapplication/json OK-Successful Response. Data Schema 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 Copy ```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\" } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Create Task `POST` https://api.piapi.ai/api/v1/task Try it out This endpoint from [PiAPI's Dream Machine API](https://piapi.ai/dream-machine-api \"\") utilizes Dream Machine model by Luma Labs to produce text/image-to-video generation. ### 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: luma task\\_type enum required type of the task Allowed values: video\\_generationextend\\_video input object required the input param of the luma task prompt string required The prompt is a description that enables the Dream Machine API to produce a video. expand\\_prompt boolean optional The recommended value at this time is false. We have tested that the value `false` results in better quality. Default: false loop boolean optional Whether to loop the video. Default: false key\\_frames object optional If left null then the task would be a text-to-video task; if filled out, then the task would be an image-to-video or video-extend task. In an image-to-video task, the `type` of the frame can only be set to `image`, you can choose to set to frame0 and/or frame1. config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```hljs hljs-json { \"model\": \"luma\", \"task_type\": \"video_generation\", \"input\": { \"prompt\": \"Fly fishing\", \"expand_prompt\": true, \"loop\": true }, \"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 ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"f7a6d8e5-249f-4a9e-a8f4-1e8af806ea15\", \"model\": \"luma\", \"task_type\": \"video_generation\", \"status\": \"pending\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"prompt\": \"\", \"internal_state\": \"\", \"created_at\": \"\", \"video\": null, \"video_raw\": null, \"thumbnail\": null, \"last_frame\": null }, \"meta\": {}, \"detail\": null, \"logs\": null, \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: a month ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Unified API Schema ## Introduction [\\#](\\#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 [\\#](\\#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](/docs/unified-webhook \"\") for more details. ## Unified API Structure [\\#](\\#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 [\\#](\\#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.\" [\\#](\\#create-task-submit-a-task-to-generate-an-image-using-the-model-qubicoflux1-dev) ```hljs hljs-python import requests import json url = \"https://api.piapi.ai/api/v1/task\" payload = json.dumps({ \"model\": \"Qubico/flux1-dev\", \"task_type\": \"txt2img\", \"input\": { \"prompt\": \"a little cat\", \"width\": 1024, \"height\": 1024 } }) headers = { 'X-API-Key': 'YOU-PIAPI-KEY', 'Content-Type': 'application/json' } response = requests.request(\"POST\", url, headers=headers, data=payload) print(response.text) ``` #### **Get Task**: Fetch the status and results of the task once it's completed. [\\#](\\#get-task-fetch-the-status-and-results-of-the-task-once-its-completed) ```hljs hljs-python import requests url = \"https://api.piapi.ai/api/v1/task/56ea8da3-8507-4118-9f1e-111111111111\" payload={} headers = { 'X-API-Key': 'YOUR_PIAPI_KEY', 'Content-Type': 'application/json' } response = requests.request(\"GET\", url, headers=headers, data=payload) print(response.text) ``` ## Important Note [\\#](\\#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. * * * Last modified: 2 months ago [Introduction](#introduction \"\") [Key Benefits of the Unified API](#key-benefits-of-the-unified-api \"\") [Unified API Structure](#unified-api-structure \"\") [Example Workflow](#example-workflow \"\") [Create Task: Submit a task to generate an image using the model \"Qubico/flux1-dev.\"](#create-task-submit-a-task-to-generate-an-image-using-the-model-qubicoflux1-dev \"\") [Get Task: Fetch the status and results of the task once it's completed.](#get-task-fetch-the-status-and-results-of-the-task-once-its-completed \"\") [Important Note](#important-note \"\")![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Blend `POST` https://api.piapi.ai/mj/v2/blend Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") merges two to five input images. This endpoint corresponds to the `Blend` command from the official Midjourney. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Example: {{x-api-key}} Body Params application/json Generate Code image\\_urls array\\[string\\] required Provide two to five image URLs into this parameter bot\\_id integer optional Only Host-Your-Account users on the Pro Plan can use this parameter. This parameter specifies which Midjourney account will process this task. process\\_mode string optional This parameter indicates the operation process mode: relax/fast/turbo. webhook\\_endpoint string optional Task notifications will be sent to the indicated address. The acceptable address can either be a domain or port 443. webhook\\_secret string optional This value will be passed as the x-webhook-secret field in the headers as part of the response. dimension string optional This parameter sets the dimension field. The default aspect ratio: 1:1. Valid values: square/portrait/landscape Example Copy ```hljs hljs-json { \"image_urls\": [\\ \"https://image_1.png\",\\ \"https://image_2.png\"\\ ], \"process_mode\": \"fast\", \"webhook_endpoint\": \"\", \"webhook_secret\": \"\" } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema Generate Code task\\_id string optional status string optional message string optional ExampleExample 1 Copy ```hljs hljs-json { \"task_id\": \"36725357**************2709a83babf8b\", \"status\": \"success\", \"message\": \"request Content-Type isn't multipart/form-data\" } ``` Last modified: 3 months agoPreviewing drafts. [Back to published](/api/disable-draft) # Midjourey V6.1 through Midjourney 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/40e5e0450323cd2fca0e988fe0d78d266cdaed59-1024x1024.webp?rect=0,256,1024,512&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 July 31, 2024 Hi developers! As you probably already know, the founder and CEO of Midjourney DavidH posted on July 30th 2024 in [Midjourney's Discord server](https://discord.gg/midjourney) that Midjourney V6.1 is here, perfect for all y'all developers to try out! :D ![A screenshot of Midjourney CEO David posting about the new V6.1 model](https://cdn.sanity.io/images/pr53lcef/production/e89e0e63f931b371ebf5bdb0fbfab04a6dc508ad-4378x2475.png?q=75&fit=clip&auto=format)Midjourney V6.1 Announcement ## Midjourney V6.1 Update! Alright, so let's check out the new improvements with the V6.1 model of Midjourney! 1. 25% faster - all you developers who are complaining about fast tasks are too expensive but relax jobs are too slow, you might be excited about this one! 2. Better quality! Better images for arms, legs, body parts, plants, animals, etc! 3. Picture enhancement - eyes, faces, hands all getting improvement in detail 4. Textual Accuracy - when you put texts in quotation marks in prompts, the new model will generate pictures with these texts with higher accuracy! 5. Lastly, users don't have to add --v 6.1 to try the new model, the new V6.1 model will be selected as a default and users can use the --v parameter to choose the previous model versions as they desire. ## Accessing the Midjourney V6.1 model through API! As you might have already guessed, since Midjourney has decided that users will switch to the V6.1 model by default; therefore for developer's using our [Midjourney API](https://piapi.ai/midjourney-api), no changes to the existing code is needed to try out the V6.1 model. And if you want to try previous model versions, you can just add the --v parameter as per [Midjourney documentation](https://docs.midjourney.com/docs/model-versions). Below are two sample cURL code for your reference. **[Midjourney API Imagine Endpoint](https://piapi.ai/docs/midjourney-api/imagine) call using the V6.1 model** _`curl --location 'https://api.piapi.ai/mj/v2/imagine' \\`_ _`--header 'X-API-Key: your_api_key' \\`_ _`--header 'Content-Type: application/json' \\ `_ _`--data '{`_ _`\"prompt\": \"a boy running in the park, arms in swaying back and forth, wearing a t-shirt saying '\\''Love Midjourney'\\'' \", `_ _`\"process_mode\": \"fast\",`_ _`\"aspect_ratio\": \"\", `_ _`\"webhook_endpoint\": \"\", `_ _`\"webhook_secret\": \"\" `_ _`}'`_ **Midjourney API Imagine Endpoint call using the V6 model** _`curl --location 'https://api.piapi.ai/mj/v2/imagine' \\`_ _`--header 'X-API-Key: your_api_key' \\ `_ _`--header 'Content-Type: application/json' \\ `_ _`--data '{ `_ _`\"prompt\": \"a picture of pianist playing piano, wearing a golden ring on the index finger of the right hand, face focused with concentration --v 6 \", `_ _`\"process_mode\": \"fast\", `_ _`\"aspect_ratio\": \"\", `_ _`\"webhook_endpoint\": \"\", `_ _`\"webhook_secret\": \"\" `_ _`}'`_ ## V6.1 vs V6 Model Comparison And you know we can't wrap this blog up without some actual test comparison on these two models. Since Midjourney mentioned what V6.1 will excel at, we have tried the following prompts to illustrate actual test results on quality of detail, quality of body parts, text accuracy, generation speed, etc. And of course, all the tests below are ran using [Midjourney API](https://piapi.ai/midjourney-api) from PiAPI! ![A picture of a boy running in the park generated by Midjourney API using model V6.1](https://cdn.sanity.io/images/pr53lcef/production/fb282132033c16484770251cc83ca87ffd209f88-2048x2048.png?q=75&fit=clip&auto=format)V6.1 \\| \"a boy running in the park, arms in swaying back and forth, wearing a t-shirt saying 'Love Midjourney'\" ![A picture of a boy running in the park generated by Midjourney API using model V6](https://cdn.sanity.io/images/pr53lcef/production/da9c8d52392051527a4bdc1b6a9d180bdbb63537-2048x2048.png?q=75&fit=clip&auto=format)V6 \\| \"a boy running in the park, arms in swaying back and forth, wearing a t-shirt saying 'Love Midjourney'\" As you can see above, although there aren't too much difference in terms of the accuracy of the arms, the letter \"Love Midjourney\" is much better traced in V6.1! ![A person playing piano - generated by Midjourney V6.1](https://cdn.sanity.io/images/pr53lcef/production/930821a0e574c105fc3d95eb65b38265e33cf31a-2048x2048.png?q=75&fit=clip&auto=format)V6.1 \\| \"a picture of pianist playing piano, wearing a golden ring on the index finger of the right hand, face focused with concentration\" ![A person playing piano - generated by Midjourney V6](https://cdn.sanity.io/images/pr53lcef/production/fc2d1cf09f2f335f3910465d5fc27faad54055b8-2048x2048.png?q=75&fit=clip&auto=format)V6 \\| \"a picture of pianist playing piano, wearing a golden ring on the index finger of the right hand, face focused with concentration\" As shown above, there seem to be a slight improvement of the hand illustration in V6.1. ![A picture of a basketball player dunking - generated by the V6.1 model](https://cdn.sanity.io/images/pr53lcef/production/e4c96ef78d75d5b34a8ef2a8a35b94b8a7741c0b-2048x2048.png?q=75&fit=clip&auto=format)V6.1 \\| \"a basketball star dunking midair, 'Best Dad in Town' shown on his jersey, tongues out, face with concentration\" ![A picture of a basketball player dunking - generated by the V6 model](https://cdn.sanity.io/images/pr53lcef/production/cc988ae10ff555603cc731c4afbb5980e715cbf2-2048x2048.png?q=75&fit=clip&auto=format)V6 \\| \"a basketball star dunking midair, 'Best Dad in Town' shown on his jersey, tongues out, face with concentration\" As you can see, again text adherence is definitely better for V6.1 The motion of the arms, legs and hands are a bit more natural in V6.1. The part with how the tongue is interacting with the face is however quite off for both models, presumably due to the abnormally large tongue. Although this is probably understandable given the lack of realistic training data. Note the two pictures are processed in relax mode, and since our Midjourney API tracks the numbers of seconds that tasks used to generation, below are the times for the two jobs V6.1: 80 seconds V6: 88 seconds ## Conclusion And that is it! As you can see, the V6.1 is definitely a bit faster than the V6 model, has significant better text adherence (although not perfect), and we can see a bit of improvement on its illustration on arms, legs, hands, etc. Like true fans, we are indeed looking forward to the future improvements from Midjourney, we hope you will have fun playing around with the V6.1 model as well! * * * ## More Stories [![](https://cdn.sanity.io/images/pr53lcef/production/7be01ce72974fe80013c4bb5bd4cc38ebb5cae78-1553x778.png?rect=0,1,1553,777&w=2000&h=1000&fit=max&auto=format)](/blogs/kling-1-6-model-through-kling-api) ### [Kling 1.6 Model through Kling API](/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)](/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](/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://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Video Generation `POST` https://api.piapi.ai/api/kling/v1/video Try it out This endpoint from [PiAPI's Kling API](https://piapi.ai/kling-api \"\") utilizes Kling AI model by [Kuaishou](https://kling.kuaishou.com/ \"\") to produce text/image-to-video generation. ### Request Header Params Generate Code X-API-key string required Your API KEY used for request authorization Body Params application/json Generate Code negative\\_prompt string optional negative prompt of your video, can be empty prompt string required prompt of your video creativity number optional a number between 0 to 1, the lower the more creative duration number optional can only be `5` or `10`, defaults to `5` aspect\\_ratio string required can only be `16:9`, `9:16`, `1:1` professional\\_mode boolean optional PAID KLING PLAN NEEDED. Default to false, visit Kling AI official product to get the definition of professional mode image\\_url string optional initial frame of the video, DO NOT pass this param if you just want text-to-video tail\\_image\\_url string optional PAID KLING PLAN NEEDED. End frame of the video, DO NOT pass this param if you just want text-to-video camera object optional camera control of the video, effective in text-to-image ONLY. TRY it on Kling official website before using this param type string optional horizontal number optional vertical number optional zoom number optional tilt number optional pan number optional roll number optional Example Copy ```hljs hljs-json { \"negative_prompt\": \"string\", \"prompt\": \"string\", \"creativity\": 0, \"duration\": 0, \"aspect_ratio\": \"string\", \"professional_mode\": true, \"image_url\": \"string\", \"tail_image_url\": \"string\", \"camera\": { \"type\": \"string\", \"horizontal\": 0, \"vertical\": 0, \"zoom\": 0, \"tilt\": 0, \"pan\": 0, \"roll\": 0 } } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK-Successful Response Data Schema Generate Code code integer optional data object optional task\\_id string optional message string optional Example Copy ```hljs hljs-json { \"code\": 0, \"data\": { \"task_id\": \"string\" }, \"message\": \"string\" } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Video Generation `POST` https://api.piapi.ai/api/luma/v1/video Try it out This endpoint from [PiAPI's Dream Machine API](https://piapi.ai/dream-machine-api \"\") utilizes Dream Machine model by Luma Labs to produce text/image-to-video generation. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Body Params application/json Generate Code prompt string required The prompt is a description that enables the Dream Machine API to produce a video. expand\\_prompt boolean required The recommended value at this time is `false`. We have tested that the value `false` results in better quality. image\\_url string optional Insert the link of the image to generate the video from image. image\\_end\\_url string optional the end frame of the video loop boolean optional default to false Example Copy ```hljs hljs-json { \"prompt\": \"A flying cat\", \"expand_prompt\": true, \"image_url\": \"https://iili.io/dKqFZ9n.md.png\" } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema Generate Code code integer optional data object optional task\\_id string optional message string optional ExampleExample 1 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"6c4e**********************aaa\" }, \"message\": \"success\" } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Reroll `POST` https://api.piapi.ai/mj/v2/reroll Try it out This endpoint from [PiAPI's Midjourney API](https://piapi.ai/midjourney-api \"\") regenerates the images based on the new prompt and the parent task. This endpoint corresponds to the `Re-run` or `Re-roll` button from the offcial Midjourney. ### Request Header Params Generate Code X-API-Key string required Insert your API Key here Example: {{x-api-key}} Body Params application/json Generate Code origin\\_task\\_id string required The task ID of the parent task. prompt string optional Use this parameter to modify the original prompt from the parent task. skip\\_prompt\\_check boolean optional Use this parameter to skip our internal prompt check. Default value: False. webhook\\_endpoint string optional Task notifications will be sent to the indicated address. The acceptable address can either be a domain or port 443. webhook\\_secret string optional This value will be passed as the x-webhook-secret field in the headers as part of the response. Example Copy ```hljs hljs-json { \"origin_task_id\": \"6886fc4d************d912733806d5\", \"prompt\": \"a cute cat\", \"skip_prompt_check\": false, \"webhook_endpoint\": \"\", \"webhook_secret\": \"\" } ``` ### Request samples Shell JavaScript Java Swift Go PHP Python HTTP C C# Objective-C Ruby OCaml Dart R ### Responses OK(200) Bad Request(400) Unauthorized(401) Server Error(500) HTTP Code: 200 Content Type : JSONapplication/json OK - Successful response Data Schema Generate Code task id string optional status string optional message string optional ExampleExample 1 Copy ```hljs hljs-json { \"task_id\": \"1a8149b1*************a644936daa21\", \"status\": \"success\", \"message\": \"\" } ``` Last modified: 3 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Cancel Task `DELETE` https://api.piapi.ai/api/v1/task/{task\\_id} Try it out This endpoint from [PiAPI's Drean Machine API](https://piapi.ai/dream-machine-api \"\") allows you to cancel a task hat have not yet started, i.e., tasks in the `pending` state. Once a task has entered the `processing` state, it can no longer be canceled. ### Request Path Params Generate Code task\\_id string required The task\\_id of the task you want to cancel. 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 ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema Generate Code code integer required message string required Example Copy ```hljs hljs-json { \"code\": 200, \"message\": \"task 170b8a42-xxxx-xxxx-xxxx-xxxxxxx8c79e canceled\" } ``` Last modified: 2 months ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Create Task `POST` https://api.piapi.ai/api/v1/task Try it out This endpoint from [PiAPI's Dream Machine API](https://piapi.ai/dream-machine-api \"\") utilizes Dream Machine model by Luma Labs to produce text/image-to-video generation. ### 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: luma task\\_type enum required type of the task Allowed values: video\\_generationextend\\_video input object required the input param of the luma task prompt string required The prompt is a description that enables the Dream Machine API to produce a video. expand\\_prompt boolean optional The recommended value at this time is false. We have tested that the value `false` results in better quality. Default: false loop boolean optional Whether to loop the video. Default: false key\\_frames object optional If left null then the task would be a text-to-video task; if filled out, then the task would be an image-to-video or video-extend task. In an image-to-video task, the `type` of the frame can only be set to `image`, you can choose to set to frame0 and/or frame1. config object optional webhook\\_config object optional Webhook provides timely task notifications. Check [PiAPI webhook](/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 Copy ```hljs hljs-json { \"model\": \"luma\", \"task_type\": \"video_generation\", \"input\": { \"prompt\": \"Fly fishing\", \"expand_prompt\": true, \"loop\": true }, \"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 ### Responses Success(200) HTTP Code: 200 Content Type : JSONapplication/json Data Schema 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 Copy ```hljs hljs-json { \"code\": 200, \"data\": { \"task_id\": \"f7a6d8e5-249f-4a9e-a8f4-1e8af806ea15\", \"model\": \"luma\", \"task_type\": \"video_generation\", \"status\": \"pending\", \"config\": { \"service_mode\": \"public\", \"webhook_config\": { \"endpoint\": \"\", \"secret\": \"\" } }, \"input\": {}, \"output\": { \"prompt\": \"\", \"internal_state\": \"\", \"created_at\": \"\", \"video\": null, \"video_raw\": null, \"thumbnail\": null, \"last_frame\": null }, \"meta\": {}, \"detail\": null, \"logs\": null, \"error\": { \"code\": 0, \"raw_message\": \"\", \"message\": \"\", \"detail\": null } }, \"message\": \"success\" } ``` Last modified: a month ago![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI [Home](https://piapi.ai) [Workspace](https://app.piapi.ai) More ![](https://assets.apidog.com/app/static/apidoc/nav-right-side-icons/3.svg) ![](https://assets.apidog.com/app/project-icon/custom/20241009/482dc896-55d5-49bc-93d8-0ac091ec6f2a.png)PiAPI Light Mode # Overview ## What is PiAPI? [\\#](\\#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 [\\#](\\#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](/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](/docs/unified-webhook \"\") services integrated with our [Unified API Schema](/docs/unified-api-schema \"\") for timely update and notifications. ## Available APIs [\\#](\\#available-apis) Image Models Video Models Audio Models LLM ## What is Pay-as-you-go vs Host-your-account? [\\#](\\#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 Midjourney/ChatGPT/Kling/Luma/Suno/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 Midjourney/ChatGPT/Kling/Luma/Suno/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. **Reliability**: For APIs where both service options are available, the most reliable way is to for you to use **both Pay-per-use and Host-your-account** service options to reduce the possibility of downtime associated with account operation related issues. For example, you could primarily use Pay-as-you-go and have your own Host-your-account as backup; or in the case of Midjourney API, you could use your Host-your-accounts and failover to our Pay-as-you-go (there is a toggle for this failover logic on the [Workspace](https://app.piapi.ai/ \"\").). ## Quick Start [\\#](\\#quick-start) To start using the PiAPI, follow the [Quickstart](/docs/quickstart \"\") guide to set up your environment and make your first API call. Last modified: 2 months ago [What is PiAPI?](#what-is-piapi \"\") [Key Features](#key-features \"\") [Available APIs](#available-apis \"\") [What is Pay-as-you-go vs Host-your-account?](#what-is-pay-as-you-go-vs-host-your-account \"\") [Quick Start](#quick-start \"\")