Prompt API lets you create custom prompts and set optional generation parameters with just a few lines of code:
Generation.getClient().generateContent(
   generateContentRequest(
       ImagePart(bitmapImage),
       TextPart("Categorize this image as one of the following: car, motorcycle, bike, scooter, other. Return only the category as the response."),
   ) {
       // Optional parameters
       temperature = 0.2f
       topK = 10
       candidateCount = 1
       maxOutputTokens = 10
   },
)
For more detailed examples of implementing Prompt API, check out the official documentation and sample on Github.
Gemini Nano, performance, and prototyping
Prompt API currently performs best on the Pixel 10 device series, which runs the latest version of Gemini Nano (nano-v3). This version of Gemini Nano is built on the same architecture as Gemma 3n, the model we first shared with the open model community at I/O.
The shared foundation between Gemma 3n and nano-v3 enables developers to more easily prototype features. For those without a Pixel 10 device, you can start experimenting with prompts today by prototyping with Gemma 3n locally or accessing it online through Google AI Studio.
For the full list of devices that support GenAI APIs, refer to our device support documentation.
Learn more
Start implementing Prompt API in your Android apps today with guidance from our official documentation and the sample on Github.
 
			












