News:🔥Finally ChatGPT API Released!

Maks Smagin
2 min readMar 1, 2023

We waited for so long, and finally it happened — Open AI released ChatGPT API, so everyone can use it. It’s much cheaper than GPT3 model (text-davinci-003), and can do all things chat.openai.com can do, but via API. I’m really curios about what kind of new software will be released using this model from other developers.

ChatGPT API

New models gpt-3.5-turbo and gpt-3.5-turbo-0301 available, the same model used in the ChatGPT web based chat. It has all capabilities of text-davinci-003. API is really simple, as developer you just need to provide chat content into request to the model:

curl https://api.openai.com/v1/chat/completions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"model": "gpt-3.5-turbo",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}
]
}'

Basically instead of just using text prompt, you need to provide all chat messages on each request to the model. Each message marked by role: system, user and assistant.

Pricing

--

--