feat: add OrcaRouter as a named alternative API provider - #239
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
feat: add OrcaRouter as a named alternative API provider#239XiaoHuo888-hue wants to merge 1 commit into
XiaoHuo888-hue wants to merge 1 commit into
Conversation
Add OrcaRouter to the API_PROVIDERS registry as a named alternative provider, mirroring the existing GLM/Kimi Anthropic-compatible wiring: - registry.py: 'orcarouter' provider entry (base_url https://api.orcarouter.ai, auth via ANTHROPIC_AUTH_TOKEN, Claude model tiers with anthropic/ prefixes) - Settings UI: provider chip, description, and top-bar OrcaRouter badge when selected (orcarouter_mode) - README.md / CLAUDE.md / .env.example: document the new provider - client.py: comment update Verified: ruff clean, mypy no new errors (12 pre-existing), 169 security tests + 55 pytest pass, UI lint/build clean, and live-tested the endpoint POST https://api.orcarouter.ai/v1/messages (200, model claude-sonnet-5). Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: jinhao.song <jinhao.song@myflashcloud.com>
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.
Summary
Add OrcaRouter as a named alternative API provider in AutoForge's Settings UI, mirroring the existing GLM/Kimi wiring for Anthropic-compatible providers.
OrcaRouter is an OpenAI/Anthropic-compatible model gateway that routes to Claude and other models through a single 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.
Changes
registry.py: Add anorcarouterentry toAPI_PROVIDERS:base_url:https://api.orcarouter.ai(client appends/v1/messages, matching the existing GLM base URL convention)auth_env_var:ANTHROPIC_AUTH_TOKEN(key pasted in the Settings UI is written to the SDK env)anthropic/claude-opus-5,anthropic/claude-sonnet-5,anthropic/claude-haiku-4.5(theanthropic/prefix is required by the gateway)SettingsModal.tsx,SettingsView.tsx): OrcaRouter provider chip + description; API key field appears automatically via the existingrequires_authflow.ControlBar.tsx): show an OrcaRouter badge when selected, mirroring the GLM badge.server/schemas.py/server/routers/settings.py/ui/src/lib/types.ts/ui/src/hooks/useProjects.ts: plumborcarouter_modealongsideglm_mode/ollama_mode..env.exampledocument the new provider.Verification
ruff checkclean on changed Python files.mypy: no new errors (12 pre-existing errors unchanged on cleanmain).python test_security.py: 169 passed;pytest test_client.py test_dependency_resolver.py test_rate_limit_utils.py: 55 passed.npm run lint(0 errors) andnpm run buildpass.POST https://api.orcarouter.ai/v1/messageswith modelanthropic/claude-sonnet-5returns HTTP 200 with a valid Anthropicmessageresponse.Disclosure: I'm an engineer on the OrcaRouter team.