import fs from "fs";

const envContent = fs.readFileSync(".env.local", "utf-8");
const apiKeyMatch = envContent.match(/OPENROUTER_API_KEY=([^\r\n]+)/);
const apiKey = apiKeyMatch ? apiKeyMatch[1].trim() : "";

async function checkLuna56() {
  const res = await fetch("https://openrouter.ai/api/v1/models", {
    headers: { "Authorization": `Bearer ${apiKey}` }
  });
  const data = await res.json();
  const models = data.data || [];

  const matches = models.filter(m => 
    m.id.toLowerCase().includes("5.6") || 
    m.id.toLowerCase().includes("luna") ||
    m.name.toLowerCase().includes("5.6") ||
    m.name.toLowerCase().includes("luna")
  );

  console.log("=== MATCHES FOR '5.6' / 'LUNA' ===");
  matches.forEach(m => {
    console.log(`- ID: ${m.id}`);
    console.log(`  Name: ${m.name}`);
    console.log(`  Modalities: ${JSON.stringify(m.architecture?.modality || 'unknown')}`);
    console.log(`  Pricing: ${JSON.stringify(m.pricing)}`);
  });
}

checkLuna56().catch(console.error);
