Before you start
Connect the ngrok MCP server
https://mcp.ngrok.com/mcp to your AI agent and sign in.
See the quickstart for your client.
If you connect with a personal access token, give it the scopes for the tools you want to use.Send requests through the AI Gateway
Turn on request capture
aigw_ tools in the table below.
What you can ask
Your AI agent picks the tools, so the exact steps can differ.Which models support image input? Show the prices and limits for one of them
Which models support image input? Show the prices and limits for one of them
aigw_list_models to find models that accept images, then aigw_get_model for the one you pick.
You get each provider that offers the model, with its token prices, limits, and performance metrics.What did AI Gateway cost over the last seven days? Break it down by provider, with daily totals
What did AI Gateway cost over the last seven days? Break it down by provider, with daily totals
aigw_usage_overview grouped by provider.
You get daily cost in USD, request counts, errors, and error rates for each provider.
Ask for a breakdown by access key to see which app or teammate spent the most.Show failed AI Gateway requests from the last hour
Show failed AI Gateway requests from the last hour
aigw_list_usage and filters for failures.
You get each request’s ID, outcome, status code, tokens, and cost, newest first.For that request, show what the client asked for and every provider attempt. Why did it fail over?
For that request, show what the client asked for and every provider attempt. Why did it fail over?
aigw_get_request for the model, status, attempt count, and access key, then aigw_get_request_attempts for each attempt.
You get each attempt’s provider, model, outcome, retry action, timing, tokens, and cost, and an explanation of why the gateway moved on to the next attempt.
See Why a request failed over for how the gateway decides.Read the captured client request body for that request. Continue until the end
Read the captured client request body for that request. Continue until the end
aigw_get_capture one page at a time until it has read the whole body.
This works only for requests made while request capture was on.Tools and scopes
When you sign in with OAuth, the AI agent can use every tool your role allows. When you connect with a personal access token, each tool needs the scopes listed here.Limits
- Capture required for request details:
aigw_get_request,aigw_get_request_attempts, andaigw_get_captureneed request capture to be on when the request was made. - Retention: captured headers and bodies are kept for 30 days, and request metadata for 90 days. See Observability limits.
- Redaction: credential headers, such as
Authorizationandx-api-key, are redacted in captures. Prompts and completions are stored as sent, so anyone who can read captures can read them.
Related resources
- ngrok MCP server: Connect your AI agent and see everything else it can do.
- AI Gateway observability: The usage data and request details behind these tools.
- Request capture: Turn capture on and see what it stores.
- Why a request failed over: How the gateway moves between attempts.