Create an account
Sign up, open the dashboard, and create an access token. The token authorizes usage and billing. It does not decrypt prompts, source images, or outputs.
- Keep the token private.
- Use environment variables for local work and CI.
- Rotate the token if it is exposed.
Install the tool
Install the image generation tool in the project or shell where you want to generate images.
npm install @unexposed/image-genRun your first task
Pass an access token, prompt, and either a model or an account-private Workflow. The tool seals the request, waits for generation, and gives you an image.
import { generateImage } from "@unexposed/image-gen";
const image = await generateImage({
accessToken: "ux_...AIax",
prompt: "studio photo of a brass desk lamp",
model: "flux2_dev",
});
await image.save("./lamp.png");Generate a batch
Send many prompts in one batch when you want several images. Each image is still its own task, reservation, and result.
import { generateImages } from "@unexposed/image-gen";
for await (const result of generateImages(
[
{ prompt: "product photo of a watch", model: "flux2_dev" },
{ prompt: "studio product photo of headphones", model: "flux2_dev" },
],
{ accessToken: "ux_...AIax" },
)) {
if (result.ok) await result.image.save(`./image-${result.index}.png`);
}Next steps
- Use source or sources when you want to transform input images.
- Use repeated --source flags for Workflows that declare multiple source image inputs.
- Use UNEXPOSED_ACCESS_TOKEN in server environments where you do not want to pass accessToken in code.
- Check the dashboard for usage, balance, and token management.