Clients and tools
CLI
Run models from the terminal.
The astorie command runs the same flow from a terminal. It is handy for trying models, for scripts, and for AI coding agents that can run shell commands.
Install
npm install --global @astorie/client@0.1.0-beta.1It ships inside @astorie/client and needs Node.js 20 or later.
Set your key
export ASTORIE_API_KEY="ast_gw_..."
export ASTORIE_BASE_URL="https://astorie.ai/api/gateway"Commands
| Command | What it does |
|---|---|
astorie models | List models |
astorie quote MODEL --input JSON | Price an input. Free. |
astorie submit MODEL --input JSON --max-charge AMOUNT | Start a job. Add --wait to wait for it. |
astorie status JOB_ID | Show a job |
astorie result JOB_ID --download DIR | Download a finished job's files |
astorie cancel JOB_ID | Cancel a job |
astorie balance | Show your wallet |
--input takes inline JSON or @file.json. --json prints the API response as JSON (for submit, wrapped with the idempotency key).
astorie quote google/nano-banana-2 --input '{"prompt":"A red chair in a sunlit studio","aspect_ratio":"1:1","resolution":"1K","output_format":"png"}'
astorie submit google/nano-banana-2 --input @input.json --max-charge 1.000000 --wait
astorie result job_3k7qz2m5x4rbd6wn2yhv7tcl4a --download ./outRetrying a submit
Pass your own key with --idempotency-key (a UUID is fine) and keep it. If the command is interrupted, run it again with the same key: you get the same job and aren't charged twice. Without one, submit makes a key and prints it to stderr once it gets a response, which doesn't help if the process is killed before then. --max-charge is never filled in for you.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | API or network error. stderr shows code: message (request_id ...). |
| 2 | Wrong usage, such as a missing argument |