How can i get my GPT "API ENDPOINT"?

I’m developing an AI website and in my python code I will need to input my “GPT API KEY” and “GPT API ENDPOINT”, already I have gotten my GPT API KEY, what I’m finding difficult to get now is the GPT API ENDPOINT, please how can i get my GPT API ENDPOINT?

Thank you

All the endings are listed here,

https://platform.openai.com/docs/api-reference

If you are talking about “GPT” as in “custom GPT I made in ChatGPT Plus with my GPT-4 enabled subscription”… The only place that can be used, and shared, is within ChatGPT Plus.

You only talk to a GPT agent on OpenAI’s site.

Thanks for your response, really appreciate, what I meant is I’m developing an AI website and in my python I will need to input my “API KEY” and “API Endpoint” already I have created my API KEY what I’m finding difficult to get now is my API ENDPOINT, please how can I get my API ENDPOINT? below is my python code screenshot

You will see where I need to replace the Keys and Endpoint, you will understand the code by reading the comment

I can also see “prompt” instead of messages, meaning this is likely old stuff found on zee interwebs - or you asked an AI to write it.

I can get you off to a better start than where you’ve been.

To use the API, you must have a developer account with payment method (no, the API is not free), the starting point is here: platform.openai.com.

That’s where you’d generate an API key. The API should not be included in code; instead you’d want to include it as an environment variable where it cannot be extracted easily by adversaries.

Then for practical code, head to the documentation link in the API account, where you can go to quickstart. The openai python library will be much easier to employ, but if you must make direct requests:

The particular endpoint URL for each method, such as “chat” where you should begin, along with gpt-3.5-turbo for talking to an AI, can be found in “API Reference”, where you can see curl code examples for making direct requests (instead of python examples for using library methods.) There’s toggles and selectors above each code block example on the right side.

1 Like

Thanks for your response, do you mean each method have their own Endpoint, e.g this is for chat"POST

https://api.openai.com/v1/chat/completions"

It means I can use this link in place of “GPT API ENDPOINT” right?

Yes, that is where you send your json-formatted request, with messages, the chat model, etc, and receive a response object back.

Thank you so much for your clarification, I thought that each openai user have their own unique API ENDPOINT like everyone has their own unique API KEY

So it means each method have their own Endpoint like; chat, audio, image, transcription e.t.c. i never knew, i thought that api endpoint is unique like api key which every user have their own