Command line
Generate images and video from your terminal
The spicyapi command lets you browse models, check an exact price, start a generation and download the result, without writing any code. Paid commands always stop and ask first.
What the CLI is for
It is the fastest way to try a model: type a command, see the exact price, say yes, get the file. No project, no code.
- You type a commandTerminal or PowerShell
- spicyapiShows the exact price and asks first
- Your resultA download link, or JSON for scripts
Good for
- Trying models fastCompare models and prices before anyone writes code.
- Shell scriptsPipe --json output into jq, scheduled jobs or CI steps.
- Coding agentsAgents can run commands and read the JSON result.
Set it up in two minutes
- Step 1
Install Node.js 22.13 or later
Run node -v. If it prints an older version, install the LTS release from nodejs.org and reopen the terminal.
terminal node -v - Step 2
Put your key in SPICY_API_KEY
The CLI reads the key from the environment only. It is never accepted as an argument and never printed, so it cannot leak through your shell history.
export SPICY_API_KEY="sk-spicy-..." # paste your own key$env:SPICY_API_KEY = "sk-spicy-..." - Step 3
Run it with npx, or install it once
npx runs the latest version without installing anything. Install it globally if you use it every day.
npx @spicyapi/cli statusnpm install -g @spicyapi/cli spicyapi status
Your first image from the terminal
Find a model you can call, check the exact price, then create the task and wait for it. Put the input in a file to avoid shell quoting problems.
- Step 1
Find a model
List the image models you can call, with their prices.
models list spicyapi models list --modality image --json - Step 2
Check the price
Put your prompt in a file and get the exact cost. Nothing is charged.
tasks quote echo '{ "prompt": "A cinematic night portrait" }' > input.json spicyapi tasks quote --model MODEL_ID_FROM_CATALOG --input-file input.json - Step 3
Create and wait
The CLI shows the price, asks for your yes, then waits for the result.
tasks create spicyapi tasks create \ --model MODEL_ID_FROM_CATALOG \ --input-file input.json \ --wait - Step 4
Download it
Save the file from the result link before it expires.
download curl -L -o result.png "PASTE_THE_URL_HERE"
What you can do
Only two commands spend money, and both show the price and wait for your yes.
Explore
01spicyapi statusCheck that SpicyAPI is reachable
Freespicyapi models listList the models you can use, with prices
Freespicyapi models get <model>Show the exact settings one model accepts
Freespicyapi balanceCheck your balance
Free
Price
02spicyapi tasks quoteGet the exact price before starting
Free
Generate
03spicyapi tasks createStart an image or video generation
Asks before chargingspicyapi tasks wait <task-id>Wait for a generation to finish
Freespicyapi tasks get <task-id>Show a generation and its result links
Free
Files
04spicyapi files upload <path>Upload a picture, video or audio file as input
Freespicyapi files download-url <task-id>Get a fresh download link for a result
Free
Built for scripts and AI agents too
Add --json to any command for the complete result as JSON, with errors as one JSON line on stderr and a non-zero exit status on failure. Coding agents can run the CLI directly, or use the MCP server for a richer integration.
spicyapi --json tasks get <task-id> > task.jsonFix common errors
Most first-time problems are one of these three. Each card shows what you see and the one thing to change.
- $
command not found: spicyapi
The global install is not on your PATH. Run npx @spicyapi/cli instead, or reinstall with npm install -g @spicyapi/cli.
- key
Key not set
SPICY_API_KEY only lasts for the window where you set it. Set it again, or add it to your shell profile.
- node
Node.js is too old
The CLI needs Node.js 22.13 or later. Check with node -v and install the current LTS release.
