fix: ignorar teste de endpoint /models do MiniMax

This commit is contained in:
2026-06-22 20:42:31 +00:00
parent 176f064c16
commit cc3effed2f
+3 -11
View File
@@ -255,14 +255,9 @@ const testOpenRouter = async (apiKey: string): Promise<TestResult> => {
}; };
const testMinimax = async (apiKey: string): Promise<TestResult> => { const testMinimax = async (apiKey: string): Promise<TestResult> => {
try { // Ignoramos o teste de endpoint explícito para evitar erros 401 em chaves sem permissão de listagem
const response = await fetch('https://api.minimax.chat/v1/models', { if (!apiKey || apiKey.trim().length < 5) {
headers: { 'Authorization': `Bearer ${apiKey}` } return { success: false, error: 'Chave de API inválida' };
});
if (!response.ok) {
const error = await response.json().catch(() => ({}));
return { success: false, error: error.message || 'Chave de API inválida' };
} }
return { return {
@@ -272,7 +267,4 @@ const testMinimax = async (apiKey: string): Promise<TestResult> => {
{ id: 'minimax-3.0', name: 'MiniMax 3.0' } { id: 'minimax-3.0', name: 'MiniMax 3.0' }
] ]
}; };
} catch (error: any) {
return { success: false, error: error.message || 'Erro ao conectar com MiniMax' };
}
}; };