Starting November 2, 2026, Firebase App Check enforcement will be required to use Firebase AI Logic. Learn more.
Model updates:
Gemini 4 Carbon and Gemini 4 Argon are now
available to use with Firebase AI Logic!
Learn more.
Gemini 2.5 models are deprecated or shut down. For the
Agent Platform Gemini API, all general-use Gemini 2.5 models
have shut down. For the Gemini Developer API, starting
December 1, 2026, requests to the general-use
Gemini 2.5 Flash and Pro models will be automatically routed to newer
models (which may cause breaking changes;
learn more).
To avoid service disruptions, update to a newer model (like
gemini-4-argon,
gemini-3.8-flash,
gemini-3.5-flash-lite, or
gemini-nano-banana-2.1).
Learn more.
Understand prompt design
Stay organized with collections
Save and categorize content based on your preferences.
Click your Gemini API provider to view provider-specific content
and code on this page.
When you make a request to a generative model, you send along a prompt with
your request. By carefully crafting these prompts, you can influence the model
to generate output specific to your needs.
Prompting for Gemini models
Prompts for Gemini models can contain questions,
instructions, contextual information, few-shot examples, and partial input for
the model to complete or continue.
Learn about prompt design in the Gemini Developer API documentation:
Configure model parameters
to control how the model generates a response, like max output tokens,
the probability of repeated output tokens, etc.
Use safety settings
to adjust the likelihood of getting responses that may be considered
harmful, including hate speech and sexually explicit content.
Set system instructions
to steer the behavior of the model. This feature is like a preamble that you
add before the model gets exposed to any further instructions from the end user.
Pass a response schema
along with the prompt to specify a specific output schema. This feature is
most commonly used when
generating JSON output,
but it can also be used for
classification tasks
(like when you want the model to use specific labels or tags).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-11-12 UTC."],[],[]]