Applies to:
Summary
Goal: Configure proxy authentication for the Braintrust Java SDK using a custom OkHttp client. Features: Custom HTTP client configuration, OkHttp proxy authenticator, braintrust-java-core package.Configuration Steps
Step 1: Replace dependency
Replacebraintrust-java with braintrust-java-core in your project dependencies.
Step 2: Customize OkHttpClient
Copy theOkHttpClient class from braintrust-java-client-okhttp and add proxyAuthenticator support to the builder.
Step 3: Configure client with proxy authentication
ConstructBraintrustClientImpl with your customized HTTP client, setting both proxy and authenticator.
Notes
Java’sAuthenticator.setDefault() does not work with OkHttp, which requires explicit proxyAuthenticator configuration on the builder.