@Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request()
                .newBuilder()
                .header("Authorization", "Bearer " + token)
                .build();
        return chain.proceed(request);
    }
OkHttp Interceptor that adds an authorization token header
client/src/main/java/com/theokanning/openai/client/AuthenticationInterceptor.java