feat: add OrcaRouter as an AI gateway option - #63
Open
Marc-oss-hub wants to merge 1 commit into
Open
Conversation
Add OrcaRouter (https://www.orcarouter.ai) as a preferred AI gateway alongside the existing OpenRouter cloud backend: - app.py / app-exe.py: read ORCAROUTER_API_KEY and, when set, route analyze_with_ai() through https://api.orcarouter.ai/v1/chat/completions with model google/gemini-3.1-flash-lite; shared _call_ai_gateway helper keeps the OpenRouter path as a fallback - .env: ORCAROUTER_API_KEY entry - README.md: OrcaRouter added to the API list Co-Authored-By: Claude <noreply@anthropic.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
Adds OrcaRouter as a preferred AI gateway option alongside the existing OpenRouter cloud backend in
analyze_with_ai. OrcaRouter is an OpenAI-compatible model gateway exposing a large catalog of frontier and open models behind namespaced model IDs.Changes
app.py/app-exe.pyORCAROUTER_API_KEYenv var (alongsideOPENROUTER_API_KEY).analyze_with_ai()now routes through OrcaRouter (https://api.orcarouter.ai/v1/chat/completions, modelgoogle/gemini-3.1-flash-lite) wheneverORCAROUTER_API_KEYis set, and falls back to the existing OpenRouter path otherwise. A shared_call_ai_gateway()helper keeps both gateways' request logic in one place; the existing offline/simulation fallbacks are preserved..env— addedORCAROUTER_API_KEY=entry.README.md— OrcaRouter added to the API list.Why
OpenRouter and OrcaRouter are both OpenAI-compatible gateways, so OrcaRouter drops into the existing cloud-analysis path with one new env var and no architectural change. 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.
How to use
Set
ORCAROUTER_API_KEYin.env(or the environment) and the news-intelligence analysis will use OrcaRouter automatically. Without it, the app keeps using OpenRouter exactly as before.Verification
python -m py_compile app.py app-exe.py— clean.POST https://api.orcarouter.ai/v1/chat/completionswithgoogle/gemini-3.1-flash-liteand the exact HayOS request shape → HTTP 200 with a proper geopolitical assessment. (OrcaRouter free-tier models are currently rate-limited upstream, so the default is a reliable flash-lite model.)I'm an engineer on the OrcaRouter team.