How can I create python script to connect with my custom chatgpt


Now, I can connect to Chatgpt with default model with python script.

STANDARD_MODEL_NAME = "gpt-3.5-turbo"
response =,messages=[{"role": "user", "content": user_message}])

How can I connect with my own custom Chatgpt “hxxps://chat[.]openai[.]com/g/g-xxxxxxxx”?

I think you are asking how to use a custom GPT in your IDE, or outside of the ChatGPT interface. This is not possible, but you could create an assistant with the same prompt and knowledge files.

Do you have a tutorial about ‘python connect to ChatGPT assistance’ ?

In addition to the Documentation and API reference there is the cookbook:
I presume there are good tutorials on YouTube but I don’t use them. Maybe others can recommend.

Thanks. Now I can connect with Assistant’s Thread.

1 Like