npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@apipass-dev/apipass-sdk

v1.1.6

Published

TypeScript SDK for calling Apipass large language model APIs.

Readme

Apipass SDK for JavaScript

A small, type-friendly TypeScript SDK for calling Apipass large language model APIs.

The public API is intentionally close to popular model SDKs:

import { Apipass } from "@apipass-dev/apipass-sdk";

const apiKey = process.env.APIPASS_API_KEY;
if (!apiKey) {
  throw new Error("Set APIPASS_API_KEY before creating the Apipass client.");
}

const client = new Apipass({
  apiKey,
});

const completion = await client.chat.completions.create({
  model: "apipass-chat",
  messages: [{ role: "user", content: "Write a haiku about TypeScript." }],
});

console.log(completion.choices[0]?.message.content);

Install

npm install @apipass-dev/apipass-sdk

Configuration

const apiKey = process.env.APIPASS_API_KEY;
if (!apiKey) {
  throw new Error("Set APIPASS_API_KEY before creating the Apipass client.");
}

const client = new Apipass({
  apiKey,
  baseURL: "https://api.apipass.dev/api/v1",
  timeout: 60_000,
});

apiKey is required. If you store it in an environment variable, read it in your app and pass the resulting string explicitly.

baseURL is optional and can only be overridden by passing it explicitly to the client constructor.

Chat completion and model catalog requests use Apipass' public /v1 route. If you pass the default jobs base URL ending in /api/v1, the SDK automatically normalizes those public requests to /v1.

Resource Uploads

Upload local resources to Apipass-managed Cloudflare storage before passing their public URLs to model inputs:

const file = new Blob(["hello"], { type: "text/plain" });

const resource = await client.uploadResource({
  file,
  fileName: "resources/hello.txt",
});

console.log(resource.url);
// https://cdn.apipass.dev/resources/hello.txt

The same method is also available under the resource namespace:

const image = await client.resources.upload({
  file: imageBlob,
  folder: "images",
});

The upload helper uses your Apipass API key to request a signed upload URL from Apipass, then uploads the resource to Cloudflare with that signed URL. If fileName is omitted, the SDK generates a unique object key under folder and infers the extension from the file name or content type.

Chat Completions

const completion = await client.chat.completions.create({
  model: "apipass-chat",
  messages: [
    { role: "system", content: "You are concise." },
    { role: "user", content: "Explain embeddings in one sentence." },
  ],
  temperature: 0.3,
});

Gemini 3 Flash Preview is available as an SDK-known chat model:

import { Models } from "@apipass-dev/apipass-sdk";

const completion = await client.chat.completions.create({
  model: Models.Gemini3FlashPreview,
  messages: [{ role: "user", content: "Hello" }],
  temperature: 1,
  max_tokens: 4096,
  top_p: 1,
  frequency_penalty: 0,
  presence_penalty: 0,
});

console.log(completion.choices[0]?.message.content);

Gemini 3 Pro Preview is also available as an SDK-known chat model, with the same chat completions API:

const completion = await client.chat.completions.create({
  model: Models.Gemini3ProPreview,
  messages: [
    {
      role: "user",
      content:
        "Design a high-frequency trading platform architecture for 1M TPS.",
    },
  ],
  stream: false,
  temperature: 0.7,
  max_tokens: 8192,
  top_p: 0.95,
  frequency_penalty: 0,
  presence_penalty: 0,
});

console.log(completion.choices[0]?.message.content);

GPT-5.5 is available through the OpenAI-compatible chat completions endpoint as Models.Gpt55:

const completion = await client.chat.completions.create({
  model: Models.Gpt55,
  messages: [
    {
      role: "developer",
      content: "Write concise product copy.",
    },
    {
      role: "user",
      content:
        "Write a short product announcement for APIPASS GPT-5.5 support in ApiPass.",
    },
  ],
  stream: false,
  temperature: 0.7,
  max_tokens: 512,
  top_p: 0.9,
  frequency_penalty: 0,
  presence_penalty: 0,
  response_format: {
    type: "json_object",
  },
  include_thoughts: false,
  reasoning_effort: "low",
});

console.log(completion.choices[0]?.message.content);

The gpt-5.5 alias is also typed as a known chat model:

await client.chat.completions.create({
  model: "gpt-5.5",
  messages: [
    {
      role: "user",
      content: "Summarize the following text in three concise bullets.",
    },
  ],
});

Gemini 3 Flash Preview also accepts multimodal message content:

const completion = await client.chat.completions.create({
  model: Models.Gemini3FlashPreview,
  messages: [
    {
      role: "user",
      content: [
        { type: "text", text: "Describe this image" },
        {
          type: "image_url",
          image_url: {
            url: "https://example.com/image.jpg",
          },
        },
      ],
    },
  ],
});

Streaming

When stream: true is passed, TypeScript narrows the return type to an async iterable stream.

const stream = await client.chat.completions.create({
  model: "apipass-chat",
  messages: [{ role: "user", content: "Count to five." }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta.content ?? "");
}

Models

SDK-known model IDs are exported as constants for autocomplete-friendly usage:

import { Models } from "@apipass-dev/apipass-sdk";

await client.chat.completions.create({
  model: Models.Gemini3FlashPreview,
  messages: [{ role: "user", content: "Hello" }],
});

await client.chat.completions.create({
  model: Models.Gemini3ProPreview,
  messages: [{ role: "user", content: "Analyze this architecture." }],
  temperature: 0.7,
  max_tokens: 8192,
});

await client.chat.completions.create({
  model: Models.Gpt55,
  messages: [
    {
      role: "user",
      content:
        "Write a short product announcement for APIPASS GPT-5.5 support in ApiPass.",
    },
  ],
  temperature: 0.7,
  max_tokens: 512,
});

await client.jobs.createTask({
  model: Models.NanoBanana2,
  input: {
    prompt: "A serene alpine lake",
  },
});

await client.jobs.createTask({
  model: Models.NanoBananaPro,
  input: {
    prompt:
      "A high-quality editorial product image of a white ceramic coffee cup.",
    aspect_ratio: "LANDSCAPE",
  },
});

await client.jobs.createTask({
  model: Models.FluxProImage2,
  input: {
    prompt:
      "Hyperrealistic supermarket blister pack on clean olive green surface with pink FLUX.2 letters under stretched plastic film.",
    aspect_ratio: "1:1",
    resolution: "1K",
  },
});

await client.jobs.createTask({
  model: Models.GptImage2,
  input: {
    prompt: "A realistic product photo on a clean studio background",
    aspect_ratio: "16:9",
    quality: "medium",
    resolution: "1k",
  },
});

await client.jobs.createTask({
  model: Models.GrokImagineTextToImage,
  input: {
    prompt:
      "Cinematic portrait of a woman sitting by a vinyl record player, retro living room background, soft ambient lighting, warm earthy tones, nostalgic 1970s wardrobe, gentle film grain texture.",
    aspect_ratio: "3:2",
    enable_pro: false,
  },
});

await client.jobs.createTask({
  model: Models.GrokImagineImageToImage,
  input: {
    image_urls: ["https://example.com/reference.png"],
    prompt:
      "Recreate the Titanic movie poster with two adorable anthropomorphic cats in the same romantic pose at the bow of the ship.",
  },
});

await client.jobs.createTask({
  model: Models.QwenImage2,
  input: {
    prompt: "A cinematic mountain lake at sunrise with mist and reflective water.",
    image_size: "portrait_16_9",
    num_inference_steps: 40,
    seed: 123456,
    guidance_scale: 3.25,
    output_format: "jpeg",
    negative_prompt: "blurry, low quality",
    acceleration: "regular",
  },
});

await client.jobs.createTask({
  model: Models.Seedream5LiteImage,
  input: {
    prompt:
      "A premium cafe design SaaS hero image with architectural layout overlays and warm modern interiors.",
    aspect_ratio: "16:9",
    quality: "basic",
  },
});

await client.jobs.createTask({
  model: Models.Wan27Image,
  input: {
    prompt:
      "A cozy reading corner with warm wood shelves and soft afternoon sunlight.",
    input_urls: ["https://example.com/source.jpg"],
    aspect_ratio: "16:9",
    enable_sequential: false,
    n: 4,
    resolution: "2K",
    thinking_mode: true,
    color_palette: [{ hex: "#D7C2A3", ratio: "32.00%" }],
    bbox_list: [[120, 80, 320, 260]],
    watermark: false,
    seed: 0,
  },
});

await client.jobs.createTask({
  model: Models.Wan27ImagePro,
  input: {
    prompt:
      "A cozy reading corner with warm wood shelves and soft afternoon sunlight.",
    input_urls: ["https://example.com/source.jpg"],
    aspect_ratio: "16:9",
    enable_sequential: false,
    n: 4,
    resolution: "2K",
    thinking_mode: true,
    color_palette: [{ hex: "#D7C2A3", ratio: "32.00%" }],
    bbox_list: [[120, 80, 320, 260]],
    watermark: false,
    seed: 0,
  },
});

await client.jobs.createTask({
  model: Models.ImageFaceSwap,
  input: {
    face_image: "https://static.wavespeed.ai/examples/face.jpeg",
    image: "https://static.wavespeed.ai/examples/source.jpeg",
    target_index: 0,
    output_format: "jpeg",
    enable_base64_output: false,
  },
});

await client.jobs.createTask({
  model: Models.ImageWatermakerRemove,
  input: {
    image: "https://cdn.apipass.dev/20260506-114632.jpeg",
    output_format: "jpeg",
    enable_base64_output: false,
  },
});

await client.jobs.createTask({
  model: Models.GrokImagineImageToVideo,
  input: {
    image_urls: ["https://example.com/reference.png"],
    prompt:
      "Make the scene come alive with a slow cinematic camera push-in and subtle atmospheric motion.",
    mode: "normal",
    duration: 6,
    resolution: "480p",
    aspect_ratio: "16:9",
  },
});

await client.jobs.createTask({
  model: Models.GrokImagineTextToVideo,
  input: {
    prompt:
      "A couple of doors open to the right one by one randomly and stay open, showing tiny rooms inside with little people living and working.",
    aspect_ratio: "2:3",
    mode: "normal",
    duration: 6,
    resolution: "480p",
  },
});

await client.jobs.createTask({
  model: Models.GrokImagineExtend,
  input: {
    task_id: "task_grok_12345678",
    prompt:
      "The camera slowly pans forward, showing the protagonist walking deeper into the forest, with sunlight filtering through the leaves and casting dappled shadows.",
    extend_at: 0,
    extend_times: 6,
  },
});

await client.jobs.createTask({
  model: Models.GrokImagineUpscale,
  input: {
    task_id: "task_grok_12345678",
  },
});

await client.jobs.createTask({
  model: Models.Hailuo23,
  input: {
    prompt:
      "A serene lake surrounded by mountains at sunset, with reflections on the water",
    duration: 6,
    resolution: "768p",
    prompt_optimizer: true,
  },
});

await client.jobs.createTask({
  model: Models.OmniHuman15,
  input: {
    image_url: "https://example.com/portrait.jpg",
    audio_url: "https://example.com/audio.mp3",
    prompt: "A woman plays the piano and sings.",
    fast_mode: true,
  },
});

await client.jobs.createTask({
  model: Models.KlingAvatarV2,
  input: {
    image: "https://example.com/avatar-image.jpg",
    audio: "https://example.com/speech-audio.mp3",
    prompt:
      "A professional spokesperson delivering a speech with confident gestures",
    mode: "std",
  },
});

await client.jobs.createTask({
  model: Models.Kling26,
  input: {
    prompt:
      "A majestic dragon flying over a medieval castle at sunset, cinematic lighting, epic fantasy, 4K quality",
    start_image: "https://example.com/starting-frame.jpg",
    duration: 5,
    aspect_ratio: "16:9",
    generate_audio: true,
    negative_prompt: "blurry, low quality, distorted, watermark, text overlay",
  },
});

await client.jobs.createTask({
  model: Models.Kling26MotionControl,
  input: {
    image: [
      "https://static.aiquickdraw.com/tools/example/1767694885407_pObJoMcy.png",
    ],
    video: [
      "https://static.aiquickdraw.com/tools/example/1767525918769_QyvTNib2.mp4",
    ],
    prompt: "The cartoon character is dancing energetically",
    character_orientation: "video",
    mode: "std",
    keep_original_sound: true,
  },
});

await client.jobs.createTask({
  model: Models.KlingV3Video,
  input: {
    prompt:
      "A serene mountain landscape with a flowing river, golden hour lighting, cinematic quality.",
    negative_prompt: "blurry, low quality, distorted",
    mode: "pro",
    aspect_ratio: "16:9",
    duration: 5,
    generate_audio: false,
  },
});

await client.jobs.createTask({
  model: Models.Seedance2,
  input: {
    prompt: "A cinematic crystal hummingbird video.",
    resolution: "720p",
    aspect_ratio: "16:9",
    duration: 5,
  },
});

await client.jobs.createTask({
  model: Models.Seedance2Fast,
  input: {
    prompt: "A serene beach at sunset with waves gently crashing on the shore.",
    resolution: "720p",
    aspect_ratio: "16:9",
    duration: 5,
    generate_audio: true,
  },
});

await client.jobs.createTask({
  model: Models.Seedance2Mini,
  input: {
    prompt:
      "A quiet sunrise over a mountain lake, thin mist drifting across the water.",
    resolution: "720p",
    aspect_ratio: "16:9",
    duration: 5,
    generate_audio: false,
    web_search: false,
  },
});

await client.jobs.createTask({
  model: Models.Veo31Fast,
  input: {
    prompt:
      "A cinematic handheld shot of a glass greenhouse in light rain, with slow camera movement.",
    aspect_ratio: "LANDSCAPE",
    video_generate_type: "text_to_video",
  },
});

await client.jobs.createTask({
  model: Models.Veo31Lite,
  input: {
    prompt: "A simple white coffee cup on a wooden table, steam rising.",
    generationType: "TEXT_2_VIDEO",
    aspect_ratio: "16:9",
    enableTranslation: true,
  },
});

await client.jobs.createTask({
  model: Models.Veo31Quality,
  input: {
    prompt:
      "A high-fidelity cinematic shot of a rain-soaked city street at night.",
    aspect_ratio: "LANDSCAPE",
    video_generate_type: "text_to_video",
  },
});

await client.jobs.createTask({
  model: Models.Wan26VideoToVideo,
  input: {
    prompt:
      "The video drinks milk tea while doing some improvised dance moves to the music.",
    video_urls: [
      "https://static.aiquickdraw.com/tools/example/1765957777782_cNJpvhRx.mp4",
    ],
    duration: "5",
    resolution: "1080p",
  },
});

await client.jobs.createTask({
  model: Models.TextToDialogueV3,
  input: {
    dialogue: [
      {
        text: "Hello and welcome.",
        voice: "BIvP0GN1cAtSRTxNHnWS",
      },
      {
        text: "Thanks, let's begin.",
        voice: "aMSt68OGf4xUZAnLpTU8",
      },
    ],
    stability: 0.5,
    language_code: "eng",
  },
});

await client.jobs.createTask({
  model: Models.Music15,
  input: {
    lyrics:
      "[verse]\nWalking down the street\nFeeling the beat\n[chorus]\nThis is my song\nCome sing along",
    prompt: "Upbeat pop song with electronic beats and catchy melody",
    sample_rate: 44100,
    bitrate: 256000,
    audio_format: "mp3",
  },
});

await client.jobs.createTask({
  model: Models.SunoGenerate,
  input: {
    model_version: "V5_5",
    prompt: "A catchy pop song about summer love with upbeat tempo",
  },
});

await client.jobs.createTask({
  model: Models.SunoExtend,
  input: {
    model_version: "V5_5",
    audioId: "abc123-def456-ghi789",
    continueAt: 120,
    prompt: "Build up to a powerful chorus with harmonies",
    style: "Pop Rock, Uplifting",
    title: "Rise Again (Extended)",
  },
});

await client.jobs.createTask({
  model: Models.SunoUploadExtend,
  input: {
    model_version: "V5_5",
    audioUrl: "https://your-storage.com/audio/my-song.mp3",
    continueAt: 60,
    prompt: "Build to an epic chorus with harmonies",
    style: "Pop Rock, Uplifting",
    title: "My Song (Extended)",
  },
});

await client.jobs.createTask({
  model: Models.SunoCover,
  input: {
    model_version: "V5_5",
    audioUrl: "https://your-storage.com/songs/original.mp3",
    prompt: "Transform into smooth jazz with piano and saxophone",
  },
});

await client.jobs.createTask({
  model: Models.SunoLyrics,
  input: {
    prompt:
      "A love song about meeting someone at a coffee shop, romantic and upbeat mood",
  },
});

await client.jobs.createTask({
  model: Models.SunoVocalSeparation,
  input: {
    taskId: "task_abc123xyz",
    audioId: "audio_001",
  },
});

To fetch the complete currently available model list from the public catalog endpoint GET /v1/models, call client.models():

const onlineModels = await client.models();

// Each item is a callable endpoint from the catalog's endpoints array.
// Only id, name, input_schema, and example_request are returned.
console.log(onlineModels.map((model) => model.name));

Fetch the playground input fields for a specific model type from GET /v1/models/types/{model}:

const fields = await client.info(Models.NanoBanana2);

console.log(fields);

Flux Pro Image 2

Flux Pro Image 2 uses Apipass' asynchronous task API. The SDK exposes a typed wrapper that sends the public model name flux/flux-pro-image-2 and maps camelCase helper fields to the API payload.

const task = await client.images.fluxProImage2.create({
  prompt:
    "Hyperrealistic supermarket blister pack on clean olive green surface with pink FLUX.2 letters under stretched plastic film.",
  aspectRatio: "1:1",
  resolution: "1K",
});

console.log(task.data.taskId);

Poll for results with the task ID:

const result = await client.images.fluxProImage2.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

The lower-level jobs API is typed for both the normalized snake_case fields and the adapter aliases:

await client.jobs.createTask({
  model: Models.FluxProImage2,
  input: {
    prompt: "A polished studio product image with crisp reflections.",
    aspectRatio: "16:9",
    resolution: "2K",
  },
});

GPT Image 2

GPT Image 2 uses Apipass' asynchronous task API. The SDK exposes a typed wrapper that sends the public model name openai/gpt-image-2 and maps camelCase helper fields to the API payload.

const task = await client.images.gptImage2.create({
  prompt:
    "Generate an image: A realistic YouTube screenshot showing the official launch promotional video for GPT Image V2.",
  aspectRatio: "16:9",
  quality: "medium",
  resolution: "1k",
});

console.log(task.data.taskId);

Poll for results with the task ID:

const result = await client.images.gptImage2.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Edit mode is enabled by passing one or more source image URLs:

await client.images.gptImage2.create({
  prompt: "Turn this source image into a polished marketplace hero image.",
  images: ["https://example.com/source.png"],
  aspectRatio: "3:2",
  quality: "high",
  resolution: "2k",
  callBackUrl: "https://your-domain.com/api/callback",
});

Grok Imagine Image To Image

Grok Imagine Image To Image uses Apipass' asynchronous task API to generate an image from one reference image plus an optional prompt. The SDK exposes a typed wrapper that sends the public model name grok-imagine/image-to-image and maps camelCase helper fields to the snake_case API payload.

const task = await client.images.grokImagineImageToImage.create({
  imageUrls: [
    "https://cdn.apipass.dev/apipass/results/task_78514b0d12c44ad4_0.png",
  ],
  prompt:
    "Recreate the Titanic movie poster with two adorable anthropomorphic cats in the same romantic pose at the bow of the ship.",
});

console.log(task.data.taskId);

Poll for image results with the task ID:

const result = await client.images.grokImagineImageToImage.retrieve(
  task.data.taskId,
);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

The model supports one reference image URL per request. For workflows that mention the image in the prompt, use the provider's @image1 prompt convention:

await client.images.grokImagineImageToImage.create({
  imageUrls: ["https://example.com/uploaded-reference.png"],
  prompt: "@image1 restyle this image as a cinematic vintage poster.",
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates exactly one non-empty imageUrls entry and, when provided, a string prompt up to 390000 characters before sending a request. Provider-side file constraints still apply for image format and size.

Grok Imagine Text To Image

Grok Imagine Text To Image uses Apipass' asynchronous task API to generate images from a text prompt. The SDK exposes a typed wrapper that sends the public model name grok-imagine/text-to-image and maps camelCase helper fields to the snake_case API payload.

const task = await client.images.grokImagineTextToImage.create({
  prompt:
    "Cinematic portrait of a woman sitting by a vinyl record player, retro living room background, soft ambient lighting, warm earthy tones, nostalgic 1970s wardrobe, gentle film grain texture.",
  aspectRatio: "3:2",
  enablePro: false,
});

console.log(task.data.taskId);

Poll for image results with the task ID:

const result = await client.images.grokImagineTextToImage.retrieve(
  task.data.taskId,
);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Use enablePro: true when you want the provider to prioritize quality mode over speed mode, and pass callBackUrl for completion notifications:

await client.images.grokImagineTextToImage.create({
  prompt:
    "A cinematic editorial portrait in a retro living room with warm ambient lighting and shallow depth of field.",
  aspectRatio: "16:9",
  enablePro: true,
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty prompts, the 5000-character prompt limit, supported aspectRatio values, and boolean enablePro before sending a request. API defaults are used when aspectRatio and enablePro are omitted.

Qwen Image 2

Qwen Image 2 uses Apipass' asynchronous task API for image generation. The SDK exposes a typed wrapper that sends the public model name qwen/qwen-image-2 and maps camelCase helper fields to the snake_case API payload.

const task = await client.images.qwenImage2.create({
  prompt: "A cinematic mountain lake at sunrise with mist and reflective water.",
  imageSize: "portrait_16_9",
  numInferenceSteps: 40,
  seed: 123456,
  guidanceScale: 3.25,
  outputFormat: "jpeg",
  negativePrompt: "blurry, low quality",
  acceleration: "regular",
});

console.log(task.data.taskId);

Poll for generated images with the task ID:

const result = await client.images.qwenImage2.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

The lower-level jobs API is typed for the normalized snake_case fields and the adapter aliases documented by Apipass:

await client.jobs.createTask({
  model: Models.QwenImage2,
  input: {
    prompt: "A crisp editorial image of a glass pavilion beside a lake.",
    imageSize: "landscape_16_9",
    numInferenceSteps: 32,
    guidanceScale: 4,
    output_format: "png",
    negativePrompt: "blur, watermark",
    acceleration: "regular",
  },
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty prompts and numeric generation controls before sending a request. TypeScript suggests the documented image size presets, output format values, and acceleration modes, while the Apipass adapter still performs provider-specific normalization such as clamping step counts, converting jpg to jpeg, and falling back from unsupported string values.

Seedream 5 Lite Image

Seedream 5 Lite Image uses Apipass' asynchronous task API for image generation. The SDK exposes a typed wrapper that sends the public model name seedream/seedream-5-lite-image and maps camelCase helper fields to the snake_case API payload.

const task = await client.images.seedream5LiteImage.create({
  prompt:
    "A premium cafe design SaaS hero image with architectural layout overlays and warm modern interiors.",
  aspectRatio: "16:9",
  quality: "basic",
});

console.log(task.data.taskId);

Poll for generated images with the task ID:

const result = await client.images.seedream5LiteImage.retrieve(
  task.data.taskId,
);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

The lower-level jobs API is typed for the normalized snake_case fields and the adapter aliases documented by Apipass:

await client.jobs.createTask({
  model: Models.Seedream5LiteImage,
  input: {
    prompt: "A modern interior design hero image with annotated floor plans.",
    aspectRatio: "3:2",
    quality: "high",
  },
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty prompts before sending a request. TypeScript suggests the documented aspect ratios and quality values, while the Apipass adapter still performs provider-specific normalization such as lowercasing quality and falling back from unsupported string values.

Wan 2.7 Image

Wan 2.7 Image uses Apipass' asynchronous task API for prompt-only image generation and image editing workflows. The SDK exposes a typed wrapper that sends the public model name wan/wan-2-7-image and maps camelCase helper fields to the snake_case API payload.

const task = await client.images.wan27Image.create({
  prompt:
    "A cozy reading corner with warm wood shelves and soft afternoon sunlight.",
  aspectRatio: "16:9",
  n: 4,
  resolution: "2K",
  thinkingMode: true,
  watermark: false,
  seed: 0,
});

console.log(task.data.taskId);

Poll for generated images with the task ID:

const result = await client.images.wan27Image.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Image editing workflows accept inputUrls; the helper also accepts imageUrls, images, or imageInput as aliases. If more than one source image alias is provided, the values must match.

await client.images.wan27Image.create({
  prompt: "Restyle this room with warm wood, softer light, and refined decor.",
  inputUrls: ["https://example.com/source.jpg"],
  enableSequential: false,
  n: 2,
  resolution: "2K",
  colorPalette: [{ hex: "#D7C2A3", ratio: "32.00%" }],
  bboxList: [[120, 80, 320, 260]],
  watermark: false,
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty prompts, source image URL arrays, alias consistency, numeric n and seed, boolean switches, color palette entry shape, and bounding boxes before sending a request. TypeScript suggests the documented aspect ratios and resolutions, while the Apipass adapter still performs provider-specific behavior such as ignoring aspect_ratio for editing workflows, disabling thinking_mode for editing or sequential output, and clamping n.

Wan 2.7 Image Pro

Wan 2.7 Image Pro uses Apipass' asynchronous task API for prompt-only image generation and image editing workflows. The SDK exposes a typed wrapper that sends the public model name wan/wan-2-7-image-pro and maps camelCase helper fields to the snake_case API payload.

const task = await client.images.wan27ImagePro.create({
  prompt:
    "A cozy reading corner with warm wood shelves and soft afternoon sunlight.",
  aspectRatio: "16:9",
  n: 4,
  resolution: "2K",
  thinkingMode: true,
  watermark: false,
  seed: 0,
});

console.log(task.data.taskId);

Poll for generated images with the task ID:

const result = await client.images.wan27ImagePro.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Image editing workflows accept inputUrls; the helper also accepts imageUrls, images, or imageInput as aliases. If more than one source image alias is provided, the values must match.

await client.images.wan27ImagePro.create({
  prompt: "Restyle this room with warm wood, softer light, and refined decor.",
  inputUrls: ["https://example.com/source.jpg"],
  enableSequential: false,
  n: 2,
  resolution: "2K",
  colorPalette: [{ hex: "#D7C2A3", ratio: "32.00%" }],
  bboxList: [[120, 80, 320, 260]],
  watermark: false,
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty prompts, source image URL arrays, alias consistency, numeric n and seed, boolean switches, color palette entry shape, and bounding boxes before sending a request. TypeScript suggests the documented aspect ratios and resolutions, while the Apipass adapter still performs provider-specific behavior such as ignoring aspect_ratio for editing workflows, disabling thinking_mode for editing or sequential output, and clamping n.

Image Face Swap

Image Face Swap uses Apipass' asynchronous task API. The SDK exposes a typed wrapper that sends the public model name apipass/image-face-swap; the adapter also accepts wavespeed-ai/image-face-swap and image-face-swap aliases through the lower-level jobs API.

Use face swap only with appropriate consent and rights for the images you submit.

const task = await client.images.imageFaceSwap.create({
  faceImage: "https://static.wavespeed.ai/examples/face.jpeg",
  image: "https://static.wavespeed.ai/examples/source.jpeg",
  targetIndex: 0,
  outputFormat: "jpeg",
  enableBase64Output: false,
});

console.log(task.data.taskId);

Poll for results with the task ID:

const result = await client.images.imageFaceSwap.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

The Playground uploader's single-item image array shape is also accepted, and integer string target indices are supported:

await client.images.imageFaceSwap.create({
  faceImage: ["https://static.wavespeed.ai/examples/face.jpeg"],
  image: ["https://static.wavespeed.ai/examples/source.jpeg"],
  targetIndex: "2",
  outputFormat: "png",
  enableSyncMode: false,
  callBackUrl: "https://your-domain.com/api/callback",
});

Image Watermaker Remove

Image Watermaker Remove uses Apipass' asynchronous task API. The SDK exposes a typed wrapper that sends the public model name apipass/image-watermaker-remove; the public name intentionally follows the existing watermaker support-model spelling.

Use watermark removal only for images you own, created, licensed, or otherwise have permission to modify.

const task = await client.images.imageWatermakerRemove.create({
  image: "https://cdn.apipass.dev/20260506-114632.jpeg",
  outputFormat: "jpeg",
  enableBase64Output: false,
});

console.log(task.data.taskId);

Poll for results with the task ID:

const result = await client.images.imageWatermakerRemove.retrieve(
  task.data.taskId,
);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

The Playground uploader's single-item image array shape is also accepted:

await client.images.imageWatermakerRemove.create({
  image: ["https://cdn.apipass.dev/20260506-114632.jpeg"],
  outputFormat: "png",
  enableSyncMode: false,
  callBackUrl: "https://your-domain.com/api/callback",
});

Nano Banana Pro

Nano Banana Pro uses Apipass' asynchronous task API for image generation. The SDK exposes a typed wrapper that sends the public model name google/nano-banana-pro and maps the helper field aspectRatio to the API's aspect_ratio input field.

const task = await client.images.nanoBananaPro.create({
  prompt:
    "A high-quality editorial product image of a white ceramic coffee cup on a wooden table, steam rising.",
  aspectRatio: "LANDSCAPE",
});

console.log(task.data.taskId);

Poll for results with the task ID:

const result = await client.images.nanoBananaPro.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Reference images are supported:

await client.images.nanoBananaPro.create({
  prompt: "Create a polished lifestyle product image from this reference.",
  aspectRatio: "PORTRAIT",
  images: ["https://example.com/reference.png"],
  callBackUrl: "https://your-domain.com/api/callback",
});

Nano Banana 2

Nano Banana 2 uses Apipass' asynchronous task API. The SDK exposes a typed wrapper so callers do not need to remember the raw endpoint, model name, or snake_case API fields.

const task = await client.images.nanoBanana2.create({
  prompt: "A serene alpine lake reflecting snow-capped mountains at golden hour",
  imageInput: ["https://example.com/reference.jpg"],
  aspectRatio: "16:9",
  resolution: "1K",
  outputFormat: "jpg",
});

console.log(task.data.taskId);

Poll for results with the task ID:

const result = await client.images.nanoBanana2.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Callbacks are supported:

await client.images.nanoBanana2.create({
  prompt: "A product photo on a clean studio background",
  resolution: "2K",
  callBackUrl: "https://your-domain.com/api/callback",
});

Grok Imagine Text To Video

Grok Imagine Text To Video uses Apipass' asynchronous task API to generate video from a text prompt. The SDK exposes a typed wrapper that sends the public model name grok-imagine/text-to-video and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.grokImagineTextToVideo.create({
  prompt:
    "A couple of doors open to the right one by one randomly and stay open, showing tiny rooms inside with little people living and working.",
  aspectRatio: "2:3",
  mode: "normal",
  duration: 6,
  resolution: "480p",
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.grokImagineTextToVideo.retrieve(
  task.data.taskId,
);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Callbacks are supported for production workflows:

await client.videos.grokImagineTextToVideo.create({
  prompt:
    "A cinematic tracking shot through a miniature apartment tower as doors open one by one.",
  aspectRatio: "16:9",
  mode: "normal",
  duration: 8,
  resolution: "720p",
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty prompts, the 5000-character prompt limit, duration as an integer from 6 to 30 seconds, and supported aspectRatio, mode, and resolution values before sending a request. The API defaults are aspectRatio: "2:3", mode: "normal", duration: 6, and resolution: "480p" when those fields are omitted.

Grok Imagine Extend

Grok Imagine Extend uses Apipass' asynchronous task API to extend a previously generated Grok Imagine video. The SDK exposes a typed wrapper that sends the public model name grok-imagine/extend and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.grokImagineExtend.create({
  taskId: "task_grok_12345678",
  prompt:
    "The camera slowly pans forward, showing the protagonist walking deeper into the forest, with sunlight filtering through the leaves and casting dappled shadows.",
  extendAt: 0,
  extendTimes: 6,
});

console.log(task.data.taskId);

Poll for extended video results with the task ID:

const result = await client.videos.grokImagineExtend.retrieve(
  task.data.taskId,
);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Use extendTimes: 10 for a longer extension, and pass callBackUrl for completion notifications:

await client.videos.grokImagineExtend.create({
  taskId: "task_grok_12345678",
  prompt:
    "Continue with a slow tracking shot as the subject walks into a brighter clearing.",
  extendAt: "0",
  extendTimes: "10",
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty taskId and prompt, a present numeric extendAt, and extendTimes values of 6 or 10 before sending a request. Provider-side constraints still apply for whether the source taskId is a completed Apipass AI Grok Imagine video task.

Grok Imagine Upscale

Grok Imagine Upscale uses Apipass' asynchronous task API to upscale a previously generated Grok Imagine video. The SDK exposes a typed wrapper that sends the public model name grok-imagine/upscale and maps taskId to the API's task_id input field.

const task = await client.videos.grokImagineUpscale.create({
  taskId: "task_grok_12345678",
});

console.log(task.data.taskId);

Poll for upscale results with the task ID:

const result = await client.videos.grokImagineUpscale.retrieve(
  task.data.taskId,
);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Callbacks are supported for production workflows:

await client.videos.grokImagineUpscale.create({
  taskId: "task_grok_12345678",
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates a non-empty taskId before sending a request. Provider-side constraints still apply for whether the source taskId is a completed Apipass AI Grok Imagine video task.

Grok Imagine Image To Video

Grok Imagine Image To Video uses Apipass' asynchronous task API to animate either external reference images or one image from a previous grok-imagine/text-to-image task. The SDK exposes a typed wrapper that sends the public model name grok-imagine/image-to-video and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.grokImagineImageToVideo.create({
  imageUrls: [
    "https://cdn.apipass.dev/apipass/results/task_78514b0d12c44ad4_0.png",
  ],
  prompt:
    "Make the scene come alive with a slow cinematic camera push-in and subtle atmospheric motion.",
  mode: "normal",
  duration: 6,
  resolution: "480p",
  aspectRatio: "16:9",
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.grokImagineImageToVideo.retrieve(
  task.data.taskId,
);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

To animate an image from a previous Grok text-to-image task, pass taskId and optionally index instead of imageUrls:

await client.videos.grokImagineImageToVideo.create({
  taskId: "task_grok_12345678",
  index: 0,
  prompt: "Create a slow orbit camera move with subtle environmental motion.",
  mode: "spicy",
  duration: 6,
  resolution: "720p",
  aspectRatio: "16:9",
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates that exactly one input source is provided, imageUrls contains 1 to 7 non-empty URLs, taskId is non-empty when used, index is an integer from 0 to 5, duration is an integer from 6 to 30 seconds, and mode, resolution, and aspectRatio use supported values before sending a request. Provider-side constraints still apply for image file size, image format, and source task compatibility.

Hailuo 2.3

Hailuo 2.3 uses Apipass' asynchronous task API for video generation. The SDK exposes a typed wrapper that sends the public model name minimax/hailuo-2-3 and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.hailuo23.create({
  prompt:
    "A serene lake surrounded by mountains at sunset, with reflections on the water",
  duration: 6,
  resolution: "768p",
  promptOptimizer: true,
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.hailuo23.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Image-to-video generation is enabled by passing a first-frame image URL:

await client.videos.hailuo23.create({
  prompt: "Animate this scene with a slow camera push and soft water motion.",
  firstFrameImage: "https://example.com/image.jpg",
  duration: 6,
  resolution: "1080p",
  promptOptimizer: true,
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty prompts, the 2500-character prompt limit, and the documented 10s + 1080p incompatibility before sending a request.

Omni Human 1.5

Omni Human 1.5 uses Apipass' asynchronous task API for audio-driven human video generation. The SDK exposes a typed wrapper that sends the public model name bytedance/omni-human-1-5 and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.omniHuman15.create({
  imageUrl: "https://example.com/portrait.jpg",
  audioUrl: "https://example.com/audio.mp3",
  prompt: "A woman plays the piano and sings.",
  fastMode: true,
});

console.log(task.data.taskId);

Poll for generated video results with the task ID:

const result = await client.videos.omniHuman15.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Use fastMode: false when you want to prioritize generation effects over speed. Audio files must be shorter than 35 seconds; longer audio will be rejected by the provider.

await client.videos.omniHuman15.create({
  imageUrl: "https://example.com/portrait.jpg",
  audioUrl: "https://example.com/audio.mp3",
  prompt: "The character speaks directly to camera with subtle hand movement.",
  fastMode: false,
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty imageUrl and audioUrl values, the 2000-character prompt limit, and boolean fastMode before sending a request.

Kling Avatar V2

Kling Avatar V2 uses Apipass' asynchronous task API for avatar video generation. The SDK exposes a typed wrapper that sends the public model name kling/avatar-v2.

const task = await client.videos.klingAvatarV2.create({
  image: "https://example.com/avatar-image.jpg",
  audio: "https://example.com/speech-audio.mp3",
  prompt:
    "A professional spokesperson delivering a speech with confident gestures",
  mode: "std",
});

console.log(task.data.taskId);

Poll for avatar video results with the task ID:

const result = await client.videos.klingAvatarV2.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Use mode: "pro" for the higher-quality generation mode, and pass callBackUrl if you want Apipass to notify your endpoint when the task finishes.

await client.videos.klingAvatarV2.create({
  image: "https://example.com/avatar-image.jpg",
  audio: "https://example.com/speech-audio.mp3",
  prompt: "The avatar smiles, nods, and speaks directly to camera.",
  mode: "pro",
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates that image and audio are non-empty strings and that prompt, when provided, is at most 2500 characters before sending a request.

Kling 2.6

Kling 2.6 uses Apipass' asynchronous task API for video generation. The SDK exposes a typed wrapper that sends the public model name kling/kling-2-6 and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.kling26.create({
  prompt:
    "A majestic dragon flying over a medieval castle at sunset, cinematic lighting, epic fantasy, 4K quality",
  startImage: "https://example.com/starting-frame.jpg",
  duration: 5,
  aspectRatio: "16:9",
  generateAudio: true,
  negativePrompt: "blurry, low quality, distorted, watermark, text overlay",
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.kling26.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

The helper also accepts image or imageUrl as aliases for startImage. If you pass more than one alias, the values must match.

await client.videos.kling26.create({
  prompt: "A cinematic product reveal from the provided starting frame.",
  imageUrl: "https://example.com/starting-frame.jpg",
  duration: 10,
  aspectRatio: "9:16",
  generateAudio: false,
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty prompts, the 2500-character prompt limits, duration values of 5 or 10, aspect ratio values of 16:9, 9:16, or 1:1, boolean generateAudio, and compatible start-image aliases before sending a request.

Kling 2.6 Motion Control

Kling 2.6 Motion Control uses Apipass' asynchronous task API to transfer motion from a reference video to a character reference image. The SDK exposes a typed wrapper that sends the public model name kling/kling-2-6-motion-control and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.kling26MotionControl.create({
  image: [
    "https://static.aiquickdraw.com/tools/example/1767694885407_pObJoMcy.png",
  ],
  video: [
    "https://static.aiquickdraw.com/tools/example/1767525918769_QyvTNib2.mp4",
  ],
  prompt: "The cartoon character is dancing energetically",
  characterOrientation: "video",
  mode: "std",
  keepOriginalSound: true,
});

console.log(task.data.taskId);

Poll for motion-control video results with the task ID:

const result = await client.videos.kling26MotionControl.retrieve(
  task.data.taskId,
);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Use characterOrientation: "image" when the generated character should keep the facing direction from the character reference image, or "video" when it should follow the motion reference video. mode: "std" produces standard quality, while mode: "pro" requests professional quality.

await client.videos.kling26MotionControl.create({
  image: ["https://example.com/character.png"],
  video: ["https://example.com/motion.mp4"],
  prompt: "The character walks forward and waves to the camera.",
  characterOrientation: "image",
  mode: "pro",
  keepOriginalSound: false,
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty image and video URL arrays, the 2500-character prompt limit, characterOrientation values of image or video, mode values of std or pro, and boolean keepOriginalSound before sending a request.

Kling V3 Video

Kling V3 Video uses Apipass' asynchronous task API for video generation. The SDK exposes a typed wrapper that sends the public model name kling/kling-v3-video and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.klingV3Video.create({
  prompt:
    "A serene mountain landscape with a flowing river, golden hour lighting, cinematic quality.",
  negativePrompt: "blurry, low quality, distorted",
  mode: "pro",
  aspectRatio: "16:9",
  duration: 5,
  generateAudio: false,
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.klingV3Video.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

First-frame and last-frame image guidance is supported. endImage requires startImage; when startImage is provided, the API ignores aspectRatio.

await client.videos.klingV3Video.create({
  prompt: "A polished product reveal with a slow dolly-in camera move.",
  startImage: "https://example.com/my-image.jpg",
  endImage: "https://example.com/my-end-image.jpg",
  mode: "pro",
  duration: 5,
  generateAudio: false,
  callBackUrl: "https://your-domain.com/api/callback",
});

Multi-shot mode accepts up to 6 shot prompts. Each shot must be at least 1 second, and the shot durations must sum to the top-level duration value.

await client.videos.klingV3Video.create({
  prompt: "A two-shot cinematic travel video.",
  duration: 5,
  multiPrompt: [
    {
      prompt: "A wide sunrise shot over a quiet mountain valley.",
      duration: 3,
    },
    {
      prompt: "A close tracking shot along a clear flowing river.",
      duration: 2,
    },
  ],
});

The helper validates non-empty prompts, the 2500-character prompt limits, endImage requiring startImage, top-level duration from 3 to 15 seconds, and multi-shot duration compatibility before sending a request.

Seedance 2

Seedance 2 uses Apipass' asynchronous task API for video generation. The SDK exposes a typed wrapper that sends the public model name bytedance/seedance-2 and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.seedance2.create({
  prompt:
    "A cinematic macro shot of a crystal hummingbird hovering above a night-blooming flower.",
  resolution: "720p",
  aspectRatio: "16:9",
  duration: 5,
  generateAudio: false,
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.seedance2.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Image-to-video first/last-frame inputs are supported:

await client.videos.seedance2.create({
  prompt: "A product hero video with a slow camera push-in.",
  firstFrameUrl: "https://example.com/first.png",
  lastFrameUrl: "https://example.com/last.png",
  resolution: "1080p",
  aspectRatio: "9:16",
  duration: 8,
});

Multimodal reference inputs are also supported. Do not combine firstFrameUrl or lastFrameUrl with referenceImageUrls, referenceVideoUrls, or referenceAudioUrls; the helper rejects that invalid combination before sending the request.

await client.videos.seedance2.create({
  prompt: "A dynamic concept film for a futuristic wearable device.",
  referenceImageUrls: ["https://example.com/ref.png"],
  referenceVideoUrls: ["https://example.com/ref.mp4"],
  referenceAudioUrls: ["https://example.com/ref.mp3"],
  generateAudio: true,
  resolution: "720p",
  aspectRatio: "16:9",
  duration: 5,
  callBackUrl: "https://your-domain.com/api/callback",
});

Seedance 2 Fast

Seedance 2 Fast uses Apipass' asynchronous task API for text-to-video and reference-guided video generation. The SDK exposes a typed wrapper that sends the public model name bytedance/seedance-2-fast and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.seedance2Fast.create({
  prompt:
    "A serene beach at sunset with waves gently crashing on the shore, palm trees swaying in the breeze, and seagulls flying across the orange sky.",
  resolution: "720p",
  aspectRatio: "16:9",
  duration: 5,
  generateAudio: true,
  returnLastFrame: false,
  webSearch: false,
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.seedance2Fast.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Reference-guided inputs are also supported:

await client.videos.seedance2Fast.create({
  prompt: "A product hero video with a slow camera push-in.",
  firstFrameUrl: "https://example.com/first.png",
  lastFrameUrl: "https://example.com/last.png",
  referenceImageUrls: ["https://example.com/ref.png"],
  referenceVideoUrls: ["https://example.com/ref.mp4"],
  referenceAudioUrls: ["https://example.com/ref.mp3"],
  resolution: "720p",
  aspectRatio: "9:16",
  duration: 8,
  callBackUrl: "https://your-domain.com/api/callback",
});

Seedance 2 Mini

Seedance 2 Mini uses Apipass' asynchronous task API for text-to-video, image-to-video, and reference-guided video generation. The SDK exposes a typed wrapper that sends the public model name bytedance/seedance-2-mini and maps camelCase helper fields to the snake_case API payload.

Supported resolution values are "480p" and "720p", with quality accepted as a compatibility alias for resolution. If both are provided, they must match. prompt must be 3-20000 characters, duration accepts integer seconds from 4 to 15, and the typed helper sends generateAudio: false when it is omitted. Reference-guided requests support up to 9 image URLs, 3 video URLs, and 3 audio URLs.

const task = await client.videos.seedance2Mini.create({
  prompt:
    "A quiet sunrise over a mountain lake, thin mist drifting across the water, soft cinematic light, realistic natural motion.",
  resolution: "720p",
  aspectRatio: "16:9",
  duration: 5,
  generateAudio: false,
  returnLastFrame: false,
  webSearch: false,
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.seedance2Mini.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Image-to-video first/last-frame inputs are supported:

await client.videos.seedance2Mini.create({
  prompt: "A product hero video with a slow camera push-in.",
  firstFrameUrl: "https://example.com/first.png",
  lastFrameUrl: "https://example.com/last.png",
  resolution: "720p",
  aspectRatio: "9:16",
  duration: 8,
});

Reference inputs are also supported. Do not combine firstFrameUrl or lastFrameUrl with referenceImageUrls, referenceVideoUrls, or referenceAudioUrls; the helper rejects that invalid combination before sending the request. webSearch: true is only valid for pure text-to-video requests.

await client.videos.seedance2Mini.create({
  prompt: "A dynamic concept film for a futuristic wearable device.",
  referenceImageUrls: ["https://example.com/ref.png"],
  referenceVideoUrls: ["https://example.com/ref.mp4"],
  referenceAudioUrls: ["https://example.com/ref.mp3"],
  generateAudio: true,
  resolution: "720p",
  aspectRatio: "16:9",
  duration: 5,
  callBackUrl: "https://your-domain.com/api/callback",
});

Veo 3.1 Fast

Veo 3.1 Fast uses Apipass' asynchronous task API for video generation. The SDK exposes a typed wrapper that sends the public model name google/veo-3-1-fast and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.veo31Fast.create({
  prompt:
    "A cinematic handheld shot of a glass greenhouse in light rain, with slow camera movement and soft reflections.",
  aspectRatio: "LANDSCAPE",
  videoGenerateType: "text_to_video",
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.veo31Fast.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Frames-to-video and ingredients-to-video modes accept image URLs through images:

await client.videos.veo31Fast.create({
  prompt: "A smooth product reveal with a slow dolly-in camera move.",
  aspectRatio: "PORTRAIT",
  videoGenerateType: "frames_to_video",
  images: [
    "https://example.com/start-frame.png",
    "https://example.com/end-frame.png",
  ],
  callBackUrl: "https://your-domain.com/api/callback",
});

Veo 3.1 Lite

Veo 3.1 Lite uses Apipass' asynchronous task API for video generation. The SDK exposes a typed wrapper that sends the public model name google/veo-3-1-lite and maps the helper field aspectRatio to the API's aspect_ratio input field.

const task = await client.videos.veo31Lite.create({
  prompt: "A simple white coffee cup on a wooden table, steam rising.",
  generationType: "TEXT_2_VIDEO",
  aspectRatio: "16:9",
  enableTranslation: true,
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.veo31Lite.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

First-and-last-frame generation accepts one or two image URLs:

await client.videos.veo31Lite.create({
  prompt: "A calm product shot with steam rising and a gentle camera push.",
  generationType: "FIRST_AND_LAST_FRAMES_2_VIDEO",
  aspectRatio: "16:9",
  imageUrls: [
    "https://example.com/frame-1.png",
    "https://example.com/frame-2.png",
  ],
  seeds: 12345,
  watermark: true,
  callBackUrl: "https://your-domain.com/api/callback",
});

Veo 3.1 Quality

Veo 3.1 Quality uses Apipass' asynchronous task API for high-fidelity video generation. The SDK exposes a typed wrapper that sends the public model name google/veo-3-1-quality and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.veo31Quality.create({
  prompt:
    "A high-fidelity cinematic shot of a rain-soaked city street at night, with neon reflections, slow camera movement, and soft volumetric lighting.",
  aspectRatio: "LANDSCAPE",
  videoGenerateType: "text_to_video",
});

console.log(task.data.taskId);

Poll for video results with the task ID:

const result = await client.videos.veo31Quality.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Frames-to-video mode accepts one or two high-quality keyframe image URLs:

await client.videos.veo31Quality.create({
  prompt: "A polished product reveal with controlled studio lighting.",
  aspectRatio: "PORTRAIT",
  videoGenerateType: "frames_to_video",
  images: [
    "https://example.com/start-frame.png",
    "https://example.com/end-frame.png",
  ],
  callBackUrl: "https://your-domain.com/api/callback",
});

Wan 2.6 Video To Video

Wan 2.6 Video To Video uses Apipass' asynchronous task API to transform source videos. The SDK exposes a typed wrapper that sends the public model name wan/wan-2-6-video-to-video and maps camelCase helper fields to the snake_case API payload.

const task = await client.videos.wan26VideoToVideo.create({
  prompt:
    "The video drinks milk tea while doing some improvised dance moves to the music.",
  videoUrls: [
    "https://static.aiquickdraw.com/tools/example/1765957777782_cNJpvhRx.mp4",
  ],
  duration: "5",
  resolution: "1080p",
});

console.log(task.data.taskId);

Poll for generated video results with the task ID:

const result = await client.videos.wan26VideoToVideo.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

The helper also accepts video or videoUrl as aliases for a single source video URL. If you pass more than one video source alias, the values must match.

await client.videos.wan26VideoToVideo.create({
  prompt: "Restyle this source clip as a smooth cinematic dance video.",
  videoUrl: "https://example.com/source.mp4",
  duration: "10",
  resolution: "720p",
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates non-empty prompts, at least one source video URL, the documented maximum of 3 source URLs, and non-empty source URL strings before sending a request. TypeScript suggests duration values of "5" or "10" and resolution values of "720p" or "1080p", while the Apipass adapter still performs provider-specific normalization for unsupported string values.

Music 1.5

Music 1.5 uses Apipass' asynchronous task API for lyrics-to-music generation. The SDK exposes a typed wrapper that sends the public model name minimax/music-1-5 and maps camelCase helper fields to the snake_case API payload.

const task = await client.audio.music15.create({
  lyrics:
    "[verse]\nWalking down the street\nFeeling the beat\n[chorus]\nThis is my song\nCome sing along",
  prompt: "Upbeat pop song with electronic beats and catchy melody",
  sampleRate: 44100,
  bitrate: 256000,
  audioFormat: "mp3",
});

console.log(task.data.taskId);

Poll for generated music with the task ID:

const result = await client.audio.music15.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

Use structure tags such as [intro], [verse], [chorus], [bridge], and [outro] in lyrics to guide composition. audioFormat: "wav" produces uncompressed output, while "mp3" is usually smaller and broadly compatible.

await client.audio.music15.create({
  lyrics:
    "[intro]\nCity lights are glowing\n[verse]\nFootsteps in the rain\n[chorus]\nWe keep moving",
  prompt: "Cinematic synth pop with warm pads, steady drums, and hopeful vocals",
  sampleRate: 44100,
  bitrate: 256000,
  audioFormat: "wav",
  callBackUrl: "https://your-domain.com/api/callback",
});

The helper validates lyrics length from 10 to 600 characters, prompt length from 10 to 300 characters, supported sample rates, supported bitrates, and audio format values of mp3, wav, or pcm before sending a request.

Text To Dialogue V3

Text To Dialogue V3 uses Apipass' asynchronous task API for ElevenLabs dialogue audio generation. The SDK exposes a typed wrapper that sends the public model name elevenlabs/text-to-dialogue-v3 and maps the helper field languageCode to the API's language_code input field.

const task = await client.audio.textToDialogueV3.create({
  dialogue: [
    {
      text: "Hello and welcome.",
      voice: "BIvP0GN1cAtSRTxNHnWS",
    },
    {
      text: "Thanks, let's begin.",
      voice: "aMSt68OGf4xUZAnLpTU8",
    },
  ],
  stability: 0.5,
  languageCode: "eng",
});

console.log(task.data.taskId);

Poll for generated dialogue audio with the task ID:

const result = await client.audio.textToDialogueV3.retrieve(task.data.taskId);

if (result.data.state === "success") {
  console.log(result.data.result?.resultUrls);
}

The helper validates that dialogue is non-empty, each item has text and voice, combined dialogue text is at most 5000 characters, and stability is one of 0, 0.5, or 1.

await client.audio.textToDialogueV3.create({
  dialogue: [
    {
      text:
        "Thanks for joining the launch review today. I want us to keep the tone warm and natural.",
      voice: "BIvP0GN1cAtSRTxNHnWS",
    },
    {
      text:
        "Absolutely. I will keep the pacing calm and conversational so the exchange feels like a real discussion.",
      voice: "aMSt68OGf4xUZAnLpTU8",
    },
  ],
  stability: 1,
  languageCode: "eng",
  callBackUrl: "https://your-domain.com/api/callback",
});

Suno Music Generation

Suno music generation uses Apipass' asynchronous task API. The SDK exposes client.audio.suno for the suno/generate model and maps the helper field modelVersion to the API's model_version input field.

const task = await client.audio.suno.create({
  modelVersion: "V5_5",
  prompt: "A catchy pop song about summer love with upbeat tempo",
  customMode: true,
  instrumental: false,
  style: "Pop, Upbeat, Summer Vibes",
  title: "Summer Love",
  vocalGender: "f",
  negativeTags: "aggressive, heavy metal, screaming",
  styleWeight: 0.5,
  weirdnessConstraint: 0.3,
  audioWeight: 0.5,
  personaId: "persona_summer_pop",
});

console.log(task.data.taskId);

Poll for generated tracks with the task ID:

const result = await client.audio.suno.retrieve(task.data.taskId);

if (result.data.state === "success") {
  for (const track of result.data.result?.data ?? []) {
    console.log(track.audio_url, track.image_url);
  }
}

Custom mode is supported. When customMode is true, provide style and title; provide prompt as well unless instrumental is true.

await client.audio.suno.create({
  customMode: true,
  instrumental: true,
  style: "Cinematic synthwave, neon, atmospheric",
  title: "Neon Skyline",
});

Extend an existing Suno-generated track by passing the source track audioId from a completed generation:

const extension = await client.audio.suno.extend.create({
  modelVersion: "V5_5",
  audioId: "abc123-def456-ghi789",
  instrumental: false,
  continueAt: 120,
  prompt: "Build up to a powerful chorus with harmonies",
  style: "Pop Rock, Uplifting",
  title: "Rise Again (Extended)",
  vocalGender: "f",
  negativeTags: "lo-fi, distorted vocals",
  styleWeight: 0.6,
  weirdnessConstraint: 0.2,
  audioWeight: 0.4,
  personaId: "persona_power_pop",
});

console.log(extension.data.taskId);

Poll for extended tracks with the extension task ID:

const extended = await client.audio.suno.extend.retrieve(
  extension.data.taskId,
);

if (extended.data.state === "success") {
  console.log(extended.data.result?.data);
}

Extend an uploaded or externally hosted audio file by passing a public audioUrl:

const uploadExtension = await client.audio.suno.uploadExtend.create({
  modelVersion: "V5_5",
  audioUrl: "https://your-storage.com/audio/my-song.mp3",
  instrumental: false,
  continueAt: 60,
  prompt: "Build to an epic chorus with harmonies",
  style: "Pop Rock, Uplifting",
  title: "My Song (Extended)",
  vocalGender: "f",
  negativeTags: "flat drums, harsh vocals",
  styleWeight: 0.55,
  weirdnessConstraint: 0.2