Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Installs and authenticates the @pollinations/sdk npm package, then runs first text and image generation requests in JavaScript.
41% 100%+59 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 9 of 22 without it.
This test ran on v1. v4 is the current version and hasn’t been tested on gemini-3.8-flash yet.
3 of 3 safety checks passed
Not used yet
These examples use the published stable SDK 5.0.0, not the repository's
in-progress alpha API. Check the installed version's types before using other
helpers; methods on main may not exist in the published package.
npm install @pollinations/[email protected]
Get a key at https://enter.pollinations.ai/keys and set
POLLINATIONS_API_KEY in the process environment. Never print it or commit it.
Requests spend from the user's balance: confirm the intended model and budget before running.
Save this as example.mjs and run node example.mjs:
import { configure, generateText, generateImage } from "@pollinations/sdk";
configure({ apiKey: process.env.POLLINATIONS_API_KEY });
const text = await generateText("Write a short haiku about a garden.");
console.log(text);
const image = await generateImage("A small garden in watercolor.");
await image.saveToFile("garden.png");
Check that text is nonempty and garden.png is readable. The helpers return a
single result by default; n requests multiple results. saveToFile is Node-only.
{ model } option; do not invent model names.Next to this one in the catalogue, plus more from the same author.