See which model answered from the AI Gateway response headers
Shipped by mohamed
When the gateway fails over, the provider’s response body can name a different model than the one you asked for. Three response headers now tell you what happened:
Ngrok-AIG-Request-Idis the request’s ID, on every response, including rejections and errors.Ngrok-AIG-Attemptscounts the upstream attempts the gateway made.Ngrok-AIG-Modelnames the upstream model that produced the response.
Browser clients can read all three through CORS. They’re ngrok’s headers, so you get the same values with ngrok credits or your own provider keys. The native Gemini generateContent and streamGenerateContent endpoints return them too.
Get started
- Send any request through
https://gateway.ngrok.ai. - Read the headers on the response. In the OpenAI SDK,
.withResponse()returns them next to the data. - Treat
Ngrok-AIG-Modelas the answer to “who replied?” See response headers.