We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea2ec55 commit 079b7f6Copy full SHA for 079b7f6
src/v1/api.rs
@@ -35,7 +35,9 @@ pub struct Client {
35
36
impl Client {
37
pub fn new(api_key: String) -> Self {
38
- Self::new_with_endpoint(API_URL_V1.to_owned(), api_key)
+ let endpoint =
39
+ std::env::var("OPENAI_API_ENDPOINT").unwrap_or_else(|_| API_URL_V1.to_owned());
40
+ Self::new_with_endpoint(endpoint, api_key)
41
}
42
43
pub fn new_with_endpoint(api_endpoint: String, api_key: String) -> Self {
0 commit comments