I ran a gateway fronting a dozen providers. One model kept hard-failing while everything else worked: gemini/gemini-flash-lite-latest returned
{"code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT"}
on every call.
The misleading part: where the traceback points
The logs looked like a proxy bug. The traceback landed in the gateway request processor. My first instinct was a broken router. It was not. Spend logs showed the upstream provider returning the 400. The proxy failed over it. No fallback group was configured for that model, so every request died.
A 400 wrapped in a gateway traceback is almost always a parameter the upstream provider rejects. Trace the error to the provider response before touching the proxy.
Finding the rejected parameter the boring way
I stripped parameters one by one until the call succeeded:
| Request | Result | |---|---| | no extra parameters | HTTP 200 | | reasoning_effort="minimal" | HTTP 200 | | reasoning_effort="none" | HTTP 400 | | temperature=0.3, max_tokens=0 | HTTP 400 |
The client sent reasoning_effort: "none" because the config flagged it as a cheap task. The upstream API rejects that value for this model. It also rejects the temperature combo. "minimal" passes. The docs list valid values per model.
The fix, in order of permanence
- Send parameters the target model accepts:
"minimal"instead of"none". - Route the task to a model that tolerates the payload. I moved the job to an open-weights model through the same gateway and the 400s stopped.
- Configure a fallback group for auxiliary models. The hard failure was the missing fallback. One bad parameter took the whole pipeline down instead of spilling to a working model [3].
Why this keeps happening
Providers gatekeep different parameter combinations. Clients now send reasoning-control knobs by default. If a model starts 400ing after a client config change, check the request parameters before blaming the gateway. A parameter matrix test takes ten minutes and settles the argument.
Tools mentioned: LLM gateway gateway routing, automation pipelines.