wan27 — R Client for Wan27 AI Image & Video Generation

An R client for Wan27, an AI image and video generation service and MCP workflow platform. Discover supported models, inspect input schemas, estimate credit costs, submit idempotent generation tasks, and poll task results from R scripts, Quarto/RMarkdown reports, or Shiny back ends.

The R package is MIT licensed. Calling the hosted API requires an active paid Wan27 subscription, and media generation spends credits. A credit pack alone does not enable API access.

Installation

Install from R-universe:

install.packages("wan27", repos = c("https://notusinggithub.r-universe.dev", "https://cloud.r-project.org"))

Or install from GitHub:

# install.packages("remotes")
remotes::install_github("NotUsingGithub/wan27-r")

Quick Start

library(wan27)

# Inspect official documentation and endpoint URLs
wan27_urls()

# Server-side only: supply an existing access token from your environment
client <- wan27_client(token = Sys.getenv("WAN27_ACCESS_TOKEN"))

# Check account eligibility and credit balance
wan27_account_balance(client)

# Read model schema and estimate credit cost before spending
wan27_model(client, "wan27-text-to-video")

input <- list(
  modelId = "wan27-text-to-video",
  prompt = "A paper boat drifting through a rain puddle, gentle tracking shot",
  durationSeconds = 5L,
  resolution = "720p"
)
wan27_estimate(client, input)

# Only after user authorization of the estimated spend:
request_id <- "req_20261028_paper_boat_0001" # 16-128 chars; persist before calling
task <- wan27_generate(client, input, request_id = request_id)

# Poll task state by ID
wan27_get_task(client, task$id)

Safety & Idempotency Guidelines

Links & Documentation