Next.js
Get Started
Get started with Pixio API TypeScript client
Overview
Install the official Pixio API client
bun i pixio-apiSet up the client — get your api key here
import { PixioAPI } from "pixio-api";
export const pixio = new PixioAPI({
apiKey: process.env.PIXIO_API_KEY!,
});Running any workflow as API, for more types definitions see here
Queue Run
When using queue run, an run id is returned immediately, which you can later use to check the status of the run or get the output. Webhook callback is suggested making sure you have a way to receive the response.
const { runId } = await pixio.run.queue({
deploymentId: "<deployment-id>",
inputs: {
prompt: "A beautiful landscape",
},
webhook: "<your domain>/webhook",
});