// Endpoint discovery: /models with and without /v1, /user/balance, HEAD-ish checks. import { raw, save } from "./lib.ts"; const out: Record = {}; out.models = await raw("/models"); out.models_v1 = await raw("/v1/models"); out.balance = await raw("/user/balance"); out.balance_v1 = await raw("/v1/user/balance"); out.chat_v1 = await raw("/v1/chat/completions", { method: "POST", body: JSON.stringify({ model: "deepseek-v4-flash", messages: [{ role: "user", content: "Say OK" }], max_tokens: 5, thinking: { type: "disabled" } }), }); out.chat_beta = await raw("/beta/chat/completions", { method: "POST", body: JSON.stringify({ model: "deepseek-v4-flash", messages: [{ role: "user", content: "Say OK" }], max_tokens: 5, thinking: { type: "disabled" } }), }); out.files = await raw("/files"); save("00-models.json", out); for (const [k, v] of Object.entries(out)) console.log(k, (v as any).status, JSON.stringify((v as any).body).slice(0, 400), JSON.stringify((v as any).headers));