google-genai
GenAI Python SDK
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained (1-day-old release), has no known vulnerabilities, permissive licensing, and low install friction. It is the official SDK for Gemini access and ranks in the top 1000 PyPI packages by downloads. Install it if you need to integrate Gemini models into Python applications; pin the version to < 3.0.0 if you want to avoid breaking changes in the next major release.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a valid Gemini API key (GEMINI_API_KEY or GOOGLE_API_KEY environment variable) or Google Cloud credentials for enterprise use; Python >= 3.10.
- Low friction: pure Python wheel with 10 runtime dependencies (httpx, pydantic, google-auth, requests, tenacity, websockets, anyio, typing-extensions, distro, sniffio).
- Actively maintained with a release 1 day old and 3921 repository stars.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most production and proprietary projects.
last release 2026-08-13 (1 days) · last repo commit 2026-08-13 · 3,921 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 298,050,427 downloads/mo, #139 on PyPI
Alternatives
Verify before relying
pip install google-genai
from google import genai
client = genai.Client(api_key='GEMINI_API_KEY')
response = client.models.generate_content(
model='gemini-2.5-flash',
contents={'text': 'Why is the sky blue?'},
)
print(response.text)- Whether the 10 runtime dependencies introduce any transitive security concerns beyond the direct OSV scan.
- Performance characteristics of the optional aiohttp backend versus the default httpx implementation.
- Stability of the beta API endpoints used by default versus the v1 stable endpoints.
What it is and what it does
The Google Gen AI SDK is the official Python client for accessing Google's Gemini generative models and the Gemini Enterprise Agent Platform. It abstracts the HTTP layer and authentication, allowing developers to call model inference methods (generate_content, streaming, async variants) with either Pydantic types or plain dictionaries. The SDK supports both the public Gemini Developer API (via API key) and enterprise deployments on Google Cloud.
The package depends on httpx for HTTP transport, pydantic for type validation, google-auth for credential handling, and tenacity for automatic retry logic. It offers sync and async clients, context managers for resource cleanup, and configurable API versions (beta, v1, v1alpha). A major version bump (3.0.0) is planned with breaking changes to function-calling behavior; users should pin to < 3.0.0 to avoid unexpected updates.
Use it for
- Build a chatbot or conversational AI application by calling generate_content with streaming responses.
- Integrate Gemini models into data analysis pipelines to process and summarize large text or structured datasets.
- Deploy enterprise AI agents on Google Cloud using the Gemini Enterprise Agent Platform with project-based authentication.
- Add real-time AI capabilities to Python web services using the async client with httpx or aiohttp.
- Prototype and test generative AI features with configurable temperature, top_p, and top_k sampling parameters.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained (1-day-old release), has no known vulnerabilities, permissive licensing, and low install friction. It is the official SDK for Gemini access and ranks in the top 1000 PyPI packages by downloads. Install it if you need to integrate Gemini models into Python applications; pin the version to < 3.0.0 if you want to avoid breaking changes in the next major release.
Install
google-genai on PyPI
Before you install
Low friction: pure Python wheel with 10 runtime dependencies (httpx, pydantic, google-auth, requests, tenacity, websockets, anyio, typing-extensions, distro, sniffio). Actively maintained with a release 1 day old and 3921 repository stars.
Requires a valid Gemini API key (GEMINI_API_KEY or GOOGLE_API_KEY environment variable) or Google Cloud credentials for enterprise use; Python >= 3.10.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most production and proprietary projects.
Quickstart
pip install google-genai
from google import genai
client = genai.Client(api_key='GEMINI_API_KEY')
response = client.models.generate_content(
model='gemini-2.5-flash',
contents={'text': 'Why is the sky blue?'},
)
print(response.text)
Verify before relying
- Whether the 10 runtime dependencies introduce any transitive security concerns beyond the direct OSV scan.
- Performance characteristics of the optional aiohttp backend versus the default httpx implementation.
- Stability of the beta API endpoints used by default versus the v1 stable endpoints.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 10 packagesanyiogoogle-authhttpxpydanticrequeststenacitywebsocketstyping-extensionsdistrosniffio |
| Maintenance | Actively maintained 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 298,050,427 / month, #139 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: InternetTopic :: Software Development :: Libraries :: Python Modules |
Evidence: google_genai-2.18.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “gemini enterprise agent platform”
- google-genaiPython SDK for integrating Google's Gemini generative models and the…
- google-agents-cliA CLI toolchain that equips coding agents (Claude Code, Antigravity…
- google-cloud-aiplatformPython SDK for building, deploying, and managing AI agents and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also google-generativeai · google-cloud-aiplatform · vertexai · google-antigravity · llama-index-embeddings-google-genai · google-agents-cli · notebooklm-py · opentelemetry-instrumentation-google-genai · langchain-google-genai · google-ai-generativelanguage