Helicone Community Page

Updated 6 months ago

Potential issue with oai.helicone.ai/v1 endpoint

Hi - is there something wrong with the oai.helicone.ai/v1 endpoint atm? My chat requests are returning with the following HTML string, but the same requests made to the api.openai.com/v1 endpoint are fine
J
y
17 comments
Hi @yidi8186 can you share a little bit more about your setup? Maybe a code snippet? Anything tp help us reproduce the issue would be helpful
Hi Justin! I'm using the helicone proxy gateway to make my OAI API queries. Here are the relevant parts of the code:

Plain Text
gpt_client = openai.OpenAI(
    organization=os.environ.get("KIMLAB_OAI_ID"),
    api_key=os.environ.get("OPENAI_API_KEY"),
    base_url="https://api.openai.com/v1", # This used to be https://oai.helicone.ai/v1
    default_headers={
        "Helicone-Auth": f"Bearer {os.environ.get('HELICONE_API_KEY')}",
        "Helicone-Cache-Enabled": "true",
    },
)

^ This instantiates the client for self.client below
Plain Text
    def query_llm(self, llm_prompt):
        response = self.client.chat.completions.create(
            model=self.model,
            messages=[
                {"role": "system", "content": self.sys_prompt},
                {"role": "user", "content": llm_prompt}
            ]
        )
        return response.choices[0].message.content.replace("\n","  ")

^ This is the function being called below
Plain Text
        tests["llm_answer"] = tests["question"].apply(self.query_llm)
Hi! Thank you for sharing!
where are you in the world? I think this might be a region thing. feel free to DM me if you dont want to post it here
Actually, looking at the previous version of our code, it actually used to be http://oai.helicone.ai/v1. Could that be the issue?
I'm in PA, USA
oh yes! You need https:// with the s
thanks! That should be ok actually
Ah ok, in that case weird that it used to work a few weeks ago!
SSL is a weird beast, I dont think I will ever fully understand how it works
@Cole is also building AI stuff and is from PA. happy to see lots of PA builders here πŸ’ͺ
haha cool! Thanks for the quick response!
It's my job πŸ˜‰
Add a reply
Sign up and join the conversation on Discord