Skip to content

OpenRouter

View as markdown

OpenRouter sells access to many models behind one key. It’s the quickest way to start: make a key in your OpenRouter account and give it to Solipsist.

Terminal window
export SOLIPSIST_OPENROUTER_KEY=sk-or-...

Set it in your environment: add that line to your shell’s profile (~/.zshrc, ~/.bashrc) to keep it. Solipsist doesn’t read a .env from the folder it runs in, since that folder may be someone else’s. You can also set pi.openrouter_key in solipsist.yaml, but that file is easy to commit by accident. Solipsist never prints a key: errors and --print-config only say whether one is set. Restart Solipsist after adding it.

Open the agent panel and use the model picker. The picker opens on a shortlist of OpenRouter models (pi.models); search the list for others. The picker shows a model’s size and price, so you can see what a run is likely to cost before you choose.

A model that suits suggestions is one that follows an instruction closely and answers briefly: you are asking it to rewrite a sentence, not to write a novel. A small model is usually enough for a short rewrite, and a larger one is worth it for a request that needs the whole page’s context.

OpenRouter bills your account. Solipsist adds up what each run cost, shows it in the status bar and the agent panel, and stops starting new runs at the spending limits: $5 a day and $50 a month unless you change them (agent.cost_limit_day_usd, agent.cost_limit_month_usd). Those totals are rebuilt from the log, so they survive a restart.

Set a spending limit in your OpenRouter account too: Solipsist’s limits only count what its own agents spend.

If it doesn’t work, see When it goes wrong.

For Solipsist 0.1