跳到正文
openrouter blog·· 2026-08-04精選AI 評分63

OpenRouter 推出 Ori Harness 最佳化命令列工具

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

AI 導讀

OpenRouter 推出全新的 Ori Harness 命令列工具,讓使用者透過簡單的指令快速安裝與登入,即可自動獲得針對 OpenRouter 最佳化的配置,無須再手動設定複雜的環境變數。

推薦理由

原文給出特定工具的配置方案與優化邏輯,讀者可據此評估如何簡化網關接入流程。

正文 · 原文

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
curl -fsSL https://openrouter.ai/labs/ori/install.sh | bash

ori login # Log in to OpenRouter

# Set up and optimized for OpenRouter
ori claude
ori codex
ori opencode
ori hermes
# ... more to come

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
ANTHROPIC_AUTH_TOKEN=<openrouter-api-key>
ANTHROPIC_API_KEY=
OPENROUTER_API_KEY=<openrouter-api-key>
CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK=1
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
ENABLE_TOOL_SEARCH=true
CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=1
ANTHROPIC_DEFAULT_HAIKU_MODEL=~anthropic/claude-haiku-latest
ANTHROPIC_DEFAULT_SONNET_MODEL=~anthropic/claude-sonnet-latest
ANTHROPIC_DEFAULT_OPUS_MODEL=~anthropic/claude-opus-latest
ANTHROPIC_DEFAULT_FABLE_MODEL=~anthropic/claude-fable-latest[1m]
ANTHROPIC_DEFAULT_FABLE_MODEL_NAME=Fable

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 blog · openrouter.ai