Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RunAPI

Wan API SDKs for JavaScript, Python, Ruby, Go, Java, and PHP on RunAPI.

npm PyPI RubyGems Go Reference Maven Central License


The Wan API SDK packages JavaScript, Python, Ruby, Go, Java, and PHP clients for Wan on RunAPI. Use it for text-to-video, image-to-video, speech-to-video, animation, text-to-image, and edit-video workflows when your app needs typed request builders, predictable task polling, file upload helpers, account helpers, and consistent RunAPI errors.

Wan is listed in the RunAPI model catalog at https://runapi.ai/models/wan. Variant pages below carry pricing, rate-limit, and commercial-usage details. The public wan-sdk repository groups the non-PHP language packages, examples, CI, and release tags for this model. The PHP package is released from a split Composer repository.

Install

npm install @runapi.ai/wan
pip install runapi-wan
gem install runapi-wan
go get github.com/runapi-ai/wan-sdk/go@latest

Gradle:

dependencies {
  implementation("ai.runapi:runapi-wan:0.1.2")
}

Maven:

<dependency>
  <groupId>ai.runapi</groupId>
  <artifactId>runapi-wan</artifactId>
  <version>0.1.2</version>
</dependency>

Use the Java BOM when installing multiple RunAPI Java modules:

dependencies {
  implementation(platform("ai.runapi:runapi-bom:0.2.6"))
  implementation("ai.runapi:runapi-wan")
}

The PHP package is published from the split Composer repository as runapi-ai/wan; see https://github.com/runapi-ai/wan-php for PHP install and examples.

What you can build

  • Build apps, agent workflows, batch jobs, and production services around Wan requests.
  • Install only the language package your app needs while keeping one model-specific repository for docs and releases.
  • Use create for submit-only jobs, get for status lookup, and run for submit-and-poll scripts.
  • Upload local files, URL files, or base64 files through shared RunAPI file helpers.
  • Handle validation, authentication, rate limits, insufficient credits, task failures, and polling timeouts through RunAPI SDK errors.

Java quick start

import ai.runapi.wan.WanClient;
import ai.runapi.wan.types.TextToVideoParams;
import ai.runapi.wan.types.CompletedTextToVideoResponse;
import ai.runapi.wan.types.TextToVideoModel;

WanClient client = WanClient.builder()
    .apiKey(System.getenv("RUNAPI_API_KEY"))
    .build();

CompletedTextToVideoResponse result = client.textToVideo().run(
    TextToVideoParams.builder()
        .model(TextToVideoModel.WAN_2_6_TEXT_TO_VIDEO)
        .prompt("A scenic mountain landscape with flowing rivers")
        .outputResolution("1080p")
        .aspectRatio("16:9")
        .durationSeconds(5)
        .build()
);

Java packages target Java 8 bytecode and are tested on Java 8, 11, 17, and 21. Each model artifact depends on ai.runapi:runapi-core, so application code normally installs only ai.runapi:runapi-wan.

Task lifecycle

Most media endpoints are asynchronous. create() submits a task and returns its id, get(id) fetches the latest task state, and run(params) creates the task and polls until it reaches a terminal state. In web request handlers, prefer create() plus webhook or later get() polling so the server does not hold a worker open.

Repository layout

  • js/ publishes @runapi.ai/wan.
  • python/ publishes runapi-wan.
  • ruby/ publishes runapi-wan.
  • go/ publishes github.com/runapi-ai/wan-sdk/go.
  • java/ publishes ai.runapi:runapi-wan and uses ai.runapi:runapi-core.

Public links

Pricing and variants

Use the most specific Wan variant page for pricing, rate limits, and commercial usage:

Default pricing link for the Wan SDK: https://runapi.ai/models/wan/2.2-a14b-text-to-video-turbo

File storage

RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.

FAQ

Which package should I install for Wan work?

Install the model package for your language: @runapi.ai/wan on npm, runapi-wan on PyPI, runapi-wan on RubyGems, github.com/runapi-ai/wan-sdk/go, ai.runapi:runapi-wan on Maven Central, or runapi-ai/wan on Packagist. Install core SDK packages only when you are building shared SDK infrastructure.

Where should public links point?

Primary Wan links point to https://runapi.ai/models/wan. Pricing and usage-policy links point to variant pages such as https://runapi.ai/models/wan/2.2-a14b-text-to-video-turbo. Provider comparisons point to https://runapi.ai/providers/alibaba, and broad browsing points to https://runapi.ai/models.

License

Licensed under the Apache License, Version 2.0.

About

RunAPI Wan SDK for text-to-video, image-to-video, speech-to-video, animation, text-to-image, and edit-video workflows in JavaScript, Python, Ruby, Go, Java, and PHP

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages