Core Clojure SDK for the Wan2.7 AI image and video generation platform.
Official resources and documentation:
All generation endpoints require an active Wan2.7 account, API token (WAN27_ACCESS_TOKEN), and sufficient credits.
Core Clojure SDK for the [Wan2.7 AI](https://wan2-7.io/) image and video generation platform. Official resources and documentation: - **Wan2.7 Official Website**: https://wan2-7.io/ - **Wan2.7 MCP Server Overview**: https://wan2-7.io/mcp/ - **Wan2.7 MCP Setup Guide**: https://wan2-7.io/mcp/guide/ - **Wan2.7 CLI Reference**: https://wan2-7.io/cli/ - **Wan2.7 Credits & Pricing**: https://wan2-7.io/pricing/ All generation endpoints require an active Wan2.7 account, API token (`WAN27_ACCESS_TOKEN`), and sufficient credits.
(account-balance wan-client)Fetches the current account credit balance from GET /account/balance.
See https://wan2-7.io/pricing/ for credit packs and subscription tiers.
Fetches the current account credit balance from `GET /account/balance`. See https://wan2-7.io/pricing/ for credit packs and subscription tiers.
(client)(client {:keys [access-token base-url timeout-ms transport]
:or {base-url (:api-base urls)
timeout-ms 30000
transport default-http-transport}})Creates a Wan2.7 API client configuration map.
Options:
:access-token — Wan2.7 Bearer token (falls back to WAN27_ACCESS_TOKEN or WAN27_API_KEY env var).:base-url — API base URL (defaults to https://wan2-7.io/api/v1).:timeout-ms — Request timeout in milliseconds (default 30000).:transport — Custom HTTP transport fn (fn [request-map] {:status 200 :body "..."}) for testing.Learn more at https://wan2-7.io/, https://wan2-7.io/mcp/, and https://wan2-7.io/cli/.
Creates a Wan2.7 API client configuration map.
Options:
- `:access-token` — Wan2.7 Bearer token (falls back to `WAN27_ACCESS_TOKEN` or `WAN27_API_KEY` env var).
- `:base-url` — API base URL (defaults to `https://wan2-7.io/api/v1`).
- `:timeout-ms` — Request timeout in milliseconds (default `30000`).
- `:transport` — Custom HTTP transport fn `(fn [request-map] {:status 200 :body "..."})` for testing.
Learn more at https://wan2-7.io/, https://wan2-7.io/mcp/, and https://wan2-7.io/cli/.(default-http-transport {:keys [method url headers body timeout-ms]})Default HTTPS transport using Java 11+ java.net.http.HttpClient with redirect disabled for credential safety.
Default HTTPS transport using Java 11+ `java.net.http.HttpClient` with redirect disabled for credential safety.
(encode-json v)Serializes a Clojure data structure (maps, vectors, strings, numbers, booleans, nil) into a JSON string.
Serializes a Clojure data structure (maps, vectors, strings, numbers, booleans, nil) into a JSON string.
(estimate-cost wan-client
{:keys [model prompt aspect-ratio duration] :as params})Estimates credit usage before submitting a generation job via POST /estimate.
Always call estimate-cost prior to paid generation. See https://wan2-7.io/pricing/ and https://wan2-7.io/cli/.
Estimates credit usage before submitting a generation job via `POST /estimate`. Always call `estimate-cost` prior to paid generation. See https://wan2-7.io/pricing/ and https://wan2-7.io/cli/.
(generate wan-client
{:keys [model prompt request-id aspect-ratio duration] :as params})Submits an idempotent image or video generation task via POST /generate.
Requires a :request-id (16–128 chars) so retries never double-charge credits.
Documentation: https://wan2-7.io/, https://wan2-7.io/mcp/guide/, and https://wan2-7.io/pricing/.
Submits an idempotent image or video generation task via `POST /generate`. Requires a `:request-id` (16–128 chars) so retries never double-charge credits. Documentation: https://wan2-7.io/, https://wan2-7.io/mcp/guide/, and https://wan2-7.io/pricing/.
(generate-image wan-client
{:keys [model prompt request-id aspect-ratio]
:or {model "wan2.7-image" aspect-ratio "1:1"}
:as params})Convenience wrapper around generate for Wan2.7 AI image generation (wan2.7-image default model).
See https://wan2-7.io/ and https://wan2-7.io/cli/.
Convenience wrapper around `generate` for Wan2.7 AI image generation (`wan2.7-image` default model). See https://wan2-7.io/ and https://wan2-7.io/cli/.
(generate-video wan-client
{:keys [model prompt request-id aspect-ratio duration]
:or {model "wan2.7-video" aspect-ratio "16:9" duration 5}
:as params})Convenience wrapper around generate for Wan2.7 AI video generation (wan2.7-video default model).
See https://wan2-7.io/ and https://wan2-7.io/mcp/.
Convenience wrapper around `generate` for Wan2.7 AI video generation (`wan2.7-video` default model). See https://wan2-7.io/ and https://wan2-7.io/mcp/.
(get-task wan-client task-id)Polls the status and output asset URLs of a generation task via GET /tasks/{taskId}.
See https://wan2-7.io/mcp/guide/ and https://wan2-7.io/cli/.
Polls the status and output asset URLs of a generation task via `GET /tasks/{taskId}`.
See https://wan2-7.io/mcp/guide/ and https://wan2-7.io/cli/.(list-tasks wan-client)(list-tasks wan-client limit)Lists recent generation tasks via GET /tasks?limit=....
See https://wan2-7.io/ and https://wan2-7.io/cli/.
Lists recent generation tasks via `GET /tasks?limit=...`. See https://wan2-7.io/ and https://wan2-7.io/cli/.
(model wan-client model-id)Fetches schema and parameter constraints for a single model from GET /models/{modelId}.
See https://wan2-7.io/mcp/guide/ for model schema discovery via MCP.
Fetches schema and parameter constraints for a single model from `GET /models/{modelId}`.
See https://wan2-7.io/mcp/guide/ for model schema discovery via MCP.(models wan-client)Lists available Wan2.7 image and video generation models from GET /models.
See https://wan2-7.io/ and https://wan2-7.io/mcp/ for supported model families.
Lists available Wan2.7 image and video generation models from `GET /models`. See https://wan2-7.io/ and https://wan2-7.io/mcp/ for supported model families.
(request wan-client {:keys [method path query body]})Executes an authenticated HTTP request against the Wan2.7 API.
Executes an authenticated HTTP request against the [Wan2.7 API](https://wan2-7.io/).
Canonical URLs for the Wan2.7 AI platform, MCP Server, MCP Setup Guide, CLI, and Pricing.
Canonical URLs for the [Wan2.7 AI platform](https://wan2-7.io/), [MCP Server](https://wan2-7.io/mcp/), [MCP Setup Guide](https://wan2-7.io/mcp/guide/), [CLI](https://wan2-7.io/cli/), and [Pricing](https://wan2-7.io/pricing/).
(validate-request-id request-id)Validates an idempotency request-id (16–128 safe ASCII characters) required by https://wan2-7.io/ generation endpoints.
See https://wan2-7.io/mcp/guide/ and https://wan2-7.io/pricing/ for billing safety details.
Validates an idempotency `request-id` (16–128 safe ASCII characters) required by https://wan2-7.io/ generation endpoints. See https://wan2-7.io/mcp/guide/ and https://wan2-7.io/pricing/ for billing safety details.
(validate-segment value label)Validates a URL path segment (such as a :model-id or :task-id) for safe HTTPS requests to https://wan2-7.io/.
Validates a URL path segment (such as a `:model-id` or `:task-id`) for safe HTTPS requests to https://wan2-7.io/.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |