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

Terminal
npm install --global @astorie/client@0.1.0-beta.1

It ships inside @astorie/client and needs Node.js 20 or later.

Set your key

Terminal
export ASTORIE_API_KEY="ast_gw_..."
export ASTORIE_BASE_URL="https://astorie.ai/api/gateway"

Commands

CommandWhat it does
astorie modelsList models
astorie quote MODEL --input JSONPrice an input. Free.
astorie submit MODEL --input JSON --max-charge AMOUNTStart a job. Add --wait to wait for it.
astorie status JOB_IDShow a job
astorie result JOB_ID --download DIRDownload a finished job's files
astorie cancel JOB_IDCancel a job
astorie balanceShow your wallet

--input takes inline JSON or @file.json. --json prints the API response as JSON (for submit, wrapped with the idempotency key).

Example
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 ./out

Retrying 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

CodeMeaning
0Success
1API or network error. stderr shows code: message (request_id ...).
2Wrong usage, such as a missing argument