Skip to main content
The Go SDK does not patch provider clients directly. Instead, it gives you a proxy-aware *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

1

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

2. Create and initialize the WhyOps client

Build the Go Client and call InitAgent(ctx) during startup.
3

3. Get a proxy-aware http client

Call sdk.ProxyHTTPClient() and supply that client anywhere your provider SDK accepts a custom *http.Client.
4

4. Point the provider SDK at the WhyOps proxy host

The transport only injects headers. You still have to set the provider base URL to WhyOps.
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 AgentName values 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.