A simple example of an API request and the output of messages to the browser
The code for this example was generated using ChatGPT
- In
index.php
, uncomment one of the options:
include "openai_api.php";
- uses the official APIinclude "openai_chat.php";
- use non-official API from chat.openai.com
- In
openai_*.php
, add the API key and/or cookie content_puid
(available only for ChatGPT Plus users)