# Janus

> Terminal coding agent built on pi that sends every request to the strongest free model that is answering, and falls back to the next when one is rate-limited

- Category: AI Coding / Autonomous Coding Agents
- Language: JavaScript
- Licence: MIT
- Repository: https://github.com/janus-sh/Janus
- Website: https://www.npmjs.com/package/@janus-sh/janus
- Canonical page: https://ai-tldr.dev/tools/janus/
- Updated: 2026-11-26

## In short

Janus is a coding agent for the terminal. Like the paid ones, it reads your code, edits files and runs commands, but every request goes to a free model. It sits in the Autonomous Coding Agents category of the AI Coding tools and is open-source, written in JavaScript and licensed MIT.

## Overview

Janus is a coding agent for the terminal. Like the paid ones, it reads your code, edits files and runs commands, but every request goes to a free model. You give it free API keys from services such as OpenRouter, Google Gemini or Groq. Janus keeps a ranked list of free models, sends each request to the best one you have a key for that is answering, and when that model says 'not now' the same request goes to the next one.

The routing is the part Janus adds. The ranked list is a file in the repository, lib/free-models.json, downloaded fresh at start. With an OpenRouter key, Janus also reads OpenRouter's catalogue: models that stopped being free are skipped, and new free models that can use tools join the end of the list. A model that hits its rate limit rests for a minute, one that hit its daily cap rests until the cap resets, and one that breaks off mid-answer rests while the turn is retried elsewhere. The footer shows which model answered, and /free shows the whole list with why each model is resting. Janus ignores paid keys in your shell unless you set JANUS_ENV_KEYS=1, so it never spends money by accident.

The engine underneath is pi by Earendil Works, installed as a dependency: its terminal interface, tools, sessions and providers. Janus adds the free-model router, key setup and its own look. The README says the project is maintained by an AI agent that writes the code and releases, with a human holding the keys. It also warns that free tiers may use what you send to train models, so secrets should stay out of the folder you run it in. Janus needs Node.js 22.19 or newer and is MIT-licensed.

## What it does

- Routes each request to the strongest free model that is awake and that you have a key for, falling back on rate limits, daily caps and broken answers
- Ranked free-model list kept as a file in the repository, plus a same-day check of OpenRouter's catalogue for models that stopped or started being free
- /free shows every model as awake, resting (with the reason and when it is back) or without a key; /model picks one by hand
- Ignores paid API keys in the environment by default, so a free agent never spends your money
- janus doctor lists keys found (names only), reachable services, the model list and the next three models, without calling a model
- One-shot mode (janus -p), session continue (janus -c), /compact for long conversations and !cmd for shell commands

## Getting started

Janus is an npm package. It needs Node.js 22.19 or newer and at least one free API key; the README suggests starting with OpenRouter.

1. Install and start

   Install the package globally and run janus in your project folder.

```bash
npm install -g @janus-sh/janus
janus
```

2. Add free keys

   On first run Janus asks for at least one key: OpenRouter (openrouter.ai/keys), Google Gemini (aistudio.google.com/apikey) or Groq (console.groq.com/keys). More keys mean more free requests a day and more models to fall back on. Change them any time with janus setup.

```bash
janus setup
```

3. Work in the session

   Ask for changes in plain language. Type /free to see which models are awake or resting, /model to pick one by hand (janus/free is the automatic router), /compact to shrink a long conversation and !ls to run a shell command.

4. Run one task, or check the setup

   janus -p runs a single task and prints the answer; janus -c continues the last session. janus doctor shows the keys found, which services answer and which models would be used next.

```bash
janus -p "fix the failing test"
janus -c
janus doctor
```

## When to use it

- Trying an agentic coding workflow without paying for a model subscription
- Students and hobbyists working on side projects within free-tier limits
- Keeping a coding agent usable when one free provider rate-limits, by spreading requests across several
- A pi-based agent where the model choice is automatic rather than configured by hand

## Version history

- 2026-11-26 0.3.2: /free now says why a model is resting and when it is back, and the new janus doctor command reports keys, services and the next models. The engine moves to pi 1.6.1.
- 2026-11-26 0.3.0: The project takes the name Janus, with the npm package @janus-sh/janus and the janus command; settings, keys and sessions are copied over from the old folder.
