Helps Claude Code integrate the PopNow TypeScript SDK (npm: popnow) into an app: AI image, video, music and speech generation with quote-then-create pricing, idempotent jobs, waiting, uploads and verified webhooks.
Helps Claude Code integrate the PopNow TypeScript SDK (npm: popnow) into an app: AI image, video, music and speech generation with quote-then-create pricing, idempotent jobs, waiting, uploads and verified webhooks.
PopNow JavaScript / TypeScript SDK — AI Video, Image & Music Generation API
popnow is the official TypeScript SDK for the PopNow API, a single API for
AI video, image, music and speech generation with models such as Kling, Seedance, Wan, Vidu, MiniMax,
Nano Banana, GPT Image, Flux and Suno.
PopNow AI (popnow.ai) is the world's first AI studio with automatic price protection, a browser-based studio for videos, images and music: image-to-video, text-to-video, AI images,
music and speech, one-tap trending video effects and image styles. This SDK gives Node.js, Deno, Bun,
Cloudflare Workers and edge runtimes typed access to the same models as popnow.ai, at the
same price for the same settings, billed in USD from your separate API balance. It has zero runtime
dependencies and uses the global fetch.
Every API call is quoted in USD before it runs, and failed tasks are refunded to your API balance automatically.
Quickstart
1. Install, create an API key at popnow.ai/api/console/keys and add funds
in API billing (the API balance starts at $0 and is separate from website
credits):
Also on JSR for Deno and Bun: deno add jsr:@popnow/popnow or npx jsr add @popnow/popnow.
2. Generate an image (a fast model, about $0.01):
import { PopNow } from 'popnow';
const popnow = new PopNow(); // reads POPNOW_API_KEY
const task = await popnow.jobs.createAndWait({
model: 'alibaba/z-image-turbo/text-to-image',
input: { prompt: 'A small red fox curled up in a teacup, soft morning light' },
});
3. Use the result.output.assets[0].url is a signed link that works for about 20 minutes:
console.log(task.state, task.costUsd, task.output?.assets?.[0]?.url); // costUsd: exact USD charge, e.g. "0.01"
balance() (availableUsd, heldUsd, totalUsd) and usage() (totalSpend), as exact USD strings
Reliability
Automatic retries for connection errors, timeouts, 429, 500, 503, 50301 with Retry-After; an Idempotency-Key is always sent on task creation so retries never charge twice
Errors
Typed error classes from the {code,msg,data,request_id} envelope, with code, status, requestId and reason
Webhooks
verifyWebhook (task callbacks) and verifyStandardWebhook (account endpoints), using Web Crypto
Runtimes
Node.js 18+, Deno, Bun, Cloudflare Workers, Vercel / Next.js edge and Node runtimes; ESM and CommonJS builds with type definitions
Supported models
Every image, video and audio model on PopNow is callable with the same jobs.create call. A model ID is
<maker>/<model>/<task>. A few examples: