From 5d93c299b394865a6d896fbe94f3358b22cfc984 Mon Sep 17 00:00:00 2001 From: ItsNotYou Date: Thu, 14 Mar 2024 22:39:56 +0000 Subject: [PATCH] Add api-key. --- stream-api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stream-api.php b/stream-api.php index 1de52ed..7ad44be 100644 --- a/stream-api.php +++ b/stream-api.php @@ -42,7 +42,8 @@ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, [ - 'Authorization: Bearer ' . $apiKey, + 'Authorization: Bearer ' . $apiKey, # necessary for OpenAI + 'api-key: ' . $apiKey, # necessary for Microsoft Azure AI 'Content-Type: application/json' ]); curl_setopt($ch, CURLOPT_WRITEFUNCTION, function($ch, $data) {