post($url, [ 'headers' => [ 'Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $apiKey ], 'json' => [ 'model' => 'gpt-3.5-turbo', 'messages' => [['role' => 'user', 'content' => 'Say this is a test!']], 'temperature' => 0.7 ] ]); return json($response->getBody()->getContents()); } }