The Go SDK does not patch provider clients directly. Instead, it gives you a proxy-awareDocumentation Index
Fetch the complete documentation index at: https://whyops.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
*http.Client transport. This is the page to read when you want OpenAI or Anthropic traffic to go through WhyOps from Go.
Quickstart
Start there first if you have not created and initialized the WhyOps client yet.
Runtime Events
Add runtime tracing after the proxy flow is already working.
Direct Proxy APIs
Use the direct proxy pages only if you are bypassing the Go package.
Which API key goes where
| Credential | Where it lives | What it is used for |
|---|---|---|
WHYOPS_API_KEY | Your app environment | Authenticates agent init, manual events, and the proxy transport talking to WhyOps |
| Provider credential in the WhyOps dashboard | WhyOps provider settings | Lets WhyOps authenticate upstream when it forwards the proxied request |
| A stable trace or session ID | Your request context | Best for explicit continuity between proxied model calls and later tool or runtime events |
The recommended order
1. Store the provider credential in WhyOps
Add your OpenAI or Anthropic provider key in the WhyOps dashboard so WhyOps can forward proxied requests upstream.
2. Create and initialize the WhyOps client
Build the Go
Client and call InitAgent(ctx) during startup.3. Get a proxy-aware http client
Call
sdk.ProxyHTTPClient() and supply that client anywhere your provider SDK accepts a custom *http.Client.ProxyHTTPClient() injects WhyOps headers, but it does not rewrite the destination host. Your provider SDK or raw HTTP request must still target the WhyOps proxy URL.Raw HTTP example
Provider SDK pattern
Common mistakes
- Passing
ProxyHTTPClient()to the provider SDK but forgetting to change the provider base URL to WhyOps. - Sending provider requests to the real upstream host and expecting the transport alone to proxy them.
- Using different
AgentNamevalues between proxied traffic and runtime events. - Relying only on auto-generated trace IDs when later tool or runtime events need to join the same thread.