config('llm.api.transcription.host') . '/audio/transcriptions', CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => [ 'file' => new \CURLFile($filePath), 'model' => config('llm.models.transcription.name'), ], CURLOPT_HTTPHEADER => $this->getHeaders(), ]); $response = curl_exec($curl); $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); if ($httpCode !== 200) { Log::error("Error during transcription: HTTP code {$httpCode} : {$response}"); return null; } $responseData = json_decode($response, true); return $responseData['text'] ?? null; } }