Featured image of post ChatGPT APIをcurlから呼び出す

ChatGPT APIをcurlから呼び出す

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"": ""ここに送りたいメッセージを挿入する""}]}"
comments powered by Disqus
Hugo で構築されています。
テーマ StackJimmy によって設計されています。