Direct Google model ID: gemini-3-flash-preview. Google lists it as a Preview model and provides a Google AI Studio route. This is the identifier for the direct Gemini API example below; third-party routers may use different model fields. (Gemini 3 Flash preview)
Lifecycle note: Google’s deprecations schedule currently lists no shutdown date announced for gemini-3-flash-preview and names gemini-3.6-flash as its recommended replacement. That is migration guidance, not an announcement that Gemini 3 Flash Preview has shut down. If you specifically need Gemini 3 Flash Preview, the quickstart below uses its listed model ID; if you are choosing a model for a new deployment, account for Google’s stated replacement. (Gemini API deprecations)
Make a first direct request with Python
This quickstart uses the Gemini API in Google AI Studio, not Vertex AI or an intermediary. Create an API key in Google AI Studio, then install Google’s Python SDK. Use Python 3.11 or newer; the SDK repository notes that Python 3.10 support has been dropped. (Google Gen AI Python SDK)
- Install the SDK and set your key in the environment. The commands below are for macOS/Linux:
python -m pip install -U google-genai
export GEMINI_API_KEY="YOUR_API_KEY"
- Save this as
gemini_flash.py:
import os
from google import genai
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
response = client.models.generate_content(
model="gemini-3-flash-preview",
contents="Explain what an API is in one sentence.",
)
print(response.text)
- Run it:
python gemini_flash.py
The script passes the environment variable’s value explicitly to the client; it does not rely on the SDK automatically loading GEMINI_API_KEY. The generate_content call and response.text pattern follow Google’s Python text-generation example. Google’s exact-model reference lists gemini-3-flash-preview; its Gemini Enterprise Agent Platform reference separately lists GenerateContent API support for that model. (Gemini 3 Flash preview)
What the model reference says it supports
Google lists text, image, video, audio, and PDF inputs, with text output. The model reference also lists function calling, structured outputs, and caching as supported; it lists Live API and audio generation as unsupported. These are model-reference entries, not a promise of quota, latency, or availability for a particular account or workload. (Gemini 3 Flash preview)
The model is labeled Preview. Treat that status as part of the integration decision, and check the applicable terms and current account or channel requirements before deployment. The deprecations schedule currently lists no shutdown date announced for this model and names gemini-3.6-flash as its recommended replacement; it does not say that Gemini 3 Flash Preview has been shut down. (Gemini API deprecations)
Pricing: check the current rate before budgeting
Check Google’s current pricing for gemini-3-flash-preview before estimating spend. The launch announcement’s prices are dated, and third-party router prices or charges may differ from direct Google API billing. (Gemini 3 Flash preview)
Which route should you choose?
- Trying Gemini 3 Flash Preview specifically through Google: use the Gemini API in Google AI Studio and model ID
gemini-3-flash-preview. The deprecations schedule lists no shutdown date announced. (Gemini 3 Flash preview; Gemini API deprecations) - Choosing a model for a new deployment: Google lists
gemini-3.6-flashas the recommended replacement forgemini-3-flash-preview. This is the schedule’s replacement guidance; it does not establish that the replacement is superior for your workload. (Gemini API deprecations) - Using Vertex AI: treat it as a separate setup. This Python example is for the Gemini API in AI Studio; it is not a Vertex AI credentials or deployment guide. Google lists the model on its Gemini Enterprise Agent Platform reference as Preview. (Gemini 3 Flash — Gemini Enterprise Agent Platform)
The essential distinction: to call Gemini 3 Flash Preview through the direct Google AI Studio example here, use gemini-3-flash-preview; if selecting for a new deployment, note Google’s listed replacement guidance.
Sources
Gemini 3 Flash preview — Gemini API
