Gemini 2.5 Pro
Google Gemini • Google Gen AI SDK (Developer API or Vertex AI)
google_gemini
Gemini 2.5 Pro
Model ID
gemini-2.5-proEndpoints
docs_home
https://ai.google.dev/gemini-api/docsInstall
Node
npm i @google/genaiPython
pip install google-genaiEnvironment
api_key
GEMINI_API_KEYCode examples
JavaScript
import { GoogleGenerativeAI } from "@google/genai";\nconst client = new GoogleGenerativeAI({ apiKey: process.env.GEMINI_API_KEY });\nconst model = client.getGenerativeModel({ model: "gemini-2.5-pro" });\nconst result = await model.generateContent("Write a 3-line haiku about sunrise over London.");\nconsole.log(result.response.text());Python
import os\nfrom google import genai\nclient = genai.Client(api_key=os.environ["GEMINI_API_KEY"])\nresp = client.models.generate_content(\n model="gemini-2.5-pro",\n contents="Write a 3-line haiku about sunrise over London."\n)\nprint(resp.text)Documentation
Notes
Use the new Google Gen AI SDKs (python: google-genai; JS: @google/genai). Model id is exactly "gemini-2.5-pro". Thinking is supported on Pro; older @google/generative-ai and google-generativeai are deprecated.