-
-
Notifications
You must be signed in to change notification settings - Fork 69.7k
[Bug]: Google Vertex AI ADC authentication not working on Windows - "No API key found" #11413
Description
Problem
The google-vertex provider fails to authenticate using Google Cloud Application Default Credentials (ADC) on Windows, despite:
- Valid gcloud ADC credentials
GOOGLE_APPLICATION_CREDENTIALSenvironment variable correctly setgcloud auth application-default print-access-tokenworking correctly- Vertex AI API enabled in GCP project
Environment
- OpenClaw Version: 2026.2.6-3 (85ed6c7)
- OS: Windows 11
- Node.js Version: v24.13.0
- Google Cloud Project: CWR001
- Google Cloud SDK: Installed and authenticated
Steps to Reproduce
- Set up Google Cloud authentication:
gcloud auth application-default login
gcloud config set project CWR001- Verify ADC is working:
# This returns a valid access token
gcloud auth application-default print-access-token
# Verify environment variable
$env:GOOGLE_APPLICATION_CREDENTIALS
# Output: C:\Users\User\AppData\Roaming\gcloud\application_default_credentials.json
# Verify credentials file exists
Test-Path $env:GOOGLE_APPLICATION_CREDENTIALS
# Output: True- Verify Vertex AI API is enabled:
gcloud services list --enabled --filter="name:aiplatform.googleapis.com"
# Output: aiplatform.googleapis.com Vertex AI API- Configure OpenClaw with google-vertex provider:
Set in ~/.openclaw/openclaw.json:
{
"agents": {
"defaults": {
"model": {
"primary": "google-vertex/gemini-1.5-pro"
}
}
}
}- Try various auth-profiles.json configurations:
All of these failed:
Attempt 1 - No auth profile:
# Deleted auth-profiles.json entirelyAttempt 2 - OAuth type:
{
"google-vertex:default": {
"type": "oauth",
"provider": "google-vertex"
}
}Attempt 3 - With profiles wrapper:
{
"profiles": {
"google-vertex:default": {
"provider": "google-vertex",
"mode": "adc"
}
}
}Attempt 4 - Explicit file path:
{
"profiles": {
"google-vertex:default": {
"provider": "google-vertex",
"mode": "file",
"credentials": "C:\\Users\\User\\AppData\\Roaming\\gcloud\\application_default_credentials.json",
"project": "CWR001",
"location": "us-central1"
}
}
}- Attempt to use OpenClaw:
openclaw agent --agent main --message "Hello test"Expected Behavior
OpenClaw should:
- Detect the ADC credentials from
GOOGLE_APPLICATION_CREDENTIALSenvironment variable - Automatically use them for Vertex AI authentication
- Successfully make requests to Vertex AI models
Per the documentation at https://docs.openclaw.ai/concepts/model-providers:
Vertex uses gcloud ADC
Actual Behavior
Error:
FailoverError: No API key found for provider "google-vertex".
Auth store: C:\Users\User\.openclaw\agents\main\agent\auth-profiles.json
(agentDir: C:\Users\User\.openclaw\agents\main\agent).
Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir.
Full error log:
18:56:07 [diagnostic] lane task error: lane=main durationMs=3 error="Error: No API key found for provider "google-vertex". Auth store: C:\Users\User\.openclaw\agents\main\agent\auth-profiles.json (agentDir: C:\Users\User\.openclaw\agents\main\agent). Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir."
Additional Context
Credentials File Contents
gc $env:GOOGLE_APPLICATION_CREDENTIALS | ConvertFrom-Json | Select-Object type, quota_project_id, universe_domain
# Output:
# type quota_project_id universe_domain
# ---- ---------------- ---------------
# authorized_user CWR001 googleapis.comOpenClaw Models List Output
openclaw models list
# Shows google-vertex models but with Auth: noCode Analysis
Looking at src/agents/model-auth.ts in the OpenClaw repository, line 262-268:
if (normalized === "google-vertex") {
const envKey = getEnvApiKey(normalized);
if (!envKey) {
return null;
}
return { apiKey: envKey, source: "gcloud adc" };
}The code calls getEnvApiKey(normalized) which appears to be looking for credentials, but it's returning null despite the environment being properly configured.
Related Issues
- [Feature/Bug] Google Vertex AI authentication not working + Anthropic models on Vertex not available #897 - Same issue on Ubuntu/Linux (closed but no clear resolution documented)
- [Bug] Google providers authentication failures and LLM request timeouts #9300 - All Google providers failing with authentication (open)
- Feature Request: Add Google Vertex AI support with ADC authentication #9729 - Feature request for Vertex AI with ADC (suggests it's not fully implemented)
- Feature Request: Add Google Cloud Speech-to-Text and Text-to-Speech support #9738 - Feature request for better Google Cloud integration
Platform-Specific Notes
This appears to be a Windows-specific issue or a cross-platform ADC detection problem:
- gcloud CLI works correctly on Windows
- ADC credentials file exists and is valid
- Environment variable is set correctly
- OpenClaw just doesn't detect/use the credentials
Willingness to Help
Happy to provide:
- Additional debugging information
- Test any proposed fixes
- Contribute to PR if guidance is provided
Environment Details
OpenClaw version
Output: 2026.2.6-3 (85ed6c7)
Node.js version
v24.13.0
Windows version
Platform ServicePack Version VersionString
Win32NT 10.0.26100.0 Microsoft Windows NT 10.0.26100.0
gcloud version
Google Cloud SDK 555.0.0
bq 2.1.27
core 2026.01.30
gcloud-crc32c 1.0.0
gsutil 5.35