Skip to content

fix(providers): route OrcaRouter chat requests to /v1/chat/completions - #11923

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
echel0nn:fix/orcarouter-chat-completions-url
Aug 30, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
echel0nn:fix/orcarouter-chat-completions-url

Conversation

@echel0nn

Copy link
Copy Markdown
Contributor

Problem

Chat requests routed to the orcarouter provider fail with:

[orcarouter/<model>] [404]: Invalid URL (POST /v1)

Root cause

The OrcaRouter registry entry set baseUrl to the bare API root https://api.orcarouter.ai/v1. For this provider (executor: "default", format: "openai"), DefaultExecutor.buildUrl returns baseUrl verbatim (nothing is appended when there is no per-request override and no urlSuffix), so chat requests are POSTed to the API root and the upstream rejects them with 404 Invalid URL (POST /v1). Every other OpenAI-format registry entry carries the full /chat/completions path in baseUrl; OrcaRouter was the outlier.

Fix

-  baseUrl: "https://api.orcarouter.ai/v1",
+  baseUrl: "https://api.orcarouter.ai/v1/chat/completions",

Verification

  • Endpoint probe: POST https://api.orcarouter.ai/v1 returns 404 Invalid URL (POST /v1); POST https://api.orcarouter.ai/v1/chat/completions returns 401 Invalid API key (route exists and accepts the request; only the key is rejected).
  • Model discovery is unaffected: the discovery route in src/app/api/providers/[id]/models/route.ts strips /chat/completions and /v1 before re-deriving /v1/models, so both the old and new baseUrl resolve to the same https://api.orcarouter.ai/v1/models.
  • Full production build (npm run build) passes.

The OrcaRouter registry baseUrl was the bare API root
"https://api.orcarouter.ai/v1". DefaultExecutor.buildUrl returns baseUrl
verbatim for this provider, so chat requests were POSTed to /v1 and rejected
upstream with 404 "Invalid URL (POST /v1)". Align with every other
OpenAI-format registry entry, which carries the full /chat/completions path in
baseUrl.

Model discovery is unaffected: the discovery route strips /chat/completions and
/v1 before re-deriving /v1/models, so it resolves to the same endpoint.
@echel0nn
echel0nn requested a review from diegosouzapw as a code owner August 28, 2026 18:11
@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.51 August 30, 2026 08:16
@diegosouzapw
diegosouzapw merged commit 2201143 into cheaper-inference:release/v3.8.51 Aug 30, 2026
3 checks passed
diegosouzapw added a commit that referenced this pull request Aug 30, 2026
…11923) (#12118)

#11923 (2201143) deliberately routes OrcaRouter chat requests to
https://api.orcarouter.ai/v1/chat/completions; the golden snapshot in
tests/unit/provider-translate-path-golden.test.ts still pinned /v1, so
Unit Tests fast-path (2/4) is red on the release tip for every PR.
Regenerated with UPDATE_GOLDEN=1 — the only delta is the orcarouter block.

Refs #11923
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
cheaper-inference#11923)

Boarded with 8 other PRs in one combined worktree: typecheck:core, check:file-size, check:changelog-integrity, check:complexity, check:cognitive-complexity, check:cycles, check-native-deps all green. Retargeted from main to release/v3.8.51. One-line baseUrl fix with a live endpoint probe documenting the exact 404→401 transition — solid verification. Thanks.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…heaper-inference#11923) (cheaper-inference#12118)

cheaper-inference#11923 (3e1e063) deliberately routes OrcaRouter chat requests to
https://api.orcarouter.ai/v1/chat/completions; the golden snapshot in
tests/unit/provider-translate-path-golden.test.ts still pinned /v1, so
Unit Tests fast-path (2/4) is red on the release tip for every PR.
Regenerated with UPDATE_GOLDEN=1 — the only delta is the orcarouter block.

Refs cheaper-inference#11923
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.

2 participants