Skip to content

List Models

This example assumes using Google.Gemini; is in scope and apiKey contains your Google.Gemini API key.

1
2
3
4
5
6
7
8
using var client = new GeminiClient(apiKey);

ListModelsResponse response = await client.ModelsListAsync();

foreach (var model in response.Models ?? [])
{
    Console.WriteLine(model.Name);
}