@apipass-dev/apipass-sdk
v1.1.3
Published
TypeScript SDK for calling Apipass large language model APIs.
Downloads
597
Maintainers
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-sdkConfiguration
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.
APIPASS_BASE_URL is still supported as an optional environment override for the API base URL.
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.txtThe 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",
nsfw_checker: false,
},
});
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.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,
enable_safety_checker: true,
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",
nsfw_checker: false,
},
});
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,
nsfw_checker: false,
},
});
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.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.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",
nsfw_checker: false,
},
});
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",
nsfwChecker: false,
});
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",
nsfwChecker: false,
},
});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",
});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,
enableSafetyChecker: true,
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,
enableSafetyChecker: true,
output_format: "png",
negativePrompt: "blur, watermark",
acceleration: "regular",
},
callBackUrl: "https://your-domain.com/api/callback",
});The helper validates non-empty prompts, numeric generation controls, and boolean enableSafetyChecker 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",
nsfwChecker: false,
});
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",
nsfwChecker: false,
},
callBackUrl: "https://your-domain.com/api/callback",
});The helper validates non-empty prompts and boolean nsfwChecker 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,
nsfwChecker: false,
});
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,
nsfwChecker: 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",
});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",
});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",
nsfwChecker: false,
});
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",
nsfwChecker: false,
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, non-empty source URL strings, and boolean nsfwChecker 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.25,
audioWeight: 0.35,
personaId: "persona_upload_extend",
});
console.log(uploadExtension.data.taskId);Poll for uploaded-audio extension results with the task ID:
const uploadExtended = await client.audio.suno.uploadExtend.retrieve(
uploadExtension.data.taskId,
);
if (uploadExtended.data.state === "success") {
console.log(uploadExtended.data.result?.data);
}Generate AI cover versions from an uploaded or externally hosted song:
const cover = await client.audio.suno.cover.create({
modelVersion: "V5_5",
audioUrl: "https://your-storage.com/songs/original.mp3",
customMode: true,
instrumental: false,
prompt: "Transform into smooth jazz with piano and saxophone",
style: "Jazz, Smooth, Lounge",
title: "My Song (Jazz Cover)",
vocalGender: "f",
negativeTags: "distorted, noisy",
styleWeight: 0.5,
weirdnessConstraint: 0.2,
audioWeight: 0.5,
personaId: "persona_jazz_cover",
});
console.log(cover.data.taskId);Poll for generated cover versions with the task ID:
const covers = await client.audio.suno.cover.retrieve(cover.data.taskId);
if (covers.data.state === "success") {
console.log(covers.data.result?.data);
}Create a timestamped lyrics task for synchronized playback data:
const timestampedLyricsTask =
await client.audio.suno.timestampedLyrics.create({
taskId: "task_source_generate_12345678",
audioId: "audio_abc123xyz",
});
console.log(timestampedLyricsTask.data.taskId);Poll for timestamped lyrics and waveform data with the task ID:
const timestampedLyrics =
await client.audio.suno.timestampedLyrics.retrieve(
timestampedLyricsTask.data.taskId,
);
console.log(timestampedLyrics.data.result?.data.lyrics);
console.log(timestampedLyrics.data.result?.data.waveform);
console.log(timestampedLyrics.data.result?.data.duration);Generate standalone AI lyrics:
const lyricsTask = await client.audio.suno.lyrics.create({
prompt:
"A love song about meeting someone at a coffee shop, romantic and upbeat mood",
});
console.log(lyricsTask.data.taskId);Poll for generated lyrics with the task ID:
const generatedLyrics = await client.audio.suno.lyrics.retrieve(
lyricsTask.data.taskId,
);
if (generatedLyrics.data.state === "success") {
console.log(generatedLyrics.data.result?.data.title);
console.log(generatedLyrics.data.result?.data.style);
console.log(generatedLyrics.data.result?.data.lyrics);
}Separate vocals and instrumentals from a generated Suno track:
const separation = await client.audio.suno.vocalSeparation.create({
taskId: "task_abc123xyz",
audioId: "audio_001",
});
console.log(separation.data.taskId);Poll for separated vocal and instrumental tracks with the task ID:
const separated = await client.audio.suno.vocalSeparation.retrieve(
separation.data.taskId,
);
if (separated.data.state === "success") {
console.log(separated.data.result?.data);
}The lower-level task API is also available for models that do not have a dedicated wrapper yet:
const task = await client.jobs.createTask({
model: "google/nano-banana-2",
channel: "official",
input: {
prompt: "A serene alpine lake",
aspect_ratio: "16:9",
resolution: "1K",
},
});
const status = await client.jobs.recordInfo(task.data.taskId);channel is optional and defaults to "auto". Use "auto" to let APIPASS route by current pricing and stability, "starter" for the ultra-low-cost tier, "regular" for the standard lower-cost tier, or "official" for the model's native official API provider.
For SDK-known model IDs, input is typed from the model value. TypeScript will suggest the documented input fields when you pass a model constant or known model string:
await client.jobs.createTask({
model: Models.Kling26,
input: {
prompt: "A cinematic dragon flying over a castle at sunset.",
duration: 10,
aspect_ratio: "16:9",
generate_audio: true,
},
});Known model IDs are available through Models, and each first-class model section documents its supported helper fields and lower-level input fields.
Unknown model IDs still work with a loose input object:
await client.jobs.createTask({
model: "provider/new-model",
input: {
provider_specific_param: true,
},
});