The ML Kit GenAI Prompt API, now available in alpha, enables Android developers to send natural language and multimodal requests to Gemini Nano running on-device, extending the text summarization and image description capabilities introduced with the initial GenAI release.
The new API accepts either text input or a combination of image and text input and produces a text response. According to Google, it enables the use of natural language prompts across a variety of mobile use cases, including short translation, image and text classification, content generation, and more:
Prompt API moves beyond pre-built functionality to support custom, app-specific GenAI use cases, allowing you to create unique features with complex data transformation. Prompt API uses Gemini Nano on-device to process data locally, enabling offline capability and improved user privacy.
The new Prompt API can be seen as a lower-level API compared to the existing GenAI APIs, which target specific features like summarization, proofreading, rewriting, and image description. It requires more integration effort in exchange for greater flexibility.
Each feature-specific API includes a built-in prompt optimized for its particular use case, relieving the developer from the burden of prompt engineering but also imposing certain limitations. For instance, the summarization API restricts outputs to 1–3 bullet points; the image description API generates brief, generic captions; and the rewriting API supports only a fixed set of styles such as elaborate, shorten, friendly, and others.
In contrast, the Prompt API offers more flexibility by allowing developers to supply custom prompts. For example, the following code snippet demonstrates how to provide a fully customized prompt that instructs the on-device model on how to process an image sent with the request:
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
},
)
Google says the new Prompt API has been already integrated by partners such as KaKao Mobility, which uses it to enable their app to inform users when a bike is parked improperly by just taking a photo and sending it to the model with a custom prompt. Kakao Mobility also uses the Prompt API to enhance the address entry experience within their app.
The Prompt API performs best on the Pixel 10 device series, which runs Nano-v3. However, it can be used on other devices too, including Google Pixel 9 series, Samsung Galaxy Z Fold7, Xiaomi 15, and others, though only with the less capable Nano-v2 model.
JobNimbus chief AI officer Tyler Folkman commenting on the announcement via LinkedIn noted that the results reported by Kakao “suggest this is more than another AI demo feature”. Furthermore, he believes that while not yet production-ready, the Prompt API holds promise for “controlled environments where privacy is non-negotiable and you control the hardware”. Folkman further pointed out some current limitations of the Prompt API’s Android integration, including enforced battery quotas and the lack of background execution support.
