Repository navigation
feat(ai-providers): add OrcaRouter as an AI provider - #7185
Open
Chaitanya-361 wants to merge 1 commit into
Open
Chaitanya-361 wants to merge 1 commit into
Chaitanya-361 wants to merge 1 commit into
Conversation
This was referenced Sep 30, 2026
This was referenced Oct 14, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this contribution about?
Closes #7153
Adds OrcaRouter (
https://api.orcarouter.ai) as a selectable AI provider adapter in Studio.This enables platform teams and agents to route model calls through OrcaRouter without disturbing existing providers (OpenRouter, Anthropic, Google, etc.).
Key changes:
apps/api/src/ai-providers/adapters/orcarouter.ts: Created theorcarouterAdapterusing@ai-sdk/openai(createOpenAI) with a chat completions compatibility wrapper targetinghttps://api.orcarouter.ai/v1. ImplementedlistModels()with conditional Bearer authorization, 30-second timeout, capability remapping (image->vision), pricing parsing, and token limits clamping (clampingmaxOutputTokenstonullif equal to or exceedingcontextWindow).apps/api/src/ai-providers/adapters/orcarouter.test.ts: Added a comprehensive unit test suite covering provider metadata, header handling (ensuringAuthorizationis only attached when an API key is provided), full model metadata mapping, capability translation, token limit clamping, and error responses.apps/api/src/ai-providers/types.ts: Exported theOrcaRouterAPIModelinterface defining the response schema for OrcaRouter's/v1/modelsendpoint (includingtop_provider,architecture,pricing, and context limits).apps/api/src/ai-providers/registry.ts: Imported and registeredorcarouterAdapteringetProviders()under the"orcarouter"provider ID.apps/api/src/harnesses/lib/decopilot/studio-provider.ts: Added"orcarouter"toTHOUGHT_SIGNATURE_ID_PROVIDERSto decode Gemini thought signatures that gateways pack into tool-call IDs.apps/web/src/views/settings/ai-providers/provider-grid.tsx: Addedorcarouter: 2toCLOUD_ORDERso OrcaRouter renders neatly positioned among cloud providers in the AI Providers settings grid.packages/shared/src/sdk/types/ai-providers.ts: Added"orcarouter"to theHOSTED_PROVIDER_IDStuple constant.packages/shared/src/tools/tool-io.ts: Regenerated tool IO type contracts to include"orcarouter"across AI provider management tools.How did you verify your code works?
bun test apps/api/src/ai-providers/adapters/orcarouter.test.ts packages/shared/src/sdk/types/ai-providers.test.ts(10/10 passed).bun test apps/api/src/ai-providers(23/23 passed).tsc --noEmitacrossapps/api,apps/web, andpackages/shared(0 errors).biome format).oxlint).https://api.orcarouter.ai/v1/models(retrieving and mapping 195+ models).http://localhost:4000/settings/ai-providersthat OrcaRouter renders in the provider grid with its logo and branding.Screenshots/Demonstration
The OrcaRouter tile appears in Settings > AI Providers grid as a cloud provider with direct API key authentication modal.
How to Test
bun test apps/api/src/ai-providers/adapters/orcarouter.test.tsto verify adapter unit tests.bun run dev/settings/ai-providers).Review Checklist
Summary by cubic
Adds OrcaRouter as a selectable AI provider in Studio, letting platform teams and agents route model calls through
https://api.orcarouter.aiwithout affecting existing providers.New Features
orcarouterAdapterwraps@ai-sdk/openaito use the chat completions API, which compatible servers support.listModels()maps model metadata, remaps theimageinput modality tovision, and clampsmaxOutputTokenstonullwhen it reaches the context window.HOSTED_PROVIDER_IDS, tool IO types, and the settings provider grid.THOUGHT_SIGNATURE_ID_PROVIDERSso Gemini thought signatures decode correctly.Written for commit bfd6d33. Summary will update on new commits.