feat(providers): added openrouter support

This PR is adapted from namanbnsl's original
at https://github.com/namanbnsl/Perplexica/tree/add-openrouter-support

Added minor modifications to bring the openrouter support in line
with the changes in this forked repo
This commit is contained in:
kmac 2025-05-31 21:34:23 -04:00
parent 6422c5b7e0
commit 94315c169a
7 changed files with 108 additions and 0 deletions

View file

@ -28,6 +28,7 @@ interface SettingsType {
};
openaiApiKey: string;
groqApiKey: string;
openrouterApiKey: string;
anthropicApiKey: string;
geminiApiKey: string;
ollamaApiUrl: string;
@ -1352,6 +1353,25 @@ export default function SettingsPage() {
/>
</div>
<div className="flex flex-col space-y-1">
<p className="text-black/70 dark:text-white/70 text-sm">
OpenRouter API Key
</p>
<InputComponent
type="password"
placeholder="OpenRouter API Key"
value={config.openrouterApiKey}
isSaving={savingStates['openrouterApiKey']}
onChange={(e) => {
setConfig((prev) => ({
...prev!,
openrouterApiKey: e.target.value,
}));
}}
onSave={(value) => saveConfig('openrouterApiKey', value)}
/>
</div>
<div className="flex flex-col space-y-1">
<p className="text-black/70 dark:text-white/70 text-sm">
Anthropic API Key