Help me to use API in the PHP code

Hi there,
I’m thrilled to use OpenAi. So, I wanna go ahead. But I’m not that good at coding! I want to use it on a WordPress site. For this, I am trying to build a plugin. But I can not make any seance how to use this API. I have already made a plugin with Github API using the cURL function. But I think OpenAi API is more complicated to me! Can you please give me an example of how I can use it on the PHP cURL function? Your documentation is not helping me with this.

Please convert the billow script to PHP for me.

-H “Content-Type: application/json”
-H “Authorization: Bearer $OPENAI_API_KEY”
-d ‘{
“model”: “text-davinci-002”,
“prompt”: “Write a article about: hi\n”,
“temperature”: 0.7,
“max_tokens”: 256,
“top_p”: 1,
“frequency_penalty”: 0,
“presence_penalty”: 0

Thank you. I hope anyone will help me!