File size: 386 Bytes
6f465ab
 
 
4e95f46
 
6f465ab
 
5460635
 
6f465ab
 
1
2
3
4
5
6
7
8
9
10
11
import openai

client = openai.OpenAI(
    api_key="gptkey0",        #the same api key in your environment; set as you prefer
    base_url="https://yousefsg-chatgpt-api.hf.space/v1"
)
response = client.chat.completions.create(
    model="",  # or gpt-4o-mini
    messages=[{"role": "user", "content":  "what is the latest Anthropic model"}],
)
print(response.choices[0].message.content)