343 google-genai - configuration reference
344 google-genai — configuration reference
Configuration surfaces for google-genai (safety class: safe; category: o-05-ai-engineering-sdks-dev-env) — detected from the upstream documentation at generation time (5 config-surface markers). The invocation reference stays on the main tool page.
344.1 Configuration files
No config-file paths surfaced in the upstream README at generation time — the tool likely takes options through flags or environment instead; see upstream.
344.2 Environment variables
| Variable | Upstream context |
|---|---|
GEMINI_API_KEY |
ock for Gemini Developer API client = genai.Client(api_key=‘GEMINI_API_KEY’) python from google import genai # Only run t |
GOOGLE_API_KEY |
rm. Gemini Developer API: Set the GEMINI_API_KEY or GOOGLE_API_KEY. It will automatically be picked up by the client. It’ |
GOOGLE_GENAI_USE_ENTERPRISE |
nd GOOGLE_CLOUD_LOCATION, as shown below: bash export GOOGLE_GENAI_USE_ENTERPRISE=true export GOOGLE_CLOUD_PROJECT='your-pro | | `GOOGLE_CLOUD_PROJECT` | ow:bash export GOOGLE_GENAI_USE_ENTERPRISE=true export GOOGLE_CLOUD_PROJECT=‘your-project-id’ export GOOGLE_CLOUD_LOCATION=’g |
GOOGLE_CLOUD_LOCATION |
E=true export GOOGLE_CLOUD_PROJECT=‘your-project-id’ export GOOGLE_CLOUD_LOCATION=‘global’ python from google import genai |
HTTPS_PROXY |
ILE) by setting the environment variables: ```bash export HTTPS_PROXY='http://username:password@proxy_uri:port' export SSL_CERT_ | |SSL_CERT_FILE| TTPS_PROXY='http://username:password@proxy_uri:port' export SSL_CERT_FILE='client.pem' ``` If you needsocks5proxy, httpx [sup | |YOUR_IMAGE_PATH| aPartobject. ```python from google.genai import types YOUR_IMAGE_PATH = 'your_image_path' YOUR_IMAGE_MIME_TYPE = 'your_image | |YOUR_IMAGE_MIME_TYPE` |
Names extracted heuristically from upstream docs — verify each against the tool’s own docs before use.
344.3 Sample configuration (upstream)
from google.genai import types
response = client.models.generate_content(
model='gemini-3.1-flash-lite-image',
contents='A cartoon infographic for flying sneakers',
config=types.GenerateContentConfig(
response_modalities=["IMAGE"],
image_config=types.ImageConfig(
aspect_ratio="9:16",
),
),
)
for part in response.parts:
if part.inline_data:
generated_image = part.as_image()
generated_image.show()
from google.genai import types
response = client.models.generate_content(
model='gemini-flash-latest',
contents='high',
config=types.GenerateContentConfig(
system_instruction='I say high, you say low',
max_output_tokens=3,
),
)
print(response.text)
ref: pin - verified 2026-10-14