MuleSoft / API Manager
LLM Gateway Gemini policy requires /models in the incoming request path, which breaks upstreams that already include /models
- Reported
- Nov 25, 2026
- Updated
- Nov 25, 2026
- Fixed
- —
- Reports
- 0
- Found in
- —
- Reference
- W-24992245
Summary
Newly created Model Proxies that use the Gemini endpoint format now parse incoming requests so the gateway can generate metrics, monitoring and cost management data. The gateway expects the incoming URL to follow the form /<base-path>/models/{model}:{action}. If /models is added in the upstream URL instead of the incoming request, the request is rejected with HTTP 400. Older Gemini proxies passed requests through without this validation, so they are not affected.
Workaround
Add two DataWeave Headers Transformation policies around the LLM policies on the affected proxy:
- Before the LLM policies, add a policy that adds
/modelsto the incoming path. - After the LLM policies, add a policy that removes
/modelsfrom the path, to avoid a duplicated/models/modelsin the upstream request.
Alternatively, send /models/{model}:{action} in the incoming request and remove /models from the upstream URL.
Steps to reproduce
- Create a Model Proxy with the Gemini endpoint format and a route to a Gemini model.
- Configure the upstream URL to include
/models, so that incoming requests do not include/models. - Deploy the proxy and create a client contract to obtain credentials.
- Send a native Gemini request, for example
POST https://<gateway>/<proxy>/<model>:generateContent, with acontents/role/partsbody. - The request fails with HTTP 400.
Error details
HTTP 400: {"error": "Failed to parse model from request: Missing 'model' field in request"}
Status timeline
Nov 30, 2026
created · Solution in Progress · 0 reports
Nov 30, 2026
content changed · Solution in Progress · 0 reports