Docs/API

The CLI

How do I talk to any model from a terminal?

Checked against the code on

The terminal client is a single file with no dependencies. It needs Node 18 or newer; node -v tells you what you have. It remembers your key and your model, so you choose once and then type.

Install

curl -fsSL https://heyaskr.ai/install.sh | sh

The installer is deliberately readable and does two things: fetches one file into ~/.askr and puts a launcher on your PATH. Run the line for your machine, not both; Windows has no sh.

Sign in

bash
askr login

Paste a key from https://heyaskr.ai/wallet#api. It is saved to ~/.askr/config.json, so this is once per machine. ASKR_KEY in the environment overrides it.

Talk

bash
askr
> what is a solar eclipse?
A solar eclipse happens when the Moon passes between Earth and the Sun.
12 in · 118 out
> 

askr on its own opens a conversation that remembers what was said until you leave. Answers render as you would want them: bold is bold, lists are lists, code is set apart. Below each answer is what it cost in tokens.

CommandWhat it does
/modelsList what you can call
/model <id>Switch model without losing the thread; /model alone shows the one in use
/newStart a fresh conversation
/balanceCredits remaining
/exitLeave

Ask one thing and leave

bash
askr "what is a solar eclipse?"

The quotes matter. Without them your shell reads ? and * as filename patterns and stops with no matches found before askr runs. Inside a conversation there is no shell in the way.

If something does not work

You seeWhat happened
command not found: askrThe installer added a line to your shell config that has not been read yet. Open a new terminal tab, or source ~/.zshrc.
no matches foundYour shell ate the question. Quote it, or run askr and type it in.
node: command not foundNode is not installed. Get it from nodejs.org, then run the install line again.
That key was rejectedThe key was revoked, or only part of it was pasted. Make a new one and run askr login again.
402, or not enough creditsYour balance ran out. Add credits and carry on.

Pointing it elsewhere

ASKR_ORIGIN changes the origin the CLI talks to. It defaults to https://heyaskr.ai. Useful for staging and for nothing else.