import axios from 'axios';
// Replace with the user's key during execution or use env var
const API_KEY = 'AIzaSyCUV7n63Ds8qFYmjtwSrgfRzxajZ0zF83Y';
async function testImageGeneration() {
// Trying the standard Gemini API for image generation if available or Vertex AI endpoint
// Note: Standard Gemini API (generativelanguage) usually only does text.
// We will try to see if we can hit the Vertex AI endpoint with the API Key.
// Or check if there is a 'media' endpoint.
// Endpoint trial 1: Vertex AI (via API Key - which might fail without OAuth)
// But let's try the Gemini API image generation endpoint if it exists
// Currently, Imagen 3 is "trusted tester" or via Vertex.
// Let's try to list models to see what we have access to
try {
const listModelsResponse = await axios.get(
`https://generativelanguage.googleapis.com/v1beta/models?key=${API_KEY}`
);
console.log('Available Models:', listModelsResponse.data.models.map((m: any) => m.name));
} catch (error: any) {
console.error('Error listing models:', error.response ? error.response.data : error.message);
}
}
testImageGeneration();