// Test script to list available Gemini models
const GEMINI_API_KEY = "AIzaSyCvzW1kMjM_PR_jz56PeknxputAjIBypfY";

async function listModels() {
    const url = `https://generativelanguage.googleapis.com/v1/models?key=${GEMINI_API_KEY}`;

    try {
        const response = await fetch(url);
        const data = await response.json();

        console.log("Available models for your API key:");
        console.log(JSON.stringify(data, null, 2));

        if (data.models) {
            console.log("\n\n=== Model Names ===");
            data.models.forEach(model => {
                console.log(`- ${model.name}`);
                if (model.supportedGenerationMethods) {
                    console.log(`  Supports: ${model.supportedGenerationMethods.join(', ')}`);
                }
            });
        }
    } catch (error) {
        console.error("Error:", error);
    }
}

listModels();
