feat: add OpenRouter provider and profiles - #53
Merged
Conversation
OpenRouter is an OpenAI-compatible gateway to 400+ models, so a single key covers both the meta/feedback agent and the target agent. Previously there was no way to run SIA with only an OpenRouter key: no provider JSON existed and the bundled defaults require ANTHROPIC_API_KEY. Note that #48 already added _is_openrouter_provider() to the pydantic-ai agent impl, which matches on provider_id == "openrouter" — but no such provider was bundled, so that branch was unreachable. This adds it. The meta profile uses the openhands agent impl rather than claude: _validate_meta rejects agent_impl "claude" paired with a non-anthropic provider, since the Claude Agent SDK only talks to Anthropic. No packaging change needed — the package-data globs already cover defaults/providers/*.json and defaults/profiles/*.json. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HPkffXZbzVPFLiaEy2PRfB
selvamHexo
force-pushed
the
feat/openrouter-provider-profiles
branch
from
August 25, 2026 22:03
313bca1 to
3e27c30
Compare
This was referenced Aug 25, 2026
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 an
openrouterprovider and a matching meta/target profile pair, so a singleOPENROUTER_API_KEYcan drive both the meta/feedback agent and the target agent across400+ models without a per-vendor account.
There was previously no way to run SIA with only an OpenRouter key: no provider JSON
existed, and the bundled defaults (
default-meta/default-target) requireANTHROPIC_API_KEY.Worth noting: #48 already added
_is_openrouter_provider()to the pydantic-ai agent impl,which matches on
provider.provider_id == "openrouter"— but no such provider was bundled,so that branch was unreachable. This PR supplies it.
Type of change
Select all that apply:
Related issue
Closes #
What changed
sia/defaults/providers/openrouter.json—client_kind: "openai",base_url: "https://openrouter.ai/api/v1",api_key_env: "OPENROUTER_API_KEY".sia/defaults/profiles/openrouter-meta.json—agent_impl: "openhands",model: "anthropic/claude-haiku-4.5". It usesopenhandsrather thanclaudebecause_validate_metarejectsagent_impl: "claude"paired with a non-anthropic provider (the Claude Agent SDK only talks to Anthropic).sia/defaults/profiles/openrouter-target.json— same model,agent_reference: "default".README.md—OPENROUTER_API_KEYin the key-export list, plus a one-key quickstart.docs/configuration.md— bundled-provider list, two rows in the bundled-profiles table, the API-keys block, and a new One OpenRouter key for both agents section covering model-id namespacing.No packaging change was needed:
[tool.setuptools.package-data]already globsdefaults/providers/*.jsonanddefaults/profiles/*.json. Verified all three JSONs land in abuilt wheel, which matters for anyone using stock
siafrom PyPI without cloning.How I tested this
Full check suite, plus live calls against a real OpenRouter key on both agent paths.
Live verification against a funded OpenRouter key:
OpenAI(base_url=provider.base_url, api_key=os.environ[provider.api_key_env])returned a completion served byanthropic/claude-haiku-4.5.run_agent_openhandswith theopenrouter-metaprofile wrote a file, executed it, and exited 0. litellm routed correctly asopenai/anthropic/claude-haiku-4.5.sia run— a--max_gen 1run onspaceship-titaniccompleted the orchestrator loop and generated atarget_agent.pypointed athttps://openrouter.ai/api/v1withOPENROUTER_API_KEY.Two known issues found while testing are not addressed here and are being raised separately:
AttributeError: 'str' object has no attribute 'type'. That is a gap inbuild_target_client_setupaffecting everyclient_kind: "openai"provider, not just this one.Security and privacy checklist
Documentation checklist
Contributor checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01HPkffXZbzVPFLiaEy2PRfB