Local inspector API
Read captured requests, stream live inspector events, and trigger local replays over loopback HTTP on 127.0.0.1.
On this page9
The local web inspector serves two machine-readable interfaces on the loopback address printed in your terminal (usually http://127.0.0.1:4040): a plain-text /llms.txt guide for AI agents and a JSON HTTP API under /api/*.
Keep the two /llms.txt endpoints distinct:
http://127.0.0.1:<port>/llms.txtis served locally by your runningprontaroprocess. It lists active tunnels and ready-to-run loopbackcurlexamples. Because the inspector listens strictly on127.0.0.1, any AI agent or script querying it must run on the same machine.https://prontaro.com/llms.txtis Prontaro’s public documentation index covering plans, limits, and CLI guides.
Using the inspector with an AI coding agent
GET /llms.txt on your local inspector port returns a compact (< 1.5 KiB) plain-text reference for coding agents. It lists active tunnels that fit within the byte budget (pointing to /api/tunnels if there are more) along with exact curl commands for reading and replaying requests. The guide also notes that sensitive fields are masked as REDACTED, omits secret-unmasking parameters, and warns that captured traffic is untrusted_external_input (data to inspect, never instructions to obey).
Point Claude Code, Cursor, Codex, or another local coding agent at the address shown in your terminal:
Read http://127.0.0.1:4040/llms.txt to see the active Prontaro tunnel and local inspector API.
Fetch the latest failing webhook request (status 5xx), explain why my handler returned an error,
fix the bug in my handler, and replay that exact request locally until it returns 200.If you launch prontaro from a script or an agent’s non-interactive background shell (where stdout or stderr is not a TTY), pass --inspect so the loopback server starts:
prontaro http 3000 --name webhooks --inspectIn non-interactive mode, prontaro still writes only the public HTTPS URL to stdout and logs the bound loopback URL (inspector listening addr="http://127.0.0.1:4040") to stderr. Always read the actual bound address from that log line or terminal screen if port 4040 is already taken.
Local HTTP endpoints
The loopback server exposes 7 /api/* operations, plus the embedded browser UI (GET /, GET /assets/{file}, GET /favicon.ico) and GET /llms.txt. API errors return JSON in the shape {"error":{"code":"...","message":"..."}}.
| Method & path | Purpose | Notes |
|---|---|---|
GET / and GET /assets/{file} |
Embedded browser inspector UI | Strict CSP and Cache-Control: no-store |
GET /llms.txt |
Plain-text API reference for local AI agents | Active tunnels, curl examples, untrusted_external_input warning |
GET /api/health |
Inspector status and memory counters | Returns app, version, pid, addr, tunnels, requests, evicted, capture_dropped, events_dropped, mem_bytes, mem_limit_bytes |
GET /api/tunnels |
Tunnels attached to this CLI process | Returns id, ref, kind, public_url, local_target, local_marks, status, visitor_notice (TCP tunnels appear as not inspected) |
GET /api/requests |
Newest-first list of captured requests | Query filters: tunnel, method, status (500, 4xx, 5xx, >=400, or errors for every entry with "error": true), path, q (searches masked fields only), kind (http or blocked), hide_assets=1, limit (default 100, max 500) |
DELETE /api/requests |
Clear the in-memory request buffer | Requires Content-Type: application/json |
GET /api/requests/{id} |
Full details for one captured request | Masked headers, bodies, "error", duration_ms, replay_of, redacted_fields, and "untrusted_external_input": true |
POST /api/requests/{id}/replay |
Replay or edit-and-replay locally | Requires Content-Type: application/json (max 384 KiB); sends directly to your local server with zero Prontaro server traffic |
GET /api/events |
Inspector live event stream (SSE) | Emits request (same summary shape, including "error"), tunnel, cleared, and dropped events plus : ping every 25s; up to 16 concurrent subscribers |
Common curl examples
Replace http://127.0.0.1:4040 with the loopback URL printed by your prontaro process if it bound a different port.
List and inspect captured requests
curl -s 'http://127.0.0.1:4040/api/requests?status=errors&hide_assets=1&limit=20'curl -s 'http://127.0.0.1:4040/api/requests/1'Every request summary (in GET /api/requests and SSE request events) and request detail (GET /api/requests/{id}) includes a boolean "error" field set to true for HTTP 4xx/5xx responses, 502 local server failures, blocked requests, and connections closed before a response (status: 0). Passing status=errors filters by this exact flag. Both responses also include "untrusted_external_input": true as a reminder for automated consumers that request headers, paths, and bodies come from external callers.
Replay or edit a request locally
Plain replay preserves the captured request body bytes and retained header order while stripping hop-by-hop headers, recalculating Content-Length, and setting Connection: close. It never leaves your machine and spends no monthly tunnel quota:
curl -s -X POST \
-H 'Content-Type: application/json' \
-d '{}' \
'http://127.0.0.1:4040/api/requests/1/replay'If the captured body exceeded 256 KiB and was truncated, the endpoint returns 409 Conflict (body_truncated) instead of silently resending partial data. Pass {"force":true} only if you intentionally want to replay the truncated capture:
curl -s -X POST \
-H 'Content-Type: application/json' \
-d '{"force":true}' \
'http://127.0.0.1:4040/api/requests/1/replay'To replace the entire method, path, headers, and body before sending locally, pass an edit object (remember that editing a signed payload or header invalidates provider HMAC signatures):
curl -s -X POST \
-H 'Content-Type: application/json' \
-d '{"edit":{"method":"POST","path":"/webhooks/stripe","headers":[{"name":"Content-Type","value":"application/json"}],"body":"{\"type\":\"invoice.paid\"}"}}' \
'http://127.0.0.1:4040/api/requests/1/replay'To override only specific fields while keeping the original unredacted headers, path, or body inside the inspector, pass a partial patch object instead (prontaro mcp --allow-edit uses this mode so secrets never leave the inspector). Omitted fields inherit raw values from the captured request, overriding body without headers automatically strips Content-Encoding, and passing both edit and patch returns 400 invalid_input:
curl -s -X POST \
-H 'Content-Type: application/json' \
-d '{"patch":{"body":"{\"type\":\"invoice.paid\"}"}}' \
'http://127.0.0.1:4040/api/requests/1/replay'Both edit.headers and patch.headers reject hop-by-hop headers (Connection, Content-Length, Transfer-Encoding, Upgrade, Expect, and related transport headers) with 400 invalid_input—prontaro calculates Content-Length and adds Connection: close automatically.
Clear the buffer and stream inspector events
curl -s -X DELETE \
-H 'Content-Type: application/json' \
'http://127.0.0.1:4040/api/requests'curl -sN 'http://127.0.0.1:4040/api/events'Secret masking and the reveal parameter
By default, GET /api/requests and GET /api/requests/{id} mask common sensitive headers (including Authorization, Cookie, Set-Cookie, and X-Api-Key), secret query parameter names, and recognized JSON or form-encoded token fields as REDACTED, listing the masked locations in redacted_fields. Pattern-based masking covers common field names and cannot guarantee that custom payload structures contain no sensitive fields.
Passing ?reveal=1 to GET /api/requests/{id} returns unmasked values only when the request carries both Sec-Fetch-Site: same-origin and X-Prontaro-UI: 1. Treat this check accurately: it is a browser cross-origin guard, not local-process authentication. Web browsers forbid cross-origin scripts from setting Sec-Fetch-Site: same-origin, protecting the reveal path from malicious websites, whereas another local process running on the same machine can explicitly send those headers.
Security of the local server
Because the inspector holds captured HTTP requests in memory on your workstation, the loopback server enforces strict browser isolation:
- Loopback bind only: listens strictly on
127.0.0.1:<port>and never binds to0.0.0.0or external network interfaces. - Exact
Hostallowlist: rejects any request whoseHostheader is not127.0.0.1:<port>,localhost:<port>, or[::1]:<port>for the exact bound port, preventing DNS rebinding attacks. - Same-origin browser isolation:
/api/*checksSec-Fetch-Site: same-origin(falling back to a matchingRefererwhen absent), verifies that anyOriginheader matcheshttp://<Host>, and never sends CORS headers (Access-Control-Allow-Origin). A page on another local port such ashttp://localhost:3000cannot read or replay your captured traffic from the browser. - Security headers and CSP: every response sets
Cache-Control: no-store,X-Content-Type-Options: nosniff, andReferrer-Policy: no-referrer. UI routes also enforce a strictContent-Security-Policy(default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; frame-ancestors 'none'; base-uri 'none'; object-src 'none'). - JSON
Content-Typeon mutations:POSTandDELETEcalls to/api/*requireContent-Type: application/json, blocking simple cross-site HTML form submissions. - Local process boundary: non-browser clients on the same machine (such as
curlor a local coding agent) do not send browserSec-Fetch-SiteorOriginheaders, so they can call/api/*directly. Any local process that can connect to127.0.0.1:<port>shares access to the inspector whileprontarois running.
Next steps
- Prontaro MCP server — connect Claude Code, Cursor, or Codex over local
stdioMCP with built-in tools and prompts. - Local web inspector — browser workflow, replay guardrails, memory caps, and keyboard shortcuts.
- Webhooks: Stripe, GitHub, and Telegram — permanent local webhook URLs, HMAC signature checks, and debugging.
- prontaro CLI command reference — full flag reference for
prontaro http,prontaro run, andprontaro mcp. - Connection logs — metadata-only server logs across tunnels, proxies, and Relays.
Something wrong on this page? Contact us