A simpler solution to this is to use the below approach. Since the Anthropic Models are hosted behind OpenAI's API this would be the appropriate approach without adding any unnecessary complexities,
OpenAiChatModel model = OpenAiChatModel.builder()
.baseUrl("https://mycustombaseurl")
.apiKey(authenticator.getValidToken())
.modelName("claude-3-5-sonnet")
.build();