9 minutes

Connect your agent with Ori

Install Ori, sign in with your OpenRouter account, launch CLI agents, and route desktop apps like Codex or Claude Desktop through OpenRouter.

Ori is OpenRouter’s command-line tool. With Ori Harness, you keep using the agent CLI you know, such as Claude Code or Codex, but its requests go through OpenRouter. Your models, credits, and organization settings come with your login, so you don’t need a separate provider key for each agent.

Install it once. On macOS, Linux, or WSL:

curl -fsSL https://openrouter.ai/labs/ori/install.sh | bash

On Windows PowerShell:

irm https://openrouter.ai/labs/ori/install.ps1 | iex

Then sign in. This opens your browser so you can sign in with your OpenRouter account. There’s no key to create or paste:

ori login

Option A: Terminal users (agent launchers)

If you work in a terminal, start your agent through Ori’s launcher:

Shell
ori claude
ori codex
ori opencode
ori pi

Ori supports more agents than these. The Ori Harness docs have the current list. Each command starts the real agent CLI on your machine, offering to install it if it’s missing. To choose the model, pass any OpenRouter model slug, or openrouter/auto to let OpenRouter pick:

ori claude --model openrouter/auto

Check your understanding

You run ori claude in your terminal for the first time. What do you need to set up before it works?

Option B: Desktop users (ori harness setup)

If you use desktop applications like the Codex app, Claude Desktop, or Cursor instead of running agent commands inside a terminal, you don’t need to launch them through ori <agent> every time. Run ori harness setup once:

Shell
ori harness setup codex
ori harness setup claude
ori harness setup cursor

ori harness setup writes the OpenRouter settings into the agent’s own config, so its desktop app runs on OpenRouter, and so does its plain command for every agent except Cursor (setup leaves the cursor-agent CLI unchanged). Each setup uses your saved login from ori login:

  • Codex: Sets up the Codex CLI and the Codex desktop app, which share one configuration.
  • Claude: Sets up Claude Desktop on macOS, and Claude Code on macOS and Linux. On Windows, use ori claude instead.
  • Cursor: Adds OpenRouter models to the Cursor desktop app. Cursor needs a saved API key (ori login --with-key), and it sends your key and every request through Cursor’s servers before they reach OpenRouter.

Setup also covers a few other agents, such as Factory Droid and Pi. The Ori Harness docs list every one.

Whenever you want to revert a desktop app to its default vendor setup, run:

ori harness reset codex

Check your understanding

You prefer using the Codex desktop app instead of running commands in your terminal. How do you route it through OpenRouter?

Whether you invoke agents through terminal commands or desktop apps, every turn appears in your Activity and Logs.

Apply it

Your company’s OpenRouter organization only allows certain models. You run ori codex --model with a model that isn’t on the list. What do you expect?

Takeaway

Install Ori once and sign in with ori login. Terminal users can launch agents directly with ori <agent> (such as ori claude or ori codex), while desktop users can run ori harness setup <app> (like codex or claude) to route desktop apps through OpenRouter.