Skip to content

Conversation

SandraAhlgrimm
Copy link

This change adds the User-Agent header with value 'spring-ai' to the OpenAI API client implementation, bringing it in line with the Azure OpenAI implementation for consistent API monitoring and identification.

Changes Made

  • Added User-Agent header with value 'spring-ai' to OpenAiApi constructor
  • Maintains consistency with Azure OpenAI implementation
  • Improves API monitoring and identification capabilities

Testing

Code has been validated for syntax and follows existing repository patterns.

- Adds 'User-Agent: spring-ai' header to all OpenAI API requests
- Maintains consistency with Azure OpenAI implementation
- Header is set in the RestClient default headers configuration
- Helps OpenAI identify requests coming from Spring AI for analytics and support

Signed-off-by: Sandra Ahlgrimm <[email protected]>
@SandraAhlgrimm SandraAhlgrimm force-pushed the add-user-agent-header-openai branch from 3ed2882 to e3aaf32 Compare September 29, 2025 12:36
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M3 milestone Sep 29, 2025
@ericbottard ericbottard self-assigned this Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants