Successfully fixed, thank you!
@andrewpeng Thank you so much! Now I see completions in the Dashboard.
I added store:true key in the api request yet the Chat Completions doesn’t show in the dashboard.
is there is any update ?
Hello Guys,
do we have any updates on this issue here ?
@andrewpeng @karenli
Hi @fuelin274 do you happen to have an example request that has failed here? Just ran the following example and I am able to see the completions in the dashboard.
import OpenAI from "openai";
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
organization: "your-org"
});
const completion = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{
role: "user",
content: "Write a haiku about recursion in programming.",
},
],
store: true,
});
console.log(completion.choices[0].message);
Hello,
Thanks for replying,
Kindly find the code I’m using:
public function sendToGPT($base64Image)
{
$apiKey = env('OPENAI_API_KEY');
$endpoint = "https://api.openai.com/v1/chat/completions";
$organization = 'org-tmeQpAR4QnjNN46Yw4KsRATH';
$data = [
"model" => "gpt-4o",
"store" => true,
"temperature" => 0,
"top_p" => 1,
"max_tokens" => 100,
"frequency_penalty" => 0,
"presence_penalty" => 0,
"metadata" => [
"source" => "gas_pump_ocr",
"user_ip" => request()->ip(),
"timestamp" => now()->toISOString(),
"environment" => env('APP_ENV'),
],
"messages" => [
[
"role" => "system",
"content" => "You are a precise gas pump detail extractor. Always respond in valid JSON format with exactly these fields: fuel_type, total_fuel_sale, total_liters, price_per_liter. Use null for missing values."
],
[
"role" => "user",
"content" => [
[
"type" => "text",
"text" => "Extract the following details from this gas pump image and return ONLY a JSON object: fuel type, total sale amount, total liters, and price per liter."
],
[
"type" => "image_url",
"image_url" => [
"url" => $base64Image
]
]
]
]
]
];
$response = Http::withHeaders([
'Authorization' => "Bearer $apiKey",
'Content-Type' => 'application/json',
'OpenAI-Organization' => $organization ?? ''
])->post($endpoint, $data);
return $response->json();
}```
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.