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.
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
fromgoogleimportgenaiclient=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";constai=newGoogleGenAI({httpOptions:{apiVersion:"v1alpha"},});asyncfunctionmain(){constresponse=awaitai.models.generateContent({model:"gemini-2.0-flash",contents:"Explain how AI works",});console.log(response.text);}awaitmain();
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'\
-XPOST\
-d'{ "contents": [{ "parts":[{"text": "Explain how AI works."}] }] }'
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-21 UTC."],[],[],null,["# API versions explained\n\nThis document provides a high-level overview of the differences between the `v1`\nand `v1beta` versions of the Gemini API.\n\n- **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.\n- **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.\n\n| Feature | v1 | v1beta |\n|----------------------------------------------------|----|--------|\n| Generate Content - Text-only input | | |\n| Generate Content - Text-and-image input | | |\n| Generate Content - Text output | | |\n| Generate Content - Multi-turn conversations (chat) | | |\n| Generate Content - Function calls | | |\n| Generate Content - Streaming | | |\n| Embed Content - Text-only input | | |\n| Generate Answer | | |\n| Semantic retriever | | |\n\n- - Supported\n- - Will never be supported\n\nConfigure API version in an SDK\n-------------------------------\n\nThe Gemini API SDK's default to `v1beta`, but you can opt to use other versions\nby setting the API version as shown in the following code sample: \n\n### Python\n\n from google import genai\n\n client = genai.Client(http_options={'api_version': 'v1alpha'})\n\n response = client.models.generate_content(\n model='gemini-2.0-flash',\n contents=\"Explain how AI works\",\n )\n\n print(response.text)\n\n### JavaScript\n\n import { GoogleGenAI } from \"@google/genai\";\n\n const ai = new GoogleGenAI({\n httpOptions: { apiVersion: \"v1alpha\" },\n });\n\n async function main() {\n const response = await ai.models.generateContent({\n model: \"gemini-2.0-flash\",\n contents: \"Explain how AI works\",\n });\n console.log(response.text);\n }\n\n await main();\n\n### REST\n\n curl \"https://generativelanguage.googleapis.com/v1/models/gemini-1.5-flash:generateContent\" \\\n -H \"x-goog-api-key: $GEMINI_API_KEY\" \\\n -H 'Content-Type: application/json' \\\n -X POST \\\n -d '{\n \"contents\": [{\n \"parts\":[{\"text\": \"Explain how AI works.\"}]\n }]\n }'"]]