ChatGPT APIをcurlから呼び出す
Windowsのコマンドプロンプトから呼び出すことを前提としています。
1
2
|
curl https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer sk-proj-XXXXXXXXXXXXXXXXXXXX" -d "{""model"": ""gpt-3.5-turbo"",""messages"": [{""role"": ""system"", ""content"": ""関西弁で答えてください。""}, {""role"": ""user"", ""content"": ""ここに送りたいメッセージを挿入する""}]}"
|