A MuleSoft Experience API that integrates with Google Gemini AI for Native Checkout Functionality. This eapi is direct plug-and-play app to enable UCP for any of the eCommerce application, enabling agentic AI capabilities within the Anypoint Platform ecosystem.
This API acts as an intelligent orchestration layer between enterprise systems and Google's Gemini AI, enabling:
- Agentic workflows — AI-driven decision making within Mule flows
- Natural language processing — Process unstructured data with Gemini
- Enterprise integration — Connect Gemini AI to any backend system via MuleSoft
Client Request
↓
MuleSoft Gemini Agentic EAPI
↓
Google Gemini AI API
↓
Response with AI-generated insights
- Anypoint Studio 7.15+
- Mule Runtime 4.4.0+
- Java 17
- Google Cloud account with Gemini API access
- Google Gemini API Key
- Clone the repository:
git clone https://github.com/viplgoswami1/mulesoft-gemini-agentic-eapi.git
cd mulesoft-gemini-agentic-eapi-
Import into Anypoint Studio:
- File → Import → Anypoint Studio Project from File System
- Select the cloned folder
- Click Finish
-
Configure your credentials in
src/main/resources/config.yaml:
gemini:
api:
key: "YOUR_GEMINI_API_KEY"
url: "https://generativelanguage.googleapis.com/v1beta"
model: "gemini-pro"- Go to https://ai.google.dev
- Click Get API key in Google AI Studio
- Create a new API key
- Copy the key into your config
| Variable | Description | Required |
|---|---|---|
GEMINI_API_KEY |
Google Gemini API key | ✅ |
GEMINI_MODEL |
Model name (default: gemini-pro) |
❌ |
GEMINI_MAX_TOKENS |
Max response tokens (default: 1024) | ❌ |
Generate AI content using Gemini.
Request:
{
"prompt": "Summarize the following product description for a Google Shopping listing",
"context": "Your product description here...",
"maxTokens": 500
}Response:
{
"generatedText": "AI-generated content here...",
"model": "gemini-pro",
"tokenCount": 245,
"status": "SUCCESS"
}Execute an agentic workflow with multi-step reasoning.
Request:
{
"task": "Analyze product catalog and suggest optimizations",
"data": { ... },
"steps": ["analyze", "recommend", "format"]
}<flow name="geminiAgenticFlow">
<http:listener path="/gemini/generate" method="POST"/>
<transform:message>
<transform:set-payload><![CDATA[%dw 2.0
output application/json
---
{
contents: [{
parts: [{
text: payload.prompt ++ "\n\n" ++ payload.context
}]
}]
}]]></transform:set-payload>
</transform:message>
<http:request
url="https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent"
method="POST">
<http:headers>
<http:header key="x-goog-api-key" value="${gemini.api.key}"/>
</http:headers>
</http:request>
<logger message="#[payload]"/>
</flow>- 🔌 Google Merchant Center MuleSoft Connector — Custom connector for Google Shopping API
- 📦 Maven Central — Published connector
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'feat: add my feature' - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
Apache License 2.0 — see LICENSE for details.
Viplove Goswami
- GitHub: @viplgoswami1
- LinkedIn: Viplove Goswami
- Maven Central: io.github.viplgoswami1
Built with ❤️ for the MuleSoft and AI community
