Repository navigation
Description
What are you trying to accomplish?
I want Claude Code requests entering OpenCodex to be routed by Claude model tier, such as Opus, Sonnet, or Haiku, without maintaining a separate route for every versioned model ID.
What prevents this today?
The Claude Code tierModels setting chooses launch defaults. modelMap rewrites explicit model IDs. Neither provides an opt-in router-level policy for selecting a target route from the tier of an incoming Claude request. The current workarounds are to maintain individual model-ID mappings or change launch defaults, which does not control requests that arrive through Claude ingress.
What should OpenCodex do?
Provide an opt-in tier-routing policy for Claude ingress. When configured, OpenCodex should identify the incoming Claude model tier and route the request to that tier's selected target. With the policy unset, current behavior should remain unchanged. Keep existing modelMap behavior compatible, and document and test how the two policies interact.
Example usage or interface
This describes the expected behavior, not a proposed configuration schema:
model = claude-opus-<version> -> configured Opus route
model = claude-sonnet-<version> -> configured Sonnet route
model = claude-haiku-<version> -> configured Haiku route
Leaving tier routing unset should preserve current routing behavior.
Alternatives or workarounds
- Add each Claude model ID to
modelMap, then update the mappings as model IDs change. - Use
tierModelsto select launch defaults, which does not route requests already arriving through the proxy.
Additional context
The Claude Code guide documents the current launch defaults and model mapping behavior. I searched the open and closed issues and pull requests, and did not find an existing proposal for router-level tier routing.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Activity
github-actions commentedon Oct 20, 2026
Automated translation bookkeeping — detected language: English.
Ingwannu commentedon Oct 20, 2026
Checked against trusted dev
12025981e5a304cdb6b1b54f525ba8554f623977. The existing tierModels launch defaults and explicit modelMap rewrite have different owners. Keep router-level tier routing opt-in and as a design item: specify precedence against exact modelMap/account-qualified models, provider/model/effort-qualified routes, unknown/future Claude names, combo selection, and preview/count_tokens. Owner approval of that contract and saved-config migration is needed before changing defaults or adding controls; no UI or routing policy is implemented by this comment.oliver-mee commentedon Oct 20, 2026
Thanks. The proposed contract is now documented and covered in #7435, including exact mappings, qualified selectors and effort rows, future/unknown names, combo selection, preview and count_tokens.
It stays opt-in, with no default or UI changes and no automatic conversion of existing modelMap or tierModels settings. Invalid policy salvage preserves unrelated configuration. I also fixed combo rename/public-alias migration for the new saved references in e84a5ec.
The PR records the full red suite result, exact-base failure comparisons and the documented resource exception for the final focused checks. I am requesting review of that contract, not treating this as owner approval or bypassing maintainer-started CI before merge.
lidge-jun commentedon Nov 15, 2026
Closing to match the decision recorded on #7435: OpenCodex will not add router-level tier routing for Claude ingress. The supported ways to steer Claude Code model ids remain
modelMap, the discovery aliases and the intercept bindings. Thanks @oliver-mee for the complete contract and tests; they made the trade-off clear.