Problem
When using the Vertex AI client with vertex.WithGoogleAuth(), the Models API (client.Models.ListAutoPaging()) does not work.
The Vertex middleware in vertex/vertex.go only handles:
/v1/messages
/v1/messages/count_tokens
But /v1/models is not processed, causing requests to fail.
Expected
Either:
- Support
/v1/models endpoint translation for Vertex AI
- Provide a helper like
vertex.AvailableModels() returning known Vertex model IDs
- Document this limitation with available model IDs
Use Case
Building a model selector UI that needs to dynamically list available models when using Vertex AI.
Environment
- anthropic-sdk-go v1.19.0+
- Using
vertex.WithGoogleAuth()
Problem
When using the Vertex AI client with
vertex.WithGoogleAuth(), the Models API (client.Models.ListAutoPaging()) does not work.The Vertex middleware in
vertex/vertex.goonly handles:/v1/messages/v1/messages/count_tokensBut
/v1/modelsis not processed, causing requests to fail.Expected
Either:
/v1/modelsendpoint translation for Vertex AIvertex.AvailableModels()returning known Vertex model IDsUse Case
Building a model selector UI that needs to dynamically list available models when using Vertex AI.
Environment
vertex.WithGoogleAuth()