|
if ($this->apiKey !== null) { |
|
$this->headers['x-goog-api-key'] = trim($this->apiKey); |
|
} |
Why not replace this code with the one below
if ($this->apiKey !== null) {
$this->headers['Authorization'] = 'Bearer ' . trim($this->apiKey);
}
This approach is described in the documentation from Google https://ai.google.dev/gemini-api/docs/oauth#curl
For example, I use a proxy to access gemini api and it requires authorization only using the Authorization header. And most likely I'm not alone in this problem.
client/src/Factory.php
Lines 120 to 122 in 6dca9a5
Why not replace this code with the one below
This approach is described in the documentation from Google https://ai.google.dev/gemini-api/docs/oauth#curl
For example, I use a proxy to access gemini api and it requires authorization only using the Authorization header. And most likely I'm not alone in this problem.