Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🔼 feat: Vercel App Attribution for LibreChat (#9769)

Danny Avila91e49d82aaf9
diff --git a/packages/api/src/endpoints/openai/config.ts b/packages/api/src/endpoints/openai/config.ts
index d7412e0e1f..52c54ebaa6 100644
--- a/packages/api/src/endpoints/openai/config.ts
+++ b/packages/api/src/endpoints/openai/config.ts
@@ -41,6 +41,9 @@ export function getOpenAIConfig(
!isAnthropic &&
((baseURL && baseURL.includes(KnownEndpoints.openrouter)) ||
(endpoint != null && endpoint.toLowerCase().includes(KnownEndpoints.openrouter)));
+ const isVercel =
+ (baseURL && baseURL.includes('ai-gateway.vercel.sh')) ||
+ (endpoint != null && endpoint.toLowerCase().includes(KnownEndpoints.vercel));
let azure = options.azure;
let headers = options.headers;
@@ -80,7 +83,7 @@ export function getOpenAIConfig(
if (baseURL) {
configOptions.baseURL = baseURL;
}
- if (useOpenRouter) {
+ if (useOpenRouter || isVercel) {
configOptions.defaultHeaders = Object.assign(
{
'HTTP-Referer': 'https://librechat.ai',
diff --git a/packages/data-provider/src/config.ts b/packages/data-provider/src/config.ts
index 29de6c86ae..a79846b3de 100644
--- a/packages/data-provider/src/config.ts
+++ b/packages/data-provider/src/config.ts
@@ -889,6 +889,7 @@ export enum KnownEndpoints {
shuttleai = 'shuttleai',
'together.ai' = 'together.ai',
unify = 'unify',
+ vercel = 'vercel',
xai = 'xai',
}
@@ -925,6 +926,7 @@ export const alternateName = {
[KnownEndpoints.ollama]: 'Ollama',
[KnownEndpoints.deepseek]: 'DeepSeek',
[KnownEndpoints.xai]: 'xAI',
+ [KnownEndpoints.vercel]: 'Vercel',
};
const sharedOpenAIModels = [