The SDK provides three main APIs for different use cases:
If you need to…
Use
Main method
Transform live streams over WebRTC
Realtime API
client.realtime.connect()
Generate/edit videos asynchronously
Queue API
client.queue.submitAndPoll()
Generate/edit images synchronously
Process API
client.process()
Realtime API
Realtime video streams
Queue API
Video processing
Process API
Image editing
If you’re building a browser app and want to avoid exposing API keys, route SDK calls through your backend proxy. See the proxy examples in sdks/sdk/examples/nextjs-proxy and sdks/sdk/examples/express-proxy.
For client-side applications (browsers, mobile apps) using the Realtime API, create short-lived client tokens instead of exposing your permanent API key:
// On your backend — basic (60s TTL, unrestricted)const { apiKey, expiresAt } = await client.tokens.create();// Or scoped to specific models with a longer TTLconst token = await client.tokens.create({ expiresIn: 300, allowedModels: ["lucy_2_rt"],});// Send token.apiKey to your frontend for secure client-side authentication
See Client Tokens for details on secure realtime auth.
The SDK is written in TypeScript with full type definitions. Each model enforces its own required inputs, so you’ll get autocomplete and helpful errors if something is missing.
// Video editing requires 'data' fieldawait client.queue.submitAndPoll({ model: models.video("lucy-2-v2v"), prompt: "Transform into anime style", data: videoFile, // ✅ Required});// Image editing requires 'data' fieldawait client.process({ model: models.image("lucy-pro-i2i"), prompt: "Change the background to a beach", data: imageFile, // ✅ Required});