dev/etc
[openai] chatgpt 1 - Setting & RestAPI
pearlab
2023. 3. 20. 10:44
[Prepare the environment]
start openai home page
[Move to Developers Overview]
Select Personal(my info) in Site
Move to View API Key
Create new secret key
copy my "SECRET KEY"
[Move to API reference tap]
http request(post) url : https://api.openai.com/v1/chat/completions
need Http Header
@content-type : application/json
@Authorization : Bearer "SECRET KEY"
@Json Body :
{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "boll game list"}, {"role": "user", "content": "one of the most popular games"}]
}
next