<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.powertokens.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'deepseek-v4-pro',
'messages' => [
[
'content' => 'You are a helpful assistant',
'role' => 'system'
],
[
'content' => 'Hi',
'role' => 'user'
]
],
'thinking' => [
'type' => 'enabled'
],
'reasoning_effort' => 'high',
'max_tokens' => 4096,
'response_format' => [
'type' => 'text'
],
'stop' => null,
'stream' => false,
'stream_options' => null,
'temperature' => 1,
'top_p' => 1,
'tools' => null,
'tool_choice' => 'none',
'logprobs' => false,
'top_logprobs' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}