Prerequisites
To get the most out of this guide, you’ll need to: Install the SDK
Get the Livepeer AI JavaScript SDK. Initialize the SDK
The first step is to initialize the SDK (with your API key if required).import { Livepeer } from "@livepeer/ai";
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});
Use the SDK
Now that you have the SDK installed and initialized, you can use it to request one of the available AI services.import { Livepeer } from "@livepeer/ai";
const livepeer = new Livepeer({
httpBearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.generate.textToImage({
prompt: "<value>",
});
// Handle the result
console.log(result);
}
run();
Next steps
Checkout Livepeer AI API Reference to learn more about the
Livepeer AI API and the Javascript SDK.Last modified on February 18, 2026