JuliusBrussee/caveman · error

vertex endpoint host %q is not an aiplatform host

Error message

vertex endpoint host %q is not an aiplatform host

What it means

After SSRF validation, the resolved endpoint host is not a recognized Google aiplatform host. The gate ensures the constructed upstream URL (base + stripped /vertex path) actually points at the aiplatform service and not some other host that survived URL assembly — a defense against misconfigured base URLs or path tricks.

Source

Thrown at proxy/providers/vertex/routing.go:66

	if route.BaseURL != "" {
		baseURL = route.BaseURL
	}
	base, err := url.Parse(baseURL)
	if err != nil {
		return nil, fmt.Errorf("vertex base url invalid: %w", err)
	}
	base.Path = strings.TrimRight(base.Path, "/") + strings.TrimPrefix(req.URL.Path, "/vertex")
	base.RawQuery = req.URL.RawQuery

	// SSRF/host validation on the resolved endpoint. Active in managed (prod)
	// mode; local/self-hosted (stub) endpoints are permitted so the dry-run and
	// examples can target the provider-stub.
	if env.IsProduction() {
		if err := ssrf.ValidateURL(ctx, base.String(), ssrf.ManagedConfig()); err != nil {
			return nil, err
		}
		if host := base.Hostname(); !isVertexHost(host) {
			return nil, fmt.Errorf("vertex endpoint host %q is not an aiplatform host", host)
		}
	}
	return base, nil
}

func methodAllowed(publisher, method string) bool {
	switch publisher {
	case "google":
		return method == "generateContent" || method == "streamGenerateContent"
	case "anthropic":
		return method == "rawPredict" || method == "streamRawPredict"
	default:
		return false
	}
}

// InspectRequest fills in request metadata. Vertex carries the model id in the
// request path (.../models/{model}:{method}) rather than the body, so the model

View on GitHub (pinned to 766dce6b13)

Solutions

  1. Point the Vertex base URL at a valid aiplatform endpoint (e.g. https://aiplatform.googleapis.com)
  2. In non-managed/stub mode, use the provider-stub endpoint designed for the dry-run instead of an arbitrary host
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at proxy/providers/vertex/routing.go:66 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/761c2a1857a82309. Report an issue: GitHub.