From 3cafb60c6d0ff6a547ad78f38f8ccbd9179ab5fa Mon Sep 17 00:00:00 2001 From: XiaoHuo888-hue Date: Sat, 22 Aug 2026 18:21:29 +0000 Subject: [PATCH] feat(providers): add OrcaRouter as a named provider Add OrcaRouter (https://api.orcarouter.ai/v1) as a first-class named provider alongside OpenRouter, mirroring the existing OpenAI-compatible gateway wiring. - providers/orcarouter: chat completions + tool loop + streaming, targeting https://api.orcarouter.ai/v1 with the OpenAI SDK - app/api/providers/orcarouter/models: enumerates the public OrcaRouter model catalog (https://api.orcarouter.ai/v1/models) - registry/types/models/utils/attachments/stores/hooks/loader: register the orcarouter provider id across all model pickers, BYOK key resolution, attachment support, and the model-list sync - docs: mention OrcaRouter in the Agent block provider list Co-Authored-By: Claude Signed-off-by: XiaoHuo888-hue --- .../docs/en/workflows/blocks/agent.mdx | 4 +- apps/sim/.env.example | 1 + .../api/providers/orcarouter/models/route.ts | 71 ++ .../providers/provider-models-loader.tsx | 4 + apps/sim/blocks/utils.test.ts | 2 + apps/sim/blocks/utils.ts | 2 + apps/sim/components/icons.tsx | 16 + apps/sim/hooks/queries/providers.ts | 3 + apps/sim/lib/api-key/byok.ts | 21 + apps/sim/lib/api/contracts/byok-keys.ts | 1 + apps/sim/lib/api/contracts/providers.ts | 9 + apps/sim/lib/core/config/env.ts | 1 + apps/sim/providers/attachments.ts | 7 +- apps/sim/providers/models.test.ts | 1 + apps/sim/providers/models.ts | 30 + apps/sim/providers/orcarouter/index.test.ts | 285 ++++++++ apps/sim/providers/orcarouter/index.ts | 669 ++++++++++++++++++ apps/sim/providers/orcarouter/utils.ts | 49 ++ apps/sim/providers/registry.ts | 2 + apps/sim/providers/types.ts | 1 + apps/sim/providers/utils.ts | 8 + apps/sim/stores/providers/store.ts | 1 + apps/sim/stores/providers/types.ts | 1 + apps/sim/tools/types.ts | 1 + scripts/check-api-validation-contracts.ts | 4 +- 25 files changed, 1189 insertions(+), 5 deletions(-) create mode 100644 apps/sim/app/api/providers/orcarouter/models/route.ts create mode 100644 apps/sim/providers/orcarouter/index.test.ts create mode 100644 apps/sim/providers/orcarouter/index.ts create mode 100644 apps/sim/providers/orcarouter/utils.ts diff --git a/apps/docs/content/docs/en/workflows/blocks/agent.mdx b/apps/docs/content/docs/en/workflows/blocks/agent.mdx index 1a6fb899444..4216f94283e 100644 --- a/apps/docs/content/docs/en/workflows/blocks/agent.mdx +++ b/apps/docs/content/docs/en/workflows/blocks/agent.mdx @@ -25,7 +25,7 @@ Answer in two sentences, cite the doc you used, and never guess a price. ### Model -The model that runs the step. Defaults to `claude-sonnet-4-6`. Type or pick any model from OpenAI, Anthropic, Google, xAI, Groq, Cerebras, DeepSeek, Azure, AWS Bedrock, Google Vertex, or OpenRouter, or a local model through Ollama or VLLM. +The model that runs the step. Defaults to `claude-sonnet-4-6`. Type or pick any model from OpenAI, Anthropic, Google, xAI, Groq, Cerebras, DeepSeek, Azure, AWS Bedrock, Google Vertex, OpenRouter, or [OrcaRouter](https://www.orcarouter.ai), or a local model through Ollama or VLLM. ### Files @@ -139,7 +139,7 @@ The Agent reads the message from Start with `` and returns a result - **Use a response format when a downstream block needs specific fields.** It guarantees the shape, and you read each field as ``.