Skip to content

Commit 9696589

Browse files
authored
Merge pull request #5389 from STRRL/feat/identify-jan-on-openrouter
feat: identidy jan for openrouter
2 parents 9975580 + 9ff3cbe commit 9696589

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

web-app/src/lib/completion.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ export const sendCompletion = async (
138138
baseURL: provider.base_url,
139139
// Use Tauri's fetch to avoid CORS issues only for openai-compatible provider
140140
...(providerName === 'openai-compatible' && { fetch: fetchTauri }),
141+
// OpenRouter identification headers for Jan
142+
// ref: https://openrouter.ai/docs/api-reference/overview#headers
143+
...(provider.provider === 'openrouter' && {
144+
defaultHeaders: {
145+
'HTTP-Referer': 'https://jan.ai',
146+
'X-Title': 'Jan',
147+
},
148+
}),
141149
} as ExtendedConfigOptions)
142150
if (
143151
thread.model.id &&
@@ -286,10 +294,10 @@ export const extractToolCall = (
286294
* @param calls
287295
* @param builder
288296
* @param message
289-
* @param content
290-
* @param approvedTools - Record of approved tools per thread
291-
* @param showModal - Function to show approval modal, returns true if approved
292-
* @param allowAllMCPPermissions - Global setting to allow all MCP permissions without modal
297+
* @param abortController
298+
* @param approvedTools
299+
* @param showModal
300+
* @param allowAllMCPPermissions
293301
*/
294302
export const postMessageProcessing = async (
295303
calls: ChatCompletionMessageToolCall[],

0 commit comments

Comments
 (0)