Getting Started With the WaifuRush API
A high-level tour of the WaifuRush REST API: create an API key, upload an image, create a video and poll its status. Links to the full API docs.
ガイドは英語で書かれています。
Everything you can do in the WaifuRush studio is a request to a generation service, and the same service is available to developers through a REST API. If you want to animate images from your own app, a bot, a game tool or a content pipeline, the API is the route.
This guide is a high-level tour of the workflow. It explains the moving parts and the order in which you use them. For endpoint-by-endpoint detail, request fields and examples, use the API documentation, which is the source of truth.
The full reference lives in the API docs.
Open the API docsWhat the API is for
The API does what the studio does: it turns anime images into short videos, makes image packs and writes captions. The products map to the studio modes:
- A loop product: one start image in, a seamless 5 second loop out.
- A pro video product: a start image, an end image or both, with an optional idea, and a duration of 5, 8, 10 or 15 seconds.
- A continuation product: continues an earlier video, with an optional end image and idea.
- A live wallpaper product: one start image plus a motion level, returning a video and its best seamless loop.
- Image packs (POST /packs): one or two characters in, a set of 8 to 120 images out.
- Captions (POST /captions): your images in, each returned with a caption written for it.
Video options mirror the studio as well: 480p or 720p resolution and Fast (turbo) or Standard quality. The video follows the aspect ratio of your image among 21:9, 16:9, 4:3, 1:1, 3:4 and 9:16.
The workflow in four steps
1. Create an API key
Sign in and open Settings, then the API section, to create a key. Keep it secret: treat it like a password, store it in an environment variable or a secrets manager on your server, and never ship it in a web page or a mobile app. If a key leaks, revoke it and create a new one.
2. Upload an image
Generation starts from an image, so the first call sends yours to WaifuRush. You get back a reference to the uploaded image that you will pass when you create a video. Prepare the image as you would for the studio: sharp, clean, and in the aspect ratio you want for the result.
Image preparation applies to API requests too.
Read: preparing input images3. Create a video
Next you request a video by choosing the product, passing the image reference and setting the options: resolution, quality, duration where the product supports it, and a motion level for wallpapers. Creating a video is asynchronous. The call returns right away with an identifier for your job, because the clip is not ready yet.
Generation takes time. A job can wait in a queue, and when a GPU must start from cold it can take a few minutes before any progress appears. Design your integration around that: do not hold a request open for the result, and do not assume a fixed duration.
4. Poll the status
Use the job identifier to check its status until it reaches a final state. A finished job gives you a link to the resulting MP4; a failed one tells you it failed. Poll at a calm interval, for example every few seconds, rather than as fast as you can, and give up gracefully after a long time instead of looping forever.
Design your integration around reality
- Asynchronous by nature: store the job identifier in your own database so that a restart of your service does not lose track of work in flight.
- Idempotent where possible: if your request times out and you are unsure whether it was received, check before sending the same request again so you do not pay for duplicates. The docs describe how requests are identified.
- Credits: API generations spend credits from your account, like the studio does. Cost depends on the options you choose; resolution, quality and duration all matter. Test with 480p and Fast, the lighter options, before you scale up.
- Failures happen: a job can fail. Handle it by reporting the failure to the user and offering a retry, rather than retrying silently in a loop.
- Downloads: save the finished video to your own storage if you need it long term, instead of linking to it forever.
A realistic first project
A small first integration might look like this:
- A user sends an image to your service, for example through a bot command or a web form.
- Your server uploads the image with your API key and creates a loop video at 480p with Fast quality.
- Your server stores the job identifier and polls its status every few seconds.
- When the job finishes, your server sends the MP4 back to the user.
- If the job fails, your server says so and offers to try again.
This shape, accept, submit, store, poll, deliver, covers most integrations, from a Discord bot to a batch tool that animates a folder of illustrations.
Things to keep in mind
- Do not write the model prompt yourself: WaifuRush writes it from your image. Where a product accepts a short idea, keep it short and physical, as in the studio.
- Respect the content policy of the platform. The policy applies to outputs created through the API as well.
- Outputs follow the same rules as the studio regarding plans, such as private creations and commercial use, so check the pricing page for your plan.
Where to go next
Read the API documentation for authentication, the request fields of each product, the status values and error handling. If you are still exploring what each product does, spend a little time in the studio first and come back.
Ready to build? Start with the API documentation.
Go to the API docsWant to see what the products do before you code?
Open the studio