| Title: | Official Server-Side R Client for 'Wan27' AI Image and Video Generation |
|---|---|
| Description: | Server-side R client for the 'Wan27' (<https://wan2-7.io/>) AI image and video generation API and MCP workflow ecosystem (<https://wan2-7.io/mcp/>). Provides functions to inspect account eligibility and credit balances, list supported models and input schemas, estimate credit costs before spending, submit idempotent generation requests with explicit request IDs, and poll task states. Uses 'jsonlite' and 'curl' when installed, with a dependency-free base R fallback for offline testing and lightweight environments. |
| Authors: | Wan27 Team [aut, cre] |
| Maintainer: | Wan27 Team <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-28 16:58:06 UTC |
| Source: | https://github.com/NotUsingGithub/wan27-r |
Queries GET /api/v1/account/ to inspect active subscription eligibility
and available credits on https://wan2-7.io/.
wan27_account_balance(client)wan27_account_balance(client)
client |
A |
A list representing the JSON response from the service.
Creates a configured client for https://wan2-7.io/api/v1/. Supply an existing access token from your server-side environment. See https://wan2-7.io/mcp/guide/ and https://wan2-7.io/pricing/ for authentication and credit details.
wan27_client( token = Sys.getenv("WAN27_ACCESS_TOKEN"), timeout = 120, handler = NULL )wan27_client( token = Sys.getenv("WAN27_ACCESS_TOKEN"), timeout = 120, handler = NULL )
token |
Character scalar access token. Defaults to |
timeout |
Numeric timeout in seconds (greater than 0 and at most 120). |
handler |
Optional custom HTTP transport function used for offline unit tests. |
An object of class "wan27_client".
client <- wan27_client(token = "wan27_test_token_example") print(client)client <- wan27_client(token = "wan27_test_token_example") print(client)
Sends POST /api/v1/estimates/ to calculate the credit cost of an input
payload without creating a paid task. See https://wan2-7.io/pricing/.
wan27_estimate(client, input)wan27_estimate(client, input)
client |
A |
input |
Named list of model parameters (must include |
A list containing the estimated credit cost.
Submits an idempotent generation task to POST /api/v1/generations/ on
https://wan2-7.io/. Requires an explicit request_id so network
timeouts can be safely inspected and retried without double-charging.
wan27_generate(client, input, request_id) wan27_generate_image( client, prompt, request_id, model_id = "wan27-text-to-image", ... ) wan27_generate_video( client, prompt, request_id, model_id = "wan27-text-to-video", ... )wan27_generate(client, input, request_id) wan27_generate_image( client, prompt, request_id, model_id = "wan27-text-to-image", ... ) wan27_generate_video( client, prompt, request_id, model_id = "wan27-text-to-video", ... )
client |
A |
input |
Named list of generation parameters. |
request_id |
Character scalar idempotency key (16–128 characters). |
prompt |
Character scalar text prompt for helper wrappers. |
model_id |
Character scalar model identifier. |
... |
Additional named parameters forwarded to |
A list containing the created task record (including task$id).
wan27_list_tasks() lists recent tasks with optional pagination, and
wan27_get_task() retrieves the current status and outputs of a single
task. Only status == "succeeded" indicates completion.
wan27_get_task(client, task_id) wan27_list_tasks(client, limit = 20L, cursor = NULL)wan27_get_task(client, task_id) wan27_list_tasks(client, limit = 20L, cursor = NULL)
client |
A |
task_id |
Character scalar task identifier. |
limit |
Integer between 1 and 50 (default 20). |
cursor |
Optional character scalar pagination cursor from a previous response. |
A list representing the task or task collection.
wan27_models() lists currently supported models, while
wan27_model() fetches the input schema for a specific model_id.
wan27_models(client) wan27_model(client, model_id)wan27_models(client) wan27_model(client, model_id)
client |
A |
model_id |
Character scalar model identifier (for example, |
A list representing the JSON response from the service.
Returns a named list of official Wan27 documentation, MCP, CLI, pricing, and API endpoint URLs.
wan27_urls()wan27_urls()
A named list of character strings containing URLs for https://wan2-7.io/, https://wan2-7.io/mcp/, https://wan2-7.io/mcp/guide/, https://wan2-7.io/cli/, and https://wan2-7.io/pricing/.
urls <- wan27_urls() urls$website urls$mcpurls <- wan27_urls() urls$website urls$mcp