Prompting Gemini
Gemini 3.8 Flash is Google's current stable all-round model for code, agents and multimodal input. Flash‑Lite is the volume option, while Pro remains a preview model.
Choose by release status, not just model name
| Model | API input / output | Choose it when |
|---|---|---|
| Gemini 3.8 FlashStable, GA | $0.75 / $3.75through 31 December 2026 | you need a strong multimodal production model for code, agents and long inputs |
| Gemini 3.1 Pro PreviewPreview | $1 / $5through 31 December 2026 | you are experimenting with advanced multimodal understanding and can accept shorter deprecation notice |
| Gemini 3.5 Flash‑LiteStable | $0.30 / $2.50 | you run translation, simple data processing or many small agent tasks |
Gemini 3.8 Flash has a 1.05M token context window, up to 64,000 output tokens and low, medium and high thinking levels. Its introductory price rises to $1.50 / $7.50 on 1 January 2027. New projects should normally begin with 3.8 and keep an older generation only where their own regression tests require it.
Specify input, constraints and response shape
Separate the task from the material it concerns. State the kind of answer you need, and use the API's structured output capability when another system must read the result.
Use consistent examples
Few-shot examples can steer format, wording and pattern. Keep formatting consistent and vary the content enough that the model learns the rule rather than accidental details.
Put long material first and the question last
Google recommends placing large documents, code, video or datasets before the specific question and referring explicitly to the relevant modality. Critical rules may live in the system instruction or early in the prompt.
Use thinking level, not chain-of-thought formulas
Choose a lower thinking level for simple extraction or classification and increase it for complex agent runs when evaluations show a gain. Thinking tokens may be billed as output. Split the process into multiple API stages when an intermediate result must be inspected, logged or approved.
Separate format from action
Structured Outputs control final format. Function Calling describes an action or intermediate operation. Valid JSON does not guarantee true values, and tool arguments must be validated before execution.
Sources
- Google: Latest Gemini models — model status and migration notes
- Google: Models — stable, preview, retiring and model IDs
- Google: Pricing — current and announced prices
- Google: Prompt design strategies — official living guidance
- Google: Long context — structure for large inputs
- Google: Thinking — levels, tokens and model support
- Google: Structured Outputs — schemas and validation