Skip to content

Add OrcaRouter as a named LLM provider - #162

Open
XiaoHuo888-hue wants to merge 1 commit into
ThousandBirdsInc:mainfrom
XiaoHuo888-hue:add-orcarouter-provider
Open

Add OrcaRouter as a named LLM provider#162
XiaoHuo888-hue wants to merge 1 commit into
ThousandBirdsInc:mainfrom
XiaoHuo888-hue:add-orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

Adds OrcaRouter as a named LLM provider, wired the same way the existing
OpenRouter provider is — so the provider registry, model selection and docs
stay consistent.

What's in the change

  • New OrcaRouterProvider in crates/chidori/src/providers/orcarouter.rs — a
    thin wrapper over the OpenAI-compatible client pointed at
    https://api.orcarouter.ai/v1/chat/completions.
  • ProviderRegistry::from_env() registers it whenever ORCAROUTER_API_KEY is
    set, ahead of the OpenRouter fallback, so an explicit OrcaRouter key wins
    over the zero-setup OAuth sign-in.
  • to_orcarouter_slug() translates Chidori model ids to OrcaRouter's catalog
    ids on the way out: claude-sonnet-4-6anthropic/claude-sonnet-4.6,
    autoorcarouter/auto, gpt-4oopenai/gpt-4o, and explicit
    catalog ids (anything containing /) pass through untouched.
  • ORCAROUTER_API_KEY is surfaced wherever a provider key is documented
    (CLI demo, init help text, README, docs).

This registers OrcaRouter the same way the
existing OpenRouter provider is wired, so the provider registry, config
reference and docs stay consistent. OrcaRouter is an OpenAI-compatible
gateway: one ORCAROUTER_API_KEY (keys start with sk-orca-) unlocks 150+
models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax and xAI behind
a single https://api.orcarouter.ai/v1 endpoint. It also runs gateway-level,
zero-trust security for AI agents on the same endpoint — screening every
prompt/response and governing every tool call on a default-deny basis, with
no application code changes.

Verification

  • cargo test -p chidori --lib providers::orcarouter — 5/5 pass (new slug
    translation tests).
  • Full cargo test -p chidori --lib: 445 pass / 29 fail on this branch vs
    440 pass / 29 fail on main — the 29 failures are byte-for-byte identical
    on both, pre-existing Windows temp-path issues in host_actor,
    host_branch and typescript::loader tests that this PR does not touch.
    The PR adds 5 new passing tests and no new failures. (Three replay tests
    additionally fail only when an ANTHROPIC_MODEL env var is set in the
    shell — this dev session runs via a gateway; with it unset they pass.)
  • Live against https://api.orcarouter.ai/v1 with a real key:
    GET /models → 200 (189 models); chat completion on
    anthropic/claude-sonnet-4.6 → 200; orcarouter/auto smart routing → 200;
    invalid key → 401.
  • cargo fmt --check and clippy are clean on the changed files (the repo
    already has unrelated fmt diffs and three clippy warnings on main head).

I'm an engineer on the OrcaRouter team.

Wire OrcaRouter the same way the OpenRouter provider is: a thin
OpenAI-compatible wrapper pointed at https://api.orcarouter.ai/v1,
registered from ORCAROUTER_API_KEY ahead of the OpenRouter fallback,
with model-id translation to OrcaRouter's catalog ids
(claude-sonnet-4-6 -> anthropic/claude-sonnet-4.6, auto -> orcarouter/auto).

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant