claude-code - 💡(How to fix) Fix [BUG] Desktop app does not save OpenRouter API key [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52848Fetched 2026-04-25 06:19:16
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

When attempting to add an OpenRouter API key through the Claude Code desktop app settings UI, the key is not saved/persisted.

Root Cause

When attempting to add an OpenRouter API key through the Claude Code desktop app settings UI, the key is not saved/persisted.

Fix Action

Workaround

Setting the key manually in ~/.claude/settings.json under env works, but the desktop UI should handle this properly — validating the key and fetching available models for selection.

RAW_BUFFERClick to expand / collapse

Description

When attempting to add an OpenRouter API key through the Claude Code desktop app settings UI, the key is not saved/persisted.

Expected Behavior

The desktop app should:

  1. Accept the OpenRouter API key when entered in the settings
  2. Validate the key by checking its validity against the OpenRouter API
  3. Fetch and display the available models associated with that API key

Actual Behavior

The OpenRouter API key is not persisted after being entered in the desktop app settings.

Environment

  • OS: Windows 11 Pro (10.0.26200)
  • Platform: Claude Code Desktop App
  • Version: Latest (auto-update channel: latest)

Steps to Reproduce

  1. Open Claude Code desktop app
  2. Navigate to settings/API configuration
  3. Attempt to add an OpenRouter API key
  4. Key does not save / is lost on app restart

Workaround

Setting the key manually in ~/.claude/settings.json under env works, but the desktop UI should handle this properly — validating the key and fetching available models for selection.

Additional Context

Third-party API providers (like OpenRouter) are important for users who route through alternative endpoints. The desktop app should have first-class support for adding, validating, and managing these keys through the UI.

🤖 Generated with Claude Code

extent analysis

TL;DR

The issue can likely be resolved by modifying the desktop app's settings UI to properly handle and persist the OpenRouter API key.

Guidance

  • Verify that the API key is being sent correctly to the backend for validation and storage by checking the network requests made by the desktop app.
  • Check the desktop app's code for any issues with storing the API key in the app's local storage or settings file.
  • Ensure that the ~/.claude/settings.json file is being read and written correctly by the desktop app, as manual modification of this file currently works as a workaround.
  • Investigate if there are any specific requirements or constraints for storing and managing third-party API keys in the desktop app's settings UI.

Example

No specific code example can be provided without more information about the desktop app's codebase, but the issue may be related to how the API key is being handled in the settings UI code.

Notes

The issue may be specific to the Windows 11 Pro environment or the latest version of the Claude Code desktop app, so testing on different environments or versions may be necessary to reproduce and resolve the issue.

Recommendation

Apply a workaround by manually setting the API key in ~/.claude/settings.json until a proper fix can be implemented in the desktop app's settings UI, as this allows users to continue using the OpenRouter API while the issue is being resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Desktop app does not save OpenRouter API key [1 participants]