How to use @google/genai with Vertex BYOK?
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 345
- Avg merge
- 13h 31m
- Merged PRs (30d)
- 1
Description
I've been trying to understand how to get @google/genai working with BYOK/Unified Billing gateways.
The following works for **unauthenticated** gateways, but defeats the purpose of centralizing secrets since they need to be passed at client creation.
```typescript
client = new GoogleGenAI({
vertexai: true,
project: googleCredentials.project_id,
location: 'global',
googleAuthOptions: {
credentials: {
client_email: googleCredentials.client_email,
private_key: googleCredentials.private_key,
},
},
httpOptions: {
baseUrl: `${CF_GATEWAY_BASE_URL({
accountId: c.env.CF_ACCOUNT_ID,
gatewayId: c.env.CF_AI_GATEWAY_UNAUTHED_ID,
})}/google-vertex-ai`,
},
});
```
Contributor guide
Assessment
This issue has not been assessed yet.