import { readFileSync } from 'node:fs' import { homedir } from 'node:os' import { join } from 'node:path' const cfg = JSON.parse(readFileSync(join(homedir(), 'Documents/Essay_AI/Essay_system/dsh-markmag/.local-credentials.json'), 'utf8')) const key = cfg.key1 const url = 'https://brain.sidaocai.cn/tdb-api/claude-code/default/v1/messages' const candidates = ['glm-5.3', 'glm-5.3-flash', 'glm-5.3-flashx', 'deepseek-v4-pro', 'deepseek-flash', 'deepseek-chat', 'deepseek-v3', 'kimi-k2', 'qwen3-max'] for (const model of candidates) { const t0 = Date.now() try { const res = await fetch(url, { method: 'POST', headers: { 'content-type': 'application/json', 'x-api-key': key, 'anthropic-version': '2023-06-01' }, body: JSON.stringify({ model, max_tokens: 8, messages: [{ role: 'user', content: 'hi' }] }), signal: AbortSignal.timeout(30000), }) const text = await res.text() const ok = res.status === 200 const brief = ok ? 'OK' : (() => { try { const j = JSON.parse(text); return (j.error?.code || '') + ' ' + (j.error?.message || '').slice(0, 60) } catch { return text.slice(0, 60) } })() console.log((ok ? '✅' : '❌'), model.padEnd(16), res.status, (Date.now() - t0) + 'ms', brief) } catch (e) { console.log('❌', model.padEnd(16), 'FAIL', e.name) } }