Picsart API Platform

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 --version

Or 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 | iex

Authenticate

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 credits
gen-ai logout     # remove stored credentials

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

FlagAliasPurpose
--model-mModel id (e.g. flux-2-pro)
--prompt-pText prompt
--image-iInput image(s)
--aspect-ratio--are.g. 16:9, 1:1
--duration-dVideo length in seconds
--count-nNumber of outputs
--downloadDownload directory (default ./output)
--no-downloadPrint URL only
--script-sSilent, 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 credits

Scripting & 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'
Full command reference and guides: gen-ai CLI docs ↗