Skip to content

Conversation

@tzolov
Copy link
Contributor

@tzolov tzolov commented Feb 27, 2025

Add the ability to specify custom HTTP headers for Anthropic API requests through AnthropicChatOptions. This allows users to override or add headers for authentication, tracking, or other API-specific requirements.

  • Add httpHeaders field to AnthropicChatOptions with appropriate getters/setters
  • Implement header merging between default and runtime options
  • Update AnthropicApi to accept additional HTTP headers in API calls
  • Add integration test demonstrating API key override via custom headers
  • Update documentation with the new configuration property

Resolves #2335

… requests

Add the ability to specify custom HTTP headers for Anthropic API requests through AnthropicChatOptions.
This allows users to override or add headers for authentication, tracking, or other API-specific requirements.

- Add httpHeaders field to AnthropicChatOptions with appropriate getters/setters
- Implement header merging between default and runtime options
- Update AnthropicApi to accept additional HTTP headers in API calls
- Add integration test demonstrating API key override via custom headers
- Update documentation with the new configuration property

Resolves spring-projects#2335

Signed-off-by: Christian Tzolov <[email protected]>
@tzolov tzolov added this to the 1.0.0-M7 milestone Feb 27, 2025
@sobychacko sobychacko self-assigned this Feb 27, 2025
@sobychacko sobychacko merged commit 041d94f into spring-projects:main Feb 28, 2025
2 checks passed
leijendary pushed a commit to leijendary/spring-ai that referenced this pull request Mar 28, 2025
… requests (spring-projects#2343)

Add the ability to specify custom HTTP headers for Anthropic API requests through AnthropicChatOptions.
This allows users to override or add headers for authentication, tracking, or other API-specific requirements.

- Add httpHeaders field to AnthropicChatOptions with appropriate getters/setters
- Implement header merging between default and runtime options
- Update AnthropicApi to accept additional HTTP headers in API calls
- Add integration test demonstrating API key override via custom headers
- Update documentation with the new configuration property

Resolves spring-projects#2335

Signed-off-by: Christian Tzolov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need HTTP header support for Anthropic

2 participants