Choose how to use Gemini
Use Gemini directly when you want to complete a task yourself, such as drafting, planning, or asking a question. Use the Gemini API when you’re building software that sends requests to a model and uses its responses. This guide shows one web-chat workflow and a local Python API smoke test. (Gemini Apps Help, Gemini API documentation)
Use Gemini directly: prompt, refine, review
-
Open Gemini. On a computer, go to
gemini.google.comin a supported browser. Some web features are available without signing in, depending on your location and device. For this signed-in web walkthrough, use a personal Google Account you manage yourself; you must be at least 13, or meet the applicable age in your country. A Google Account managed by Family Link can’t access the Gemini web app. Work accounts require an eligible Workspace setup and users to be 18 or older; school access must be enabled by the administrator. (Sign-in requirements) -
Enter a specific prompt. In the text box at the bottom of the chat, enter your request and select Submit. For example:
Make a five-day study plan for an introductory biology course. I can study 45 minutes each weekday. Use a table with the topic, activity, and time for each day. Include review time and do not assume I have a textbook.
-
Refine the answer. If it misses a constraint, tell Gemini what to change: “Revise the plan so every weekday is exactly 45 minutes, and add a short self-quiz on Friday.” Continue in the same chat or start a new one for a separate task.
-
Review before relying on it. Check the response against your request: does it cover five days, keep to the time limit, and avoid assuming you have a textbook? For important factual claims, compare them with authoritative sources. For a draft or plan, decide whether it fits your needs before acting on it. Google cautions that Gemini can make mistakes and advises users to double-check responses. (Gemini Apps Help)
Make a first Gemini API request with Python
This local smoke test sends one prompt and prints the generated text. It is a starting point, not a complete production application.
1. Check prerequisites and create an API key
Use Python 3.11 or later for the current Google Gen AI Python SDK. Install the SDK with pip. You’ll also need a Gemini API key from Google AI Studio. To use AI Studio, you must be at least 18 and in a supported region; accept its Terms of Service to get started. Google AI Studio creates a default Google Cloud project and API key for a new user after they accept the Terms. If you already have a Google Cloud project, import it into AI Studio before creating a key for that project. (SDK installation, AI Studio access requirements, API-key documentation, available regions)
Install the SDK and set the key as GEMINI_API_KEY, which the client library detects. (SDK installation, API-key environment setup)
python -m pip install -U google-genai
export GEMINI_API_KEY="YOUR_API_KEY"
In PowerShell, set the key for the current session:
$env:GEMINI_API_KEY="YOUR_API_KEY"
Keep the key private: don’t commit it to source control or expose it in browser-side code. Since May 28, 2026, new AI Studio keys are created as authorization keys by default. Google’s documentation says the Gemini API rejects unrestricted standard keys; standard keys with explicit restrictions continue to work. (API-key security guidance)
2. Send a request
Save this as gemini_first_request.py, then run python gemini_first_request.py:
from google import genai
client = genai.Client()
response = client.models.generate_content(
model="gemini-3.8-flash",
contents="Give me three practical ways to make a study plan easier to follow.",
)
print(response.text)
The expected outcome is generated text printed in your terminal; the wording will vary. This uses the documented Python SDK request pattern and reads the text from response.text. Check the current model documentation before selecting a model for an application. (Text-generation documentation)
3. Prepare before using the API in an application
A successful request means the API returned a response; it does not establish that the response is correct or suitable for your users.
- Protect credentials. Keep secret keys on your server, not in browser or mobile-app code. Use protected environment configuration or a secret manager, and follow Google’s current key security guidance.
- Handle limits and errors. Limits vary by model and project. Google documents request-per-minute, input-tokens-per-minute, and request-per-day dimensions. Check your project’s active limits and handle request errors rather than assuming a fixed quota. (Rate limits)
- Check billing and pricing. Review the current billing requirements and price for your selected model before estimating costs or launching an application. (Billing, pricing)
- Test the output for your use case. Try representative prompts, define what a passing response looks like, and verify important claims or actions before relying on them.
Which route should you use?
| Your goal | Start here | What to check |
|---|---|---|
| Complete a one-off task, draft, or question | Gemini on the web, or an available mobile app | Review the response and verify important facts before relying on it. |
| Add model-generated responses to software | Gemini API | Protect credentials, test representative requests, handle limits and errors, and check model-specific pricing. |
Sources
Use Gemini Apps - Computer - Gemini Apps Help
What you need to sign in to Gemini Apps
