gemini-docs / text_content /docs_api-versions_120c85ef.txt
arshjaved's picture
Add files using upload-large-folder tool
3854c3a verified
URL: https://ai.google.dev/gemini-api/docs/api-versions
Title: API versions explained  |  Gemini API  |  Google AI for Developers
==================================================
API versions explained | Gemini API | Google AI for Developers Skip to main content / English Deutsch Español – América Latina Français Indonesia Italiano Polski Português – Brasil Shqip Tiếng Việt Türkçe Русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 – 简体 中文 – 繁體 日本語 한국어 Sign in Gemini 2.5 Flash Image (aka Nano Banana) is now available in the Gemini API! Learn more Home Gemini API API Reference Send feedback API versions explained This document provides a high-level overview of the differences between the v1 and v1beta versions of the Gemini API. v1 : Stable version of the API. Features in the stable version are fully-supported over the lifetime of the major version. If there are any breaking changes, then the next major version of the API will be created and the existing version will be deprecated after a reasonable period of time. Non-breaking changes may be introduced to the API without changing the major version. v1beta : This version includes early-access features that may be under development and is subject to rapid and breaking changes. There is also no guarantee that the features in the Beta version will move to the stable version. Due to this instability, you should consider not launching production applications with this version. Feature v1 v1beta Generate Content - Text-only input Generate Content - Text-and-image input Generate Content - Text output Generate Content - Multi-turn conversations (chat) Generate Content - Function calls Generate Content - Streaming Embed Content - Text-only input Generate Answer Semantic retriever - Supported - Will never be supported Configure API version in an SDK The Gemini API SDK's default to v1beta , but you can opt to use other versions by setting the API version as shown in the following code sample: Python from google import genai client = genai . Client ( http_options = { 'api_version' : 'v1alpha' }) response = client . models . generate_content ( model = 'gemini-2.0-flash' , contents = "Explain how AI works" , ) print ( response . text ) JavaScript import { GoogleGenAI } from "@google/genai" ; const ai = new GoogleGenAI ({ httpOptions : { apiVersion : "v1alpha" }, }); async function main () { const response = await ai . models . generateContent ({ model : "gemini-2.0-flash" , contents : "Explain how AI works" , }); console . log ( response . text ); } await main (); REST curl "https://generativelanguage.googleapis.com/v1/models/gemini-1.5-flash:generateContent" \ -H "x-goog-api-key: $GEMINI_API_KEY " \ -H 'Content-Type: application/json' \ -X POST \ -d '{ "contents": [{ "parts":[{"text": "Explain how AI works."}] }] }' Send feedback Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates. Last updated 2025-08-21 UTC.