curl -X GET https://generativelanguage.googleapis.com/v1beta/agents \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H "Api-Revision: 2026-05-20"
from google import genai
client = genai.Client()
response = client.agents.list()
for agent in response.agents or []:
print(agent.id)
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({});
const agents = await ai.agents.list();
for (const agent of (agents.agents ?? [])) {
console.log(agent.id);
}