Sometimes we access OpenAI not necessarily through https://api.openai.com. Due to network reasons, sometimes we will build a proxy domain for requests. We hope to support custom host functionality, not just for OpenAI, but also for other AI language models. In most cases, we use this method for proxy access. Thank you very much for your efforts and hope you can consider this feature, which is really important for users in China and some other countries.

Comment From: jaychoubaby

When there is a network blockade, we cannot make requests through https://api.openai.com/v1/chat/completions. However, we have set up a domain proxy ourselves, and it is possible to access it normally through https://${my-domain}/v1/chat/completions. I noticed that the current code has hardcoded "https://api.openai.com" as a fixed value, which prevents us from using spring-ai properly.

Comment From: tzolov

Have you checked the Spring AI OpenAI documentation? And the available properties listed there: https://docs.spring.io/spring-ai/reference/api/chat/openai-chat.html#_chat_properties Isn't the spring.ai.openai.base-url what you need?

Comment From: jaychoubaby

Have you checked the Spring AI OpenAI documentation?

And the available properties listed there: https://docs.spring.io/spring-ai/reference/api/chat/openai-chat.html#_chat_properties

Isn't the spring.ai.openai.base-url what you need?

I'm sorry for this, I didn't authenticate to check the document, thank you very much for your reply.