Skip to content

[Bug]: google-vertex provider ignores ADC credentials — throws 'No API key found' #56253

@jasminehuang98613

Description

@jasminehuang98613

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

**Bug Report: google-vertex provider ignores ADC credentials — throws 'No API key found'
**


Environment

  • OpenClaw version:v2026.3.23-2
  • OS: Windows (local) + Ubuntu 24.04 on AWS EC2
  • Provider: google-vertex
  • Models tested: google-vertex/gemini-2.5-flash, google-vertex/gemini-2.5-pro

Describe the bug

The google-vertex provider does not recognize GCP Application Default Credentials (ADC). Even when GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_CLOUD_PROJECT, and GOOGLE_CLOUD_LOCATION are correctly set and verified, OpenClaw throws:

No API key found for provider google-vertex

The error suggests OpenClaw's auth resolver for google-vertex expects a plain API key string (like GEMINI_API_KEY) instead of consuming GCP service account credentials via ADC.


Steps to Reproduce

  1. Create a GCP service account with Vertex AI User role
  2. Download the JSON key file
  3. Set environment variables:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
export GOOGLE_CLOUD_PROJECT="your-gcp-project-id"
export GOOGLE_CLOUD_LOCATION="global"
  1. Verify ADC works:
gcloud auth activate-service-account --key-file="/path/to/service-account.json"
gcloud auth application-default print-access-token | head -c 20

✅ ADC token generates successfully

  1. Configure openclaw.json:
"model": {
  "primary": "google-vertex/gemini-2.5-flash",
  "fallbacks": ["google-vertex/gemini-2.5-pro"]
}
  1. Restart OpenClaw gateway and start a chat session

Result: No API key found for provider google-vertex


Expected behavior

OpenClaw should authenticate with Vertex AI using ADC (via GOOGLE_APPLICATION_CREDENTIALS) without requiring a plain API key, consistent with how Google Cloud SDKs handle service account auth.


Workaround

Currently using LiteLLM as a proxy bridge (litellm/gemini-vertex-flash) which correctly handles ADC and routes to Vertex AI. This works but requires running an additional service.


Steps to reproduce

na

Expected behavior

API key found for provider google-vertex`

Actual behavior

No API key found for provider google-vertex`

OpenClaw version

v2026.3.23-2

Operating system

UBUNTU

Install method

npm

Model

google-vertex/gemini-2.5-flash

Provider / routing chain

openclaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclose:already-fixedclaw-marshal labeldedupe:childDuplicate issue/PR child in dedupe cluster

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions