feat: Add skipAuth option for custom endpoints without Google Cloud c…#1137
Closed
what-is-thy-bidding wants to merge 38 commits intogoogleapis:mainfrom
Closed
feat: Add skipAuth option for custom endpoints without Google Cloud c…#1137what-is-thy-bidding wants to merge 38 commits intogoogleapis:mainfrom
what-is-thy-bidding wants to merge 38 commits intogoogleapis:mainfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When using custom endpoints (proxy servers) that implement the Vertex AI API format, users currently MUST provide Google Cloud credentials even though these credentials are never used for actual authentication. The custom endpoints (proxy servers) handle their own authentication (e.g., via Bearer tokens).
The credentials are stored on that proxy server and not on the client's machine locally.
This creates unnecessary friction:
Solution
Added a new `skipAuth` option to `HttpOptions` that allows users to:
When `skipAuth: true`:
Why skip prependProjectLocation?
Normal Vertex AI URLs look like:
https://us-central1-aiplatform.googleapis.com/v1/projects/my-project/locations/us-central1/publishers/google/models/gemini:generateContentCustom endpoint URLs should look like:
https://custom-endpoint.com/v1/publishers/google/models/gemini:generateContentWhen `skipAuth` is set:
Changes
Example Usage
Before (requires REAL Google Cloud credentials):
After (no Google Cloud setup needed):
This brings the TypeScript SDK in line with the Python SDK's behavior, where custom http_options automatically bypass Google Cloud authentication.