<?php
$apikey = "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";
$ch = curl_init("https://api.openai.com/v1/chat/completions");
$data = [
  "model" => "gpt-4o-mini",
  "messages" => [
    ["role"=>"system","content"=>"You are a tester"],
    ["role"=>"user","content"=>"Di hola en español"]
  ]
];
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Content-Type: application/json",
  "Authorization: Bearer $apikey"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
if (curl_errno($ch)) {
    die("CURL error: " . curl_error($ch));
}
echo $response;
