Featured image of post 透過 curl 呼叫 ChatGPT API

透過 curl 呼叫 ChatGPT API

透過 curl 呼叫 ChatGPT API

本文假設從 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 設計