getting started with Google GenAI SDK

To get started with Google GenAI SDK key, first you need to create an API key here.

https://aistudio.google.com/app/api-keys

After that, you can fire up your python env and install 


pip install -q -U google-genai

Setting up API key in your environment

export GOOGLE_API_KEY="your-key-here"

And then do a hello work python with the following code: 


from google import genai

# The client gets the API key from the environment variable `GEMINI_API_KEY`.
client = genai.Client()

response = client.models.generate_content(
    model="gemini-3-flash-preview", contents="Explain how AI works in a few words"
)
print(response.text)




Comments

Popular posts from this blog

vllm : Failed to infer device type

android studio kotlin source is null error

gemini cli getting file not defined error