You can convert your curl command into a PHP script using the curl functions in PHP. Here's an example of how to do it:
<?php
$apiKey = 'YOUR_OPENAI_API_KEY'; // Replace with your actual OpenAI API key
$data = [
"model" => "gpt-4o",
"messages" => [