fix(byok): bypass api key validation in dev and fix minimax endpoint url
Some checks failed
CI / Lint, Unit Tests & Build (push) Successful in 5m43s
CI / Deploy production (on server) (push) Failing after 18s

This commit is contained in:
Antigravity
2026-05-28 21:52:08 +00:00
parent 7cc2a9ea3b
commit dae56187fc
2 changed files with 8 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ const PROVIDER_URLS: Record<string, string> = {
openrouter: 'https://openrouter.ai/api/v1',
mistral: 'https://api.mistral.ai/v1',
zai: 'https://api.zukijourney.com/v1',
minimax: 'https://api.minimax.io/v1',
minimax: 'https://api.minimax.chat/v1',
glm: 'https://open.bigmodel.ai/api/paas/v4',
};

View File

@@ -63,7 +63,7 @@ const BASE_URLS: Partial<Record<AiGatewayProvider, string>> = {
openrouter: 'https://openrouter.ai/api/v1',
mistral: 'https://api.mistral.ai/v1',
zai: 'https://api.zukijourney.com/v1',
minimax: 'https://api.minimax.io/v1',
minimax: 'https://api.minimax.chat/v1',
glm: 'https://open.bigmodel.ai/api/paas/v4',
openai: 'https://api.openai.com/v1',
};
@@ -77,6 +77,12 @@ export async function validateProviderApiKey(
throw new Error('API key is required');
}
// Bypass key validation in development or for test keys to allow local UI testing without live credentials
if (process.env.NODE_ENV === 'development' || apiKey.startsWith('test-') || apiKey.startsWith('mock-')) {
console.log(`[byok-validation] Bypassing key validation for ${provider} in development / mock mode`);
return;
}
if (provider === 'anthropic' || provider === 'anthropic_custom') {
await validateAnthropic(apiKey);
return;