{"id":142,"library":"google-generativeai","title":"Google Generative AI SDK (Gemini)","description":"DEPRECATED. The original Python SDK for Gemini API (AI Studio). Replaced by google-genai (the unified Google Gen AI SDK). End-of-life: November 30, 2025. All support permanently ended. New features like Live API, Veo, Imagen 3 are only available in google-genai. Last version: 0.8.6. Do not use for new projects.","status":"deprecated","version":"0.8.6","language":"python","source_language":"en","source_url":"https://github.com/googleapis/python-genai","tags":["google","gemini","llm","genai","python","vertex-ai","deprecated"],"install":[{"cmd":"pip install google-genai","lang":"bash","label":"Python (new unified SDK — use this)"},{"cmd":"pip install google-generativeai","lang":"bash","label":"Python (deprecated — do not use for new projects)"}],"dependencies":[{"reason":"Required for Vertex AI mode authentication in google-genai.","package":"google-auth","optional":true}],"imports":[{"wrong":"from google import genai","symbol":"genai","correct":"import google.genai as genai"},{"wrong":"from google.genai import types","symbol":"types","correct":"from google.genai import types"}],"quickstart":{"code":"# pip install google-genai\nfrom google import genai\nfrom google.genai import types\nimport os\n\nclient = genai.Client(api_key=os.environ['GEMINI_API_KEY'])\n\nresponse = client.models.generate_content(\n    model='gemini-2.5-flash',\n    contents='What is the capital of France?',\n    config=types.GenerateContentConfig(\n        temperature=0.1,\n        max_output_tokens=256\n    )\n)\nprint(response.text)","lang":"python","description":"Minimal Gemini call using the new google-genai SDK 1.x."},"warnings":[{"fix":"pip install google-genai and migrate. Full migration guide at ai.google.dev/gemini-api/docs/libraries","message":"google-generativeai is fully end-of-life as of November 30, 2025. No bug fixes, no security patches, no new features. The repo is archived at google-gemini/deprecated-generative-ai-python.","severity":"breaking","affected_versions":"all"},{"fix":"Use google-genai with vertexai=True for Vertex AI access.","message":"google-cloud-aiplatform generative AI module deprecated June 24, 2026. SDK releases after that date will not include generative AI modules.","severity":"breaking","affected_versions":"google-cloud-aiplatform all versions"},{"fix":"Replace genai.configure(api_key=...) with client = genai.Client(api_key=...). Replace model.generate_content() with client.models.generate_content(model=..., contents=...).","message":"API surface completely changed. genai.configure() removed. GenerativeModel class removed. New SDK uses Client() instance with client.models.generate_content().","severity":"breaking","affected_versions":"google-generativeai all vs google-genai all"},{"fix":"from google.genai import types; types.GenerateContentConfig(temperature=0.1)","message":"GenerationConfig renamed to GenerateContentConfig and moved to google.genai.types.","severity":"breaking","affected_versions":"google-generativeai all vs google-genai all"},{"fix":"Set GEMINI_API_KEY for AI Studio usage. Use gcloud auth application-default login for Vertex AI mode.","message":"Two separate env vars for API key depending on mode. Gemini API mode reads GEMINI_API_KEY. Google AI Studio also accepts GOOGLE_API_KEY. Vertex AI mode uses Application Default Credentials.","severity":"gotcha","affected_versions":"google-genai all"},{"fix":"Always verify generated Gemini code uses 'from google import genai' not 'import google.generativeai as genai'.","message":"LLMs trained before 2025 have no knowledge of google-genai SDK. Will generate google-generativeai code (old API) by default. High hallucination risk on import pattern and Client() usage.","severity":"gotcha","affected_versions":"google-genai all"}],"env_vars":null,"search_vec":"'0.8.6':55 '2025':33 '3':45 '30':32 'ai':3,14,25,69 'api':13,42 'avail':48 'deprec':6,70 'end':28,37 'end-of-lif':27 'featur':39 'gemini':5,12,63 'gen':24 'genai':20,52,65 'generat':2 'googl':1,19,23,51,62 'google-genai':18,50 'imagen':44 'last':53 'life':30 'like':40 'live':41 'llm':64 'new':38,60 'novemb':31 'origin':8 'perman':36 'project':61 'python':9,66 'replac':16 'sdk':4,10,26 'studio':15 'support':35 'unifi':22 'use':58 'veo':43 'version':54 'vertex':68 'vertex-ai':67","created_at":"2026-03-24T03:59:31.178356+00:00","updated_at":"2026-04-16T15:25:13.146059+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":95,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"0.8.6","cli_name":"","cli_version":null,"type":"library","homepage":"https://ai.google.dev","github":"https://github.com/google/generative-ai-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/google-generativeai/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["llm-agents","ai-ml","gcp"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-08-26","next_check":"2026-07-30","install_tag":"verified"}}