Use Google Gemini with the data service Custom Prompt With Dynamic Values
Point the Custom Prompt With Dynamic Values data service at Google's Gemini models by changing the connection settings, and learn which limitations apply.
The Custom Prompt With Dynamic Values data service connects to an OpenAI-compatible AI tool. Google offers an OpenAI-compatible endpoint for its Gemini models, so you can use Gemini with the existing data service by changing only the connection settings — the Base URL, API key, and OpenAI model fields. You don't need a new data service.
This page builds on Generate or transform values with the data service Custom Prompt With Dynamic Values. Set up the data service as described there, and apply the Gemini-specific settings on this page.
You can use this setup to test and evaluate how Gemini works with your prompts. Before relying on it for a production feed, contact support@productsup.com so we can advise on the right setup for your use case.
While Productsup offers integration with Gemini for generating or transforming your values at no cost, the actual process is handled by Google, which may involve fees for their services. Before using our AI-based data services, ensure you are familiar with Google's Gemini API pricing that we use in our data services. See Pricing for more information.
Prerequisites
To use Gemini with the Custom Prompt With Dynamic Values data service, you need:
- A Google Gemini API key from Google AI Studio, with access to the model you want to use. See Get a Gemini API key.
- The Custom Prompt With Dynamic Values data service added to a column on your site. See Generate or transform values with the data service Custom Prompt With Dynamic Values.
Configure the data service to use Gemini
In the settings of your Custom Prompt With Dynamic Values data service, change the following fields.
In Base URL, enter https://generativelanguage.googleapis.com/v1beta/openai.
Leave API version empty.
Caution
Entering a value in API version switches the data service into Microsoft Copilot (Azure OpenAI) mode, which Gemini doesn't support. Keep this field empty when you use Gemini.
In API key, enter your Google Gemini API key.
In OpenAI model, enter a Gemini model identifier, for example gemini-flash-latest or gemini-pro-latest. This field accepts any text and isn't validated, so an invalid or retired identifier fails only when the data service runs. See Gemini models for the available identifiers.
In Max Response Tokens, set the maximum number of tokens in Gemini's response, or leave the field empty to use the platform default of 2048. Gemini's thinking models spend part of this budget on reasoning, so a value that's too low can return empty values.
Select Save, then select Run in the top-right corner of your site's view to process the data service.
The context, prompt, reasoning effort, temperature, request timeout, request concurrency, and caching settings work the same way as they do with OpenAI.
A successful run returns Gemini's generated values in your column, the same as a run with OpenAI. The platform creates the ___service_ai_custom_prompt attribute containing the generated values.
Limitations
The following limitations apply when you use Gemini through this data service:
| Limitation | Detail |
|---|---|
| Model identifier isn't validated | The OpenAI model field accepts any text. An invalid or retired Gemini identifier fails only when the data service runs. Prefer the -latest aliases so a retired dated model doesn't break your feed. |
Troubleshooting
| Symptom | Likely cause | Resolution |
|---|---|---|
| Not-found error | The Base URL is incorrect, or the model identifier is invalid or retired | Enter https://generativelanguage.googleapis.com/v1beta/openai exactly, and use a current model identifier |
| Authentication error | Wrong key, or the data service is in Azure OpenAI mode | Use a Google Gemini API key, and make sure API version is empty |
| Run fails or stops with a quota error | The key's request quota is exhausted or the key is rate-limited | Use a key with sufficient quota. To keep cached values instead of failing the run, enable Stop requests when plan issue detected |
| Empty values on some rows | Max Response Tokens is too low for a thinking model, or those rows hit a rate or quota limit | Increase Max Response Tokens, and use a key with sufficient quota |
See also
How is this guide?