Skip to content

Add OpenRouter as a new AI provider#12626

Open
RemiKalbe wants to merge 8 commits intogitbutlerapp:masterfrom
RemiKalbe:master
Open

Add OpenRouter as a new AI provider#12626
RemiKalbe wants to merge 8 commits intogitbutlerapp:masterfrom
RemiKalbe:master

Conversation

@RemiKalbe
Copy link
Copy Markdown

@RemiKalbe RemiKalbe commented Feb 28, 2026

🧢 Changes

Add OpenRouter as a new AI provider. OpenRouter exposes an OpenAI-compatible API, so the frontend reuses OpenAIClient with the OpenRouter base URL. The model name is a free-form text input since OpenRouter supports hundreds of models in provider/model format (e.g. openai/gpt-4.1-mini).

Frontend: new OpenRouter variant in ModelKind, config keys, secret handle, service methods, settings panel with API key and model inputs, and two new tests.

Backend: new OpenRouterProvider following the LM Studio pattern which implements OpenAIClientProvider + LLMClient, reads API key from secret storage with OPENROUTER_API_KEY env var fallback.

CSP: added https://openrouter.ai to connect-src.

🎫 Affected issues

Fixes: #12070

Preview

CleanShot 2026-02-27 at 16 26 46@2x

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 28, 2026

@RemiKalbe is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eaa15c57d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Byron
Copy link
Copy Markdown
Collaborator

Byron commented Feb 28, 2026

Thanks a lot for contributing!

At first glance it does look like a run-of-the-mill integration that might do the trick, but I didn't test it locally, nor am I aware of any gotchas to look out for.

Hence, let's pass this on to @estib-vega for proper validation.

PS: pnpm begood should fix the frontend lint errors, cargo fmt will do the same to the backend, cargo clippy --workspace --all-targets should do the rest.

@Byron
Copy link
Copy Markdown
Collaborator

Byron commented Feb 28, 2026

@codex review

@Byron Byron marked this pull request as draft February 28, 2026 04:12
@Byron Byron requested a review from estib-vega February 28, 2026 04:12
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e05843155

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@RemiKalbe RemiKalbe marked this pull request as ready for review March 24, 2026 01:00
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce2d869866

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- Removes leading and trailing whitespace from keys
- Prevents validation errors caused by accidental spaces
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.

Support OpenRouter as AI Provider

2 participants