#Base URL of OpenAI .NET
1 messages · Page 1 of 1 (latest)
Hi @naive maple. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the knowledge sources provided, there isn't specific information available on how to change the base URL of an OpenAI client in the OpenAI .NET (C#) library. The sources do not contain any examples or instructions for this particular task in the context of the .NET library.
However, in the Python library, it's possible to specify a custom base URL by passing the base_url argument to the constructor, as shown in this Github issue (https://github.com/openai/openai-python/issues/547).
OpenAI(base_url='...')
While this is not directly applicable to the .NET library, it suggests that similar functionality might exist in the .NET library as well. You may want to check the official documentation or source code of the OpenAI .NET library for more specific information.
If you can't find the information you need, consider reaching out to OpenAI support or the OpenAI community for further assistance.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@naive maple kapa.ai is still learning and improving, please let us know how it did by reacting below
i think i have to set this directly in the client. this is how i create the client in c#:
ChatClient client = new(model: "gpt-4o-mini", "sk-my_api_key");
@sly stone
Let me check the knowledge base for you. One moment! :books:
Based on the knowledge sources provided, there isn't specific information available on how to change the base URL of an OpenAI client in the OpenAI .NET (C#) library. The sources do not contain any examples or instructions for this particular task in the context of the .NET library.
The example you provided for creating a client in C#:
ChatClient client = new("gpt-4o-mini", "sk-my_api_key");
Does not include a parameter for setting a custom base URL.
In the Python library, it's possible to specify a custom base URL by passing the base_url argument to the constructor, as shown in this Github issue (https://github.com/openai/openai-python/issues/547).
OpenAI(base_url='...')
While this is not directly applicable to the .NET library, it suggests that similar functionality might exist in the .NET library as well. You may want to check the official documentation or source code of the OpenAI .NET library for more specific information.