Skip to main content
Applies to:
  • Plan -
  • Deployment -

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

Replace braintrust-java with braintrust-java-core in your project dependencies.

Step 2: Customize OkHttpClient

Copy the OkHttpClient class from braintrust-java-client-okhttp and add proxyAuthenticator support to the builder.

Step 3: Configure client with proxy authentication

Construct BraintrustClientImpl with your customized HTTP client, setting both proxy and authenticator.

Notes

Java’s Authenticator.setDefault() does not work with OkHttp, which requires explicit proxyAuthenticator configuration on the builder.