Skip to main content
Glama
test_api.ts1.19 kB
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();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kml-einerd/Nanobanana_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server