Skip to content

feat(ai): add OpenRouter provider - #971

Merged
antonreshetov merged 1 commit into
mainfrom
feat/openrouter-provider
Oct 7, 2026
Merged

antonreshetov merged 1 commit into
mainfrom
feat/openrouter-provider

Conversation

@antonreshetov

Copy link
Copy Markdown
Member

Adds OpenRouter as a dedicated cloud provider for the AI assistant, as discussed in #964. A generic OpenAI-compatible URL stays a separate follow-up.

  • Uses @openrouter/ai-sdk-provider@^2.10 (compatible with ai@6) through the existing SDK path: streaming, tool calling and reasoning replay. The endpoint is pinned to https://openrouter.ai/api/v1 and the requests use the existing guarded fetch.
  • The model list only includes tool-capable models (supported_parameters=tools) and hides :batch variants, which return 404 in chat.
  • /models on OpenRouter is public, so the key is verified with GET /key before listing models.
  • Reasoning responses without signatures (DeepSeek, Qwen, etc.) no longer fail with upstream: undefined-valued provider metadata is normalized before replay validation.
  • A rejected key after saving the connection now shows a dedicated message (all providers). HTTP 402 (no credits) maps to the quota error.
  • sdkModel is now an exhaustive switch, so a new SDK provider without a model fails typecheck.
  • Docs: OpenRouter row in the AI provider table and the home page mention.

@antonreshetov antonreshetov self-assigned this Oct 7, 2026
@antonreshetov
antonreshetov merged commit 8e94d6d into main Oct 7, 2026
@antonreshetov
antonreshetov deleted the feat/openrouter-provider branch October 7, 2026 06:33
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