How to add Custom Interceptors In OpenAI Java SDK when using response API?
All i Can do is
OpenAIOkHttpClient.builder()
.apiKey(“Keys”)
.timeout(Duration.ofSeconds(300))
.maxRetries(3)
.responseValidation(true)
.build()
But i want to add custom headers so i can track remaing requests and then throttle accordingly
Any help is appriciated!
Nope!
Moved away from SDK to Rest Calls,
There i can track my own headers and outputs. Problem is it will take some good time to implement with all the options available in SDK
Thanks. I actually ended up using the .putAllHeaders() method of the client builder. Another way I was able to make it work was using the .additionalHeaders() method of the ChatCompletionCreateParams builder.