Skip to content

Commit

Permalink
get API key over environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
PandorasActorMS committed Sep 20, 2023
1 parent 057a5fe commit b81a1b6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions stream-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
}


$env = parse_ini_file('.env');

// Replace with your API URL and API key
$apiUrl = 'https://api.openai.com/v1/chat/completions';
$apiKey = $env['OPENAI_API_KEY'];
$apiKey = getenv('OPENAI_API_KEY');

// Read the request payload from the client
$requestPayload = file_get_contents('php://input');
Expand Down

0 comments on commit b81a1b6

Please sign in to comment.