<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://speshu.ai/api/v1/responses",
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' => 'gpt-4o',
'input' => '<string>',
'stream' => false,
'instructions' => '<string>',
'max_output_tokens' => 123,
'max_tool_calls' => 123,
'temperature' => 123,
'top_p' => 123,
'text' => [
],
'tools' => [
[
]
],
'parallel_tool_calls' => true,
'reasoning' => [
'summary' => '<string>',
'max_tokens' => 123
],
'previous_response_id' => '<string>',
'conversation' => [
],
'include' => [
'<string>'
],
'store' => true,
'metadata' => [
]
]),
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;
}