Initial commit

This commit is contained in:
2025-08-04 16:33:07 +03:30
commit f798e8e35c
9595 changed files with 1208683 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use GuzzleHttp\Client;
class OpenRouterController extends Controller
{
public function sendMessage(Request $request)
{
$client = new Client();
$response = $client->post('https://openrouter.ai/api/v1/chat/completions', [
'headers' => [
'Authorization' => 'Bearer ' . env('OPENROUTER_API_KEY'),
'Content-Type' => 'application/json',
],
'json' => [
'model' => 'openai/gpt-4o',
'messages' => [
['role' => 'user', 'content' => $request->message]
]
]
]);
$body = $response->getBody();
$data = json_decode($body, true);
return response()->json($data);
}
}