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
+11 -19
View File
@@ -255,24 +255,16 @@ 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 {
success: true,
models: [
{ id: 'minimax-2.7', name: 'MiniMax 2.7' },
{ id: 'minimax-3.0', name: 'MiniMax 3.0' }
]
};
} catch (error: any) {
return { success: false, error: error.message || 'Erro ao conectar com MiniMax' };
} }
return {
success: true,
models: [
{ id: 'minimax-2.7', name: 'MiniMax 2.7' },
{ id: 'minimax-3.0', name: 'MiniMax 3.0' }
]
};
}; };