How to convert curl command to http module

Hi there,
I am trying to make a telegram chat bot with a api
Can anyone help me convert this curl command to http module:
curl --location ‘https://api.pawan.krd/v1/chat/completions’ --header ‘Authorization: Bearer pk-[My API Key]’ --header ‘Content-Type: application/json’ --data ‘{“model”: “pai-001-light-beta”,“max_tokens”: 100,“messages”: [{“role”: “system”,“content”: “You are an helpful assistant.”},{“role”: “user”,“content”: “Who are you?”}]}’

Here you go

2 Likes