Endpoints, CDNs and Error Trackers: What Leaves Your Machine Besides the Prompt
When you call an AI API through an SDK, your prompt is not the only data that leaves your machine. SDKs, CDNs, and error trackers can emit headers, metadata, and telemetry that reveal more than you might expect. This article explains what those outbound signals are, why they exist, and how to audit them using a proxy or local logging. By understanding the full outbound flow, you can make informed choices about privacy and tooling. The focus is on conceptual accuracy, not specific numbers or model lists.
What Leaves Your Machine Besides the Prompt
When you send a prompt to an AI API using an SDK, the request body is just one part of the outbound data. Your client also sends headers, metadata, and potentially telemetry to various endpoints. This article explains what those signals are, why they exist, and how to audit them.
The Layers of an Outbound API Call
A typical API call from an SDK-instrumented client involves multiple layers:
- Your application code that constructs the prompt and calls the SDK.
- The SDK that formats the HTTP request, adds headers, and may include telemetry.
- The network stack that resolves DNS, establishes TLS, and sends the request.
- CDNs and proxies that route the request to the API provider.
- Error trackers that may capture exceptions and send them elsewhere.
Each layer can add data that leaves your machine alongside the prompt.
SDK Instrumentation: Headers and Metadata
SDKs often add headers for authentication, versioning, and diagnostics. Common examples include:
Authorizationheader with your API key.User-Agentstrings that identify the SDK and its version.X-Client-Infoor similar headers with runtime details.Content-TypeandAcceptheaders.
Some SDKs also include metadata in the request body, such as a user field or metadata object. These are intended to help with abuse detection, billing, or debugging, but they can carry identifying information if not carefully managed.
CDNs and Proxies: What They See and Forward
CDNs and reverse proxies sit between your client and the API provider. They terminate TLS, inspect headers, and may add their own:
X-Forwarded-Forto indicate the original client IP.X-Request-IDfor tracing.Viaheaders that list intermediate proxies.
These headers help with routing and debugging but can expose your IP address or internal network topology. If you use a third-party CDN or proxy, that provider can see your request metadata even if the API provider does not.
Error Trackers: Silent Telemetry
Error tracking services (like Sentry, Rollbar, or custom solutions) are often integrated into applications. When an exception occurs, they capture:
- The stack trace.
- Environment variables (sometimes).
- Request data, which may include the prompt or API response.
- User identifiers and session data.
This telemetry is sent to the error tracker's servers, not the API provider. If not configured carefully, it can leak sensitive prompt content or API keys.
How to Audit Your Outbound Flow
To see what leaves your machine, you can set up a local proxy that logs all requests. Tools like mitmproxy or Charles Proxy can intercept HTTPS traffic if you configure your client to trust their certificate. Alternatively, you can use SDK logging features or environment variables to dump request details.
A simple audit approach:
- Run your application with a local proxy.
- Trigger a few API calls.
- Inspect the captured requests: headers, body, and destination hosts.
- Look for unexpected fields or third-party domains.
This helps you understand the full outbound flow and make informed decisions.
Why This Matters for API Aggregators
When you use an API aggregator, your request goes through an additional layer. The aggregator's endpoint receives your prompt and metadata, then forwards it to the chosen model provider. The aggregator may also add its own headers for routing and billing.
Choosing an aggregator that minimizes unnecessary telemetry and is transparent about data handling can reduce your exposure. For example, a service that accepts USDC on Base and does not require KYC may offer different privacy characteristics than traditional providers. Always review the aggregator's documentation and privacy policy.
Best Practices for Minimizing Outbound Data
- Disable SDK telemetry if the SDK allows it (e.g., via environment variables).
- Review error tracker settings to exclude sensitive data.
- Use a proxy to inspect and potentially redact headers.
- Avoid sending unnecessary metadata in request bodies.
- Prefer aggregators that are explicit about what they log and forward.
By understanding what leaves your machine besides the prompt, you can better control your data footprint and make choices that align with your privacy needs.