Interfaces
CLI
The gen-ai command line brings the same models to your terminal — ideal for scripting, automation, and quick one-offs. It downloads results, quotes cost before spending credits, and emits JSON for pipelines.
Install#
npm (global)
npm install -g @picsart/gen-ai
gen-ai --versionOr use the install script:
script
# macOS / Linux
curl -fsSL https://picsart.com/gen-ai-cli/install.sh | bash
# Windows (PowerShell)
iwr https://picsart.com/gen-ai-cli/install.ps1 | iexAuthenticate#
The CLI signs in with an OAuth web flow — no API key to manage. Run gen-ai login once per machine; the token is stored securely and refreshed automatically.
bash
gen-ai login # opens the browser once, stores a token locally
gen-ai whoami # show the signed-in account
gen-ai credits # remaining balance
gen-ai logout # remove stored credentialsNote
Browsing the catalog and inspecting models works without signing in; generation, pricing quotes, and Drive operations require login.
Generate#
Pass a model with -m and a prompt with -p. Run gen-ai generate with no flags for a guided wizard, or gen-ai for the REPL.
bash
# Image
gen-ai generate -m flux-2-pro -p "studio shot of a ceramic cup, soft light" --ar 4:3
# Video (text-to-video)
gen-ai generate -m seedance-2.0 -p "a fox running through autumn leaves" -d 8
# Audio (text-to-speech)
gen-ai generate -m eleven-v3 -p "Welcome to Picsart AI Playground."Common flags#
| Name | Type | Description |
|---|---|---|
--model, -m | model id | Model id (e.g. flux-2-pro) |
--prompt, -p | string | Text prompt |
--image, -i | path | url | Input image(s) |
--aspect-ratio, --ar | ratio | e.g. 16:9, 1:1 |
--duration, -d | seconds | Video length in seconds |
--count, -n | number | Number of outputs |
--download | directory | Download directory (default ./output) |
--no-download | flag | Print URL only |
--script, -s | flag | Silent, quiet JSON output |
Explore & price models#
bash
gen-ai models # full catalog
gen-ai models --mode video # filter by type
gen-ai models --provider google # filter by provider
gen-ai models info seedance-2.0 # a model's parameters
gen-ai pricing seedance-2.0 -d 5 -r 1080p # quote before spending creditsScripting & automation#
The CLI is pipe-friendly. Stream a prompt in, and use --script for clean JSON you can parse.
bash
# Pipe a prompt in, stream the run, and take only the URL
echo "a neon city flyover at dusk" | gen-ai generate -m veo-3.1 -d 8 -s
# --script emits quiet JSON — parse it with jq
gen-ai generate -m flux-2-pro -p "a cat in a hat" --script | jq '.results[0].url'