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