import axios from 'axios';

async function test(name: string, url: string, key: string, model: string) {
  try {
    const r = await axios.post(url, {
      model, messages: [{role:'user',content:'hi'}], max_tokens: 10
    }, {
      headers: {'Authorization':`Bearer ${key}`,'Content-Type':'application/json'},
      timeout: 8000
    });
    console.log(`${name}: ✅ ${r.status}`);
  } catch(e: any) {
    console.log(`${name}: ❌ ${e.response?.status || e.message?.substring(0,60)}`);
  }
}

async function main() {
  // Test qwen
  await test('qwen', 'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions',
    'sk-c25679401ba24c749f53be86b0c9a7a6', 'qwen3.5-flash');
  
  // Test MiniMax (quota exhausted, just to verify)
  await test('minimax', 'https://api.minimax.chat/v1/chat/completions',
    'sk-cp-s8hGJr4ACdlZ4GM0LjZ1l2ZNBUAMGwd2ahl0c3W2g6C0EiNH0UvwOBx2q0oJOYO6ca5HqJccP_KRUPucoBizavlwDSZp-ohOGeUw2ymAdXPuM6r3CIDmmlY',
    'MiniMax-M2.7');
}

main();
