Client libraries
Command line
@auray/cli: the auray command — list models, read a contract, run an address, follow a request, upload a file, find and wait on a job, read what was spent.
@auray/cli has not been published to npm yet, and the repository it is built in is not public, so it cannot be installed until it is. This page describes it for that day.
Needs Node 20 or newer and AURAY_API_KEY in the environment. Output is a table on a terminal
and JSON when piped or asked for with --json, so the same command reads well and scripts well.
#The commands
auray models --status connected
auray schema auray-ai/krea-2-turbo/text-to-image --llms
auray run auray-ai/krea-2-turbo/text-to-image \
-s prompt="a brass orrery on a walnut desk, morning light" -s aspect_ratio=16:9 -s resolution=1024
auray upload photo.png auray-ai/hunyuan-3d/image-to-3d
auray jobs --status running
auray wait photo_nightly-482
auray usage --window 90d
auray me| Command | What it does |
|---|---|
models [--category c] [--status connected|described|undescribed] [--q word] [--limit n] | The catalogue, filtered the way GET /v1/models filters it. |
schema <address> [--llms] | The address's contract: its OpenAPI document, or the llms.txt an agent reads. |
run <address> [-i '{json}'] [-s k=v]… [--key k] [--webhook url] [--logs] [--no-wait] | Submit, follow the request to COMPLETED, print the signed download URLs. --no-wait only submits. |
status <address> <request_id> [--logs] | Where a request is. |
result <address> <request_id> | What a completed request produced. |
cancel <address> <request_id> | Ask a request to stop. |
upload <file> <address> [--content-type t] | The three calls of Uploads for the address the file is for; prints the signed read URL and the field that takes it. |
jobs [--product p] [--status s] [--limit n] [--before t] | The account's jobs, newest first — how a lost id is found. --before takes the next_before a page printed. |
wait <job_id> | Follow a job until it settles, for as long as the server says it may take; exits 1 unless it succeeded. |
usage [--window month|last_month|90d|12m] | What the account spent, and on what — the usage document. |
me | The account and this key: plan, credits, scopes. |
keys | Where keys are minted, and this one's scopes. Keys are minted in the desktop, never from a key. |
docs [query] | Search this documentation. |
-s k=v sets one input field; a value that parses as JSON is sent as JSON, so -s resolution=1024
sends a number and -s prompt=… sends a string. -i takes the whole input as one JSON object.
--key sets the idempotency key, so a rerun with the same key is handed the same request rather
than charged again.
#Refusals
A refusal prints the code, the message and the link, and exits 1:
insufficient_credits: This job needs 4 credits and the account has 0.
https://auray.ai/docs/api/errors#insufficient_credits
request 1c7f9a2e-…A usage mistake — a missing address, an unknown flag — exits 2 without calling the API.
#Where it lives
packages/cli in the repository: fourteen subcommands over @auray/client
and nothing else, each tested against a scripted client. The package is @auray/cli because the
bare name auray on npm belongs to somebody else; the command it installs is still auray.