endpoint, '/') . '/' . ltrim($uri, '/'); $client = $this->http->buildClient(10); $request = $this->http->jsonRequest($method, $fullUrl, $data) ->withHeader('Authorization', 'Bearer ' . $this->key); $response = $client->sendRequest($request); return json_decode($response->getBody()->getContents(), true); } public function generateEmbeddings(string $text): array { $response = $this->jsonRequest('POST', 'v1/embeddings', [ 'input' => $text, 'model' => 'text-embedding-3-small', ]); return $response['data'][0]['embedding']; } }