Skip to content

feat: add OrcaRouter as an AI gateway option - #63

Open
Marc-oss-hub wants to merge 1 commit into
h9zdev:mainfrom
Marc-oss-hub:feat/orcarouter-provider
Open

feat: add OrcaRouter as an AI gateway option#63
Marc-oss-hub wants to merge 1 commit into
h9zdev:mainfrom
Marc-oss-hub:feat/orcarouter-provider

Conversation

@Marc-oss-hub

Copy link
Copy Markdown

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.py
    • New ORCAROUTER_API_KEY env var (alongside OPENROUTER_API_KEY).
    • analyze_with_ai() now routes through OrcaRouter (https://api.orcarouter.ai/v1/chat/completions, model google/gemini-3.1-flash-lite) whenever ORCAROUTER_API_KEY is 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 — added ORCAROUTER_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_KEY in .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.
  • Live: POST https://api.orcarouter.ai/v1/chat/completions with google/gemini-3.1-flash-lite and 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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant