How does Langchain support custom OpenAI endpoints?

import os
import requests
import time
import json
import time
from langchain.llms import OpenAI
 
API_SECRET_KEY = "custom key";
BASE_URL = "https://address/v1 (must include v1)"; # custom OpenAI base-url or api_url
 
os.environ["OPENAI_API_KEY"] = API_SECRET_KEY
os.environ["OPENAI_API_BASE"] = BASE_URL
 
def text():
    llm = OpenAI(temperature=0.9)
    text = "What would be a good company name for a company that makes colorful socks?"
    print(llm(text))
 
if __name__ == '__main__':
    text();

Reference