Skip to content

feat(providers): add OrcaRouter as a first-class model provider - #2779

Open
JinhaoSong322 wants to merge 1 commit into
browserbase:mainfrom
JinhaoSong322:add-orcarouter-provider
Open

feat(providers): add OrcaRouter as a first-class model provider#2779
JinhaoSong322 wants to merge 1 commit into
browserbase:mainfrom
JinhaoSong322:add-orcarouter-provider

Conversation

@JinhaoSong322

@JinhaoSong322 JinhaoSong322 commented Aug 20, 2026

Copy link
Copy Markdown

why

OrcaRouter is an OpenAI-compatible gateway that fronts hundreds of frontier and open-weight models behind a single sk-orca- key. Adding it as a named first-class provider lets Stagehand users target the gateway with the same provider/model syntax as the existing OpenAI, Anthropic, Google, Groq, and Cerebras providers — including gateway routing aliases like orcarouter/auto and vendor-prefixed models like orcarouter/deepseek/deepseek-v4-pro.

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.

what changed

  • protocol: register orcarouter in ModelProviderSchema; add OrcaRouterModelId/OrcaRouterModelName schemas covering the gateway routing aliases and a curated set of vendor-prefixed models; regenerate stagehand.v4.json, the Python models, and the Go client
  • extension: route orcarouter/* through createOpenAI at https://api.orcarouter.ai/v1 via the Responses API (chat-completions fallback when stopSequences are set), sending the full gateway-qualified model name
  • evals: read ORCAROUTER_API_KEY for orcarouter/ models in the init harness and env snapshot
  • integrations facade: resolve ORCAROUTER_API_KEY when STAGEHAND_MODEL_NAME uses an orcarouter/ prefix
  • docs: add OrcaRouter to the first-class providers reference, provider env-var table, and troubleshooting text
  • tests: extend model resolution, AI SDK client, facade config, and env-snapshot tests; add a changeset

test plan

  • just check passes (fmt, lint, typecheck, generated-code drift, go vet)
  • pnpm exec turbo run test:unit passes (all packages)
  • Python SDK pytest: 458 passed; Go SDK tests pass; integrations facade tests pass
  • L3 live test: createAiSdkLanguageModel/getAISDKLanguageModel with a real ORCAROUTER_API_KEY against https://api.orcarouter.ai/v1 returns "ORCA-OK" over both the Responses API and the chat-completions path
  • Chrome-dependent smoke tests fail in this container (no Chrome binary) but are unchanged by this PR

Disclosure: I'm an engineer on the OrcaRouter team.


Summary by cubic

Adds OrcaRouter as a first-class model provider so users can select orcarouter/* models via the same provider/model syntax. Previously only OpenAI, Anthropic, Google, Groq, and Cerebras were accepted; now OrcaRouter models validate and route through the OpenAI Responses API, with chat-completions used when stop sequences are set.

  • Protocol and SDKs: add orcarouter to ModelProvider, define OrcaRouterModelId/Name, regenerate stagehand.v4.json and the Python/Go SDKs; validation now includes gateway aliases (for example, orcarouter/auto) and vendor-prefixed models.
  • Extension: send full gateway-qualified model names to https://api.orcarouter.ai/v1; default baseURL applies when unset; enable strict JSON schema; fallback to chat-completions when stopSequences are present.
  • Evals and integrations: read ORCAROUTER_API_KEY; resolve it automatically when STAGEHAND_MODEL_NAME starts with orcarouter/; env snapshot and TUI reflect the new key.
  • Docs: add OrcaRouter to the first-class providers reference and env-var table.
  • Required to use: set ORCAROUTER_API_KEY and choose a validated model name such as orcarouter/auto or orcarouter/deepseek/deepseek-v4-pro. No changes required for existing providers.

Written for commit 4e2bef0. Summary will update on new commits.

Review in cubic

Add OrcaRouter as a named OpenAI-compatible gateway provider, mirroring the
existing openai/groq/cerebras wiring:

- protocol: register orcarouter in ModelProviderSchema, add OrcaRouterModelId/
  OrcaRouterModelName schemas (gateway aliases like orcarouter/auto and
  vendor-prefixed models like orcarouter/deepseek/deepseek-v4-pro)
- extension: route orcarouter through createOpenAI at
  https://api.orcarouter.ai/v1 via the Responses API, with a chat-completions
  fallback for stop sequences
- evals + integrations facade: read ORCAROUTER_API_KEY for orcarouter models
- docs: add OrcaRouter to the first-class providers reference
- regenerate protocol JSON, Python, and Go clients; add tests + changeset

Signed-off-by: JinhaoSong322 <jinhao.song@myflashcloud.com>
@JinhaoSong322
JinhaoSong322 requested a review from a team as a code owner August 20, 2026 01:06
@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4e2bef0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@browserbasehq/stagehand Minor
@browserbasehq/stagehand-extension Minor
@browserbasehq/stagehand-protocol Minor
@browserbasehq/stagehand-python Minor
@browserbasehq/stagehand-go Minor
@browserbasehq/stagehand-integrations Patch
@browserbasehq/stagehand-integrations-example-eve-facade Patch
@browserbasehq/stagehand-integrations-example-pi-facade Patch
@browserbasehq/stagehand-integrations-example-claude-code-facade Patch
@browserbasehq/stagehand-integrations-example-codex-facade Patch
@browserbasehq/stagehand-integrations-example-mastra-facade Patch
@browserbasehq/stagehand-integrations-example-vercel-ai-facade Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run.
Approving the latest commit mirrors it into an internal PR owned by the approver.
If new commits are pushed later, the internal PR stays open but is marked stale until someone approves the latest external commit and refreshes it.

@github-actions github-actions Bot added external-contributor Tracks PRs mirrored from external contributor forks. external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. labels Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor:awaiting-approval Waiting for a stagehand team member to approve the latest external commit. external-contributor Tracks PRs mirrored from external contributor forks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant