94 cards across 6 sections
Flash
Pro
Flash-Lite
google-genai
gemini-3.8-flash
response_json_schema
gemini-3.1-pro-preview
gemini-3.7-flash
gemini-3.6-flash
generate_content
gemini-3.5-flash-lite
gemini-3.1-flash-lite
gemini-2.5-pro
gemini-2.5-flash
thinking_config
thinking_level
low
medium
high
gemini-3-pro-image
gemini-3.5-transcribe
gemini-embedding-2
-preview
pip install -U google-genai
npm install @google/genai
genai.Client()
GEMINI_API_KEY
vertexai=True
client.models.generate_content(model=..., contents=...)
.text
contents
Content
Part
temperature
max_output_tokens
system_instruction
tools
response_mime_type
GenerateContentConfig
config
client.chats.create(model=...)
send_message()
POST /v1beta/models/gemini-3.8-flash:generateContent
types.Part.from_bytes(data=..., mime_type="image/png")
client.files.upload()
client.models.count_tokens(model=..., contents=...)
total_tokens
MAX_TOKENS
client.caches.create(model=..., config=CreateCachedContentConfig(contents=[...]))
cached_content
name
description
parameters
auto
any
none
response_mime_type="application/json"
MyModel.model_json_schema()
google_search
client.models.embed_content(model="gemini-embedding-001", contents=...)
task_type
RETRIEVAL_DOCUMENT
RETRIEVAL_QUERY
SEMANTIC_SIMILARITY
CLASSIFICATION
CLUSTERING
HARASSMENT
HATE_SPEECH
SEXUALLY_EXPLICIT
DANGEROUS
OFF
safety_settings
generate_content_stream()
npm install -g @google/gemini-cli
api_key
from google import genaiclient = genai.Client()r = client.models.generate_content( model="gemini-3.8-flash", contents="Hi")print(r.text)
generate_content_stream
stream = client.models.generate_content_stream( model="gemini-3.8-flash", contents=prompt)for chunk in stream: print(chunk.text, end="")
config = types.GenerateContentConfig( system_instruction="You are a terse SRE.")client.models.generate_content( model="gemini-3.8-flash", contents=q, config=config)
img = types.Part.from_bytes( data=raw_bytes, mime_type="image/png")client.models.generate_content( model="gemini-3.8-flash", contents=[img, "Describe this image"])
config = types.GenerateContentConfig( response_mime_type="application/json", response_json_schema=Recipe.model_json_schema())client.models.generate_content( model="gemini-3.8-flash", contents=q, config=config)
tools = [{ "name": "get_weather", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}}}]
call = response.function_calls[0]result = run_locally(call.name, call.args)client.models.generate_content( model="gemini-3.8-flash", contents=[..., call, result_part])
config = types.GenerateContentConfig( tools=[types.Tool( google_search=types.GoogleSearch())])
n = client.models.count_tokens( model="gemini-3.8-flash", contents=prompt)print(n.total_tokens)
cache = client.caches.create( model="gemini-3.8-flash", config=types.CreateCachedContentConfig( contents=[big_pdf], ttl="3600s"))
r = client.models.embed_content( model="gemini-embedding-001", contents=chunk, config={"task_type": "RETRIEVAL_DOCUMENT"})
config = types.GenerateContentConfig( safety_settings=[types.SafetySetting( category="HARM_CATEGORY_HARASSMENT", threshold="BLOCK_ONLY_HIGH")])
chat = client.chats.create(model="gemini-3.8-flash")chat.send_message("Hi, I'm Ana")chat.send_message("What's my name?")
npm install -g @google/gemini-cligemini> explain this repo's build script
config = types.GenerateContentConfig( thinking_config=types.ThinkingConfig( thinking_level="low"))
client.caches.create()
gemini-embedding-001
response.function_calls
count_tokens
google_search_call