Prompting Gemini
Combine text, files and media with a clearly scoped request in Gemini or the Gemini API.
Model selection
| Model or service | Use case | Model ID or access |
|---|---|---|
| Gemini 4 Carbon | Complex engineering and multimodal analysis | gemini-4-carbon |
| Gemini 4 Neon | Fast completion of demanding tasks | gemini-4-neon |
| Gemini 4 Hydrogen | Everyday coding and agent work | gemini-4-hydrogen |
| Gemini 4 Argon | Efficient reasoning | gemini-4-argon |
| Gemini 3.5 Flash-Lite | High-throughput lightweight work | gemini-3.5-flash-lite |
Which model to choose
Begin with a model that supports the required input types. Evaluate Hydrogen for everyday work and Carbon or Neon for harder cases. Include Flash-Lite when throughput dominates.
Using the chat or local app
Upload the relevant file or image and say which pages, region or time span matter. Ask the answer to refer back to those locations.
Using the API
Put task text and media in contents and use the supported generationConfig fields for output schemas and reasoning controls. Gemini 4 and Gemini 3.6+ ignore custom temperature, top_p and top_k and warn that future requests may fail: remove these settings rather than tuning them.
POST /v1beta/models/gemini-4-hydrogen:generateContent
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Summarize the decisions in {{meeting notes}}. Keep unknown owners as null."
}
]
}
]
}Prompting advice
- Use a sample output to clarify required fields and missing values.
- Identify the relevant material before asking for a long-document synthesis.
- State the task and desired output directly. Configure required output formats through the API instead of relying only on formatting words in the prompt.
Agent usage
Gemini CLI
0.71.1 is the CLI stable-release snapshot. The CLI model selector and your account determine availability; an API catalog entry does not establish that the same model is enabled in your CLI.
- Inspect /model before choosing a model. Use the documented Auto option or an explicitly available model rather than guessing a new model ID.
- Put shared project context in GEMINI.md and give each task the relevant paths, intended behavior and a verification command.
gemini --version
# In a session: /modelExample prompt template
Investigate {{failure}} in {{project}} using {{relevant files}}. Explain the evidence for the cause, implement the correction within {{scope}}, and run {{verification command}}. Preserve existing unrelated behavior. Report any check you could not run.Example prompt template
Inspect the attached product image. List visible controls by location, quote readable labels, and mark any label you cannot read. Use only details visible in the image.