然后:
from google import genai
client = genai.Client(api_key="GEMINI_API_KEY")
response = client.models.generate_content(model='gemini-2.0-flash-exp', contents='How does AI work?')
print(response.text)
https://ai.google.dev/gemini-api/docs/models/gemini-v2
目前用起来还是免费的。