Skip to content

[Feature]: Add google-vertex as a supported api type for Vertex AI Express (API key auth) #55572

@ysnock404

Description

@ysnock404

Summary

Support google-vertex as a valid api type in MODEL_APIS to enable Vertex AI Express authentication via API key.

Problem to solve

The pi-ai library already ships a google-vertex provider with streamGoogleVertex and createClientWithApiKey, which supports Vertex AI Express using a simple API key (no service account or ADC required). However, OpenClaw's MODEL_APIS array and JSON schema do not include "google-vertex" as a valid api type, so any provider configured with "api": "google-vertex" fails config validation and is rejected.

Proposed solution

Add "google-vertex" to the MODEL_APIS array in src/config/types.models.ts and to the two corresponding enum arrays in src/config/schema.base.generated.ts. This allows users to configure a provider with "api": "google-vertex" and an apiKey field to use Vertex AI Express without service account credentials.

Alternatives considered

Using google-generative-ai api type instead — does not work because it calls GoogleGenAI without vertexai: true, so the SDK uses AI Studio URLs instead of Vertex AI endpoints.

Impact

Affected: Any user wanting to use Google Vertex AI Express (API key-based auth)
Severity: Blocks workflow — config validation rejects the provider entirely
Frequency: Always
Consequence: Users cannot use Vertex AI Express models (Gemini 2.5 Pro, 3.1 Pro, etc.) via API key auth

Evidence/examples

The google-vertex provider is already registered in pi-ai's register-builtins.js (line 246: api: "google-vertex", stream: streamGoogleVertex). The fix is purely additive — 3 lines across 2 files.

Additional information

The change is fully backward-compatible. No existing config keys are affected. A provider using this api type requires an apiKey field and the Vertex AI Express endpoint (https://aiplatform.googleapis.com/v1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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