There are two ways to use Xmax X2.0 — integrate the official @xmaxai/sdk-global JavaScript SDK yourself, or use a no-code app like LiveGen that runs the same model live in your browser with no setup.
There are two real paths to using Xmax's X2.0 model, depending on whether you're building something or just want to try it. This page covers both: the official developer integration path through platform.xmax.ai, and the no-code alternative for people who don't want to write or maintain integration code.
If you're building a product feature on X2.0, the official route is Xmax's developer platform. At a high level, the setup looks like this:
1. Get platform access and API keys. Xmax issues two kinds of keys: a permanent key (prefixed uk-) meant to stay on your backend server and never be shipped to a browser, and temporary keys (prefixed tk-) that your backend generates and hands to the frontend. Temporary keys carry a TTL (time-to-live) and a usage allowance, so a leaked frontend key has a limited blast radius.
2. Install the SDK. X2.0's official SDK is the JavaScript browser package @xmaxai/sdk-global, installed with npm, pnpm, or yarn. It's currently the only supported SDK — Xmax lists Python and native mobile SDKs as in development, so server-side and native app integrations aren't yet officially supported.
3. Choose a mode. Decide which of the six X2.0 modes fits your use case: CharX (face swap), ClothX (outfit swap), VibeX (style transfer), MoX (motion/drag-to-animate), DimX (AR character summon), or Free (fully custom prompt and reference image).
4. Set up input and transport. X2.0 takes input from either a browser camera stream or an uploaded video file. The SDK handles file uploads by sending them directly to Tencent COS storage and returning a usable URL you pass back as a reference image. The live session itself runs over WebRTC, and output renders into a <video> element in the page.
5. Handle billing in your session logic. Usage is metered per second of generation (1 credit per second). New accounts get a free credit allowance to test with; beyond that, consult Xmax's official pricing page, since specific rates are set there and can change.
This is a legitimate, well-documented integration path — but it is an integration path. You're writing frontend code, managing a key-issuing backend, and handling WebRTC session state.
Once your keys and SDK are in place, a live X2.0 session follows the same short pipeline every time. In plain terms:
createXmaxClient and select the realtime model (x2.0). The client holds your credentials and connection config.getUserMedia, or turn an existing video file into a stream. Frame rate and resolution are capture hints; the browser and SDK may adjust them to fit the camera.connect() to open the session, join the WebRTC transport, publish your input stream, and bind the on-page <video> element that will show the generated output.set() with a prompt, a reference image URL, or both. This is the moment transformation actually begins — the output <video> starts rendering transformed frames live.disconnect() when you're done to close the session, stop publishing, and release the camera. For file input, also destroy the file stream to free its resources.That five-call rhythm — client, stream, connect(), set(), disconnect() — is the whole realtime loop. Everything else (modes, uploads, trajectory control) layers on top of it.
X2.0 is a single all-in-one model that exposes several published modes. Each mode is really just a preset prompt plus a rule for the reference image you pass into set():
| X2.0 mode | What it does | Reference image |
|---|---|---|
| CharX | Replaces the person in your feed with a target character; expressions, gaze, and motion track live | One character image |
| ClothX | Swaps your clothing while keeping your face, pose, and lighting | One clothing image (flat or worn) |
| VibeX | Restyles the whole frame — subject and background — into one art style | One style image |
| MoX | Brings a static subject to life and lets you drag its motion in real time | None |
| DimX | Summons a virtual character into your real room, AR-style, responding to gestures | One character image |
| Free | Your own prompt and reference for anything the presets don't cover | Optional |
You can also ignore the presets entirely and supply your own prompt and reference image, which is exactly what Free mode is for.
X2.0 accepts two kinds of input and treats them almost identically. For live camera work you publish a getUserMedia stream. To transform a pre-recorded clip instead, convert the file into a publishable stream with createVideoFileStream(), build the model from that file's width, height, and frame rate, and mark the input as a file when you connect(). Both paths render into the same <video> element and use the same set() call — only the input preparation differs.
X2.0's interactive side is what separates it from render-and-wait video tools. When you bind an output element, the SDK adds a drag surface so users can steer generated motion by dragging directly on the video — MoX is the obvious fit. For custom control you can send coordinates yourself with sendTracks(), passing points in the content resolution you set on connect(), not the displayed size of the element. This is how "playable," interactive video actually works under the hood; see real-time interactive video for the concept behind it.
Modes like CharX, ClothX, VibeX, and DimX need a reference image, and the SDK handles that for you. Call the upload helper (for example client.files.uploadAndCheckImage(file)) and the file goes directly to Tencent COS; you get back a public url to pass straight into set() as the reference. The SDK fetches the temporary storage credentials automatically, so you never manage cloud-storage keys yourself. Type checks are strict — handing a video to the image uploader fails immediately.
Authentication is the part most likely to trip up a first integration. X2.0 uses two key types: a permanent key (uk-) that must stay on your backend, and short-lived tk- temporary keys your backend mints and hands to the browser. Your server calls the temporary-key endpoint with two parameters — expireSeconds (how long the key lives) and pointsLimit (how much it can spend) — and returns the resulting tk- and its expiry to your frontend. Because a tk- carries a TTL, a capped quota, and cannot mint further tk- keys, a leaked browser token has a limited blast radius. The permanent key never leaves your server.
Billing is metered per second of generation — 1 credit equals 1 second — so your per-session pointsLimit is effectively a seconds budget for that browser token. New accounts get free credits to evaluate with. For current rates, check Xmax's official pricing or our Xmax pricing breakdown; specific prices are set by Xmax and can change. For a deeper walkthrough of the endpoints and request shapes, see the Xmax X2.0 API guide.
You don't have to build any of the above to get X2.0's output. A no-code app runs the model for you and exposes the modes through a normal interface, so you skip the SDK, the key-minting backend, and the WebRTC session handling entirely.
LiveGen (livegen.ai) is a consumer web app built on Xmax's X2.0 model, designed for exactly the audience that doesn't want to do the steps above. There's no SDK to install, no API keys to mint or rotate, no backend to stand up, and no WebRTC plumbing to write.
Using LiveGen looks like this instead: open livegen.ai in a browser, allow camera access (or upload a video), pick a mode, and the transformation runs live in the page. That's the entire setup. The same X2.0 modes are surfaced under plain-English names — Face Swap, Outfit Swap, Style Morph, Bring to Life, and Summon — so you get X2.0's output without touching an SDK. When the presets don't fit, Freestyle gives you a custom prompt and reference image, the same idea as Free mode.
This matters for two groups in particular: non-developers who want to try real-time video transformation for content, streaming, or personal use, and developers who want to evaluate what X2.0 actually produces before investing time in a full SDK integration. If you were exploring the model through Xmax's own playground, LiveGen also works as an Xmax playground alternative — the same underlying model, no account or code required.
The decision comes down to whether you're shipping X2.0 inside your own software or just using it.
| What you need | X2.0 SDK integration | LiveGen |
|---|---|---|
| Coding required | JavaScript integration + a backend | None |
| Setup time | Hours to days | Seconds |
| Control | Full programmatic control | Preset modes in a UI |
| Best for | Shipping X2.0 in your own product | Trying and using X2.0 directly |
sendTracks(), your own UI — and can run a backend to mint temporary keys; start from what Xmax X2.0 is and the API guide. Use LiveGen when you want results now and would rather not maintain any of that.To use the official X2.0 API and SDK directly, yes — it requires JavaScript integration work. LiveGen provides a no-code browser interface built on the same X2.0 model.
uk- key and a tk- key?A uk- key is a permanent key that should only ever live on your backend server. A tk- key is a short-lived, limited-allowance token your backend issues to the frontend so the browser never holds the permanent credential.
Officially, X2.0's SDK is JavaScript for browsers today. Python and native mobile SDKs are listed by Xmax as in development.
The official SDK uploads files directly to Tencent COS and returns a URL you use as the reference. LiveGen handles this upload step automatically in its interface.
Xmax's developer platform gives new accounts a free credit allowance for API testing. LiveGen also lets you try the capabilities directly in the browser without signing up.
X2.0 ships a JavaScript browser SDK, @xmaxai/sdk-global, installed with npm, pnpm, or yarn. It's the only officially supported SDK today; Python and native mobile SDKs are listed as in development.
The core realtime loop — create the client, get a camera stream, connect(), set(), disconnect() — can run in minutes. The real effort is the surrounding infrastructure: a backend to mint temporary keys, plus your own UI and session handling. If you only want the result, LiveGen skips all of that.
Both. X2.0 accepts a live camera stream or a video file converted into a stream with createVideoFileStream(). The generation pipeline is the same either way.
tk- keys instead of one API key?Browser and mobile sessions can't safely hold a permanent credential. Minting a short-lived tk- with a TTL and a spending cap means a token that leaks from the frontend expires quickly, can only spend what you allowed, and can't create more keys.
Open your camera and become anyone — free to start, no sign-up for your first try.
Start generating free