OpenRouter Ori Harness: The Best Way to Use OpenRouter with Any Harness

theanonymousone1 pts0 comments

Ori Harness: Use OpenRouter with Claude Code, Codex, OpenCode, and Hermes — OpenRouter BlogOri Harness: The Best Way to Use OpenRouter with Any Harness<br>OpenRouter &middot;8/4/2026

Why do I need this if I can just change a few settings?Why do I need this if I can just change a few settings?That’s it

We often see folks trying to use OpenRouter with their favorite harnesses resort to writing ad-hoc scripts or complex config to tweak them to fit just right. Some harnesses require minimal configuration, maybe just one environment variable, but others like Claude Code require many more.

You can now install the ori CLI, log in with OpenRouter, and immediately have an optimized configuration right out of the box that works with all your favorite harnesses:

# Install ori cli<br>curl -fsSL https://openrouter.ai/labs/ori/install.sh | bash

ori login # Log in to OpenRouter

# Set up and optimized for OpenRouter<br>ori claude<br>ori codex<br>ori opencode<br>ori hermes<br># ... more to come<br>Why do I need this if I can just change a few settings?

When using a gateway like OpenRouter, to get the same out-of-the-box experience with Claude Code as you get using Anthropic’s first-party harness, there’s a lot of environment variables you need to set…

ANTHROPIC_BASE_URL=https://openrouter.ai/api<br>ANTHROPIC_AUTH_TOKEN=openrouter-api-key><br>ANTHROPIC_API_KEY=<br>OPENROUTER_API_KEY=openrouter-api-key><br>CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK=1<br>CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1<br>ENABLE_TOOL_SEARCH=true<br>CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=1<br>ANTHROPIC_DEFAULT_HAIKU_MODEL=~anthropic/claude-haiku-latest<br>ANTHROPIC_DEFAULT_SONNET_MODEL=~anthropic/claude-sonnet-latest<br>ANTHROPIC_DEFAULT_OPUS_MODEL=~anthropic/claude-opus-latest<br>ANTHROPIC_DEFAULT_FABLE_MODEL=~anthropic/claude-fable-latest[1m]<br>ANTHROPIC_DEFAULT_FABLE_MODEL_NAME=Fable<br>For Anthropic models, enabling ENABLE_TOOL_SEARCH will save you almost half the system prompt in tokens, and is the default setting on modern Claude models… when Claude Code detects the first-party harness.

Tool search meaningfully changes the agent’s behavior as well: when tool search is disabled, Claude uses more tokens, more turns to accomplish the same task, and uses the Todo tool more!

However, most open models today do not support tool search at all. In ori claude, we detect your --model flag and switch the settings to be most optimal for the model you’re using. In the future, we plan to take this further and optimize tool settings, system prompt verbosity, and more depending on the model.

That’s it

Claude Code is a particularly tricky example, but we’ll be optimizing ori harness for many harnesses. Today we support:

Claude Code

Codex

OpenCode

Hermes

Please give it a try!

Some future plans and ideas:

Better support desktop apps

A toolbar widget to track your usage, and toggle global switching to OpenRouter

Including WebSearch plugins out of the box for harnesses like OpenCode and Pi

If any of those sound appealing, or if you have feedback on a harness you’d like us to support, please join the Discord and leave us a note in the #ori-feedback channel.

openrouter claude harness code anthropic settings

Related Articles