openclaw - 💡(How to fix) Fix google-vertex: schema missing google-vertex from allowed api values, blocking Vertex AI routing [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77643Fetched 2026-05-06 06:23:33
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
closed ×1commented ×1

The OpenClaw 2026.5.3 config schema does not allow api: "google-vertex" in models.providers, which is required by the runtime createStreamFn to route requests through the Vertex AI transport instead of the AI Studio transport.

Root Cause

The createStreamFn in extensions/google/provider-registration.ts checks model.api === "google-vertex" to return the Vertex transport:

createStreamFn: ({ model }) => {
  if (model.api === "google-generative-ai")
    return createGoogleGenerativeAiTransportStreamFn();
  if (model.api === "google-vertex" && hasGoogleVertexAuthorizedUserAdcSync())
    return createGoogleVertexTransportStreamFn();
  return undefined;
}

However, the config schema only allows these values for provider/model api: openai-completions | openai-responses | ... | google-generative-ai | ... | azure-openai-responses

"google-vertex" is not in the allowed enum.

Fix Action

Fix / Workaround

Workaround Attempts (all failed)

Code Example

createStreamFn: ({ model }) => {
  if (model.api === "google-generative-ai")
    return createGoogleGenerativeAiTransportStreamFn();
  if (model.api === "google-vertex" && hasGoogleVertexAuthorizedUserAdcSync())
    return createGoogleVertexTransportStreamFn();
  return undefined;
}
RAW_BUFFERClick to expand / collapse

Summary

The OpenClaw 2026.5.3 config schema does not allow api: "google-vertex" in models.providers, which is required by the runtime createStreamFn to route requests through the Vertex AI transport instead of the AI Studio transport.

Environment

  • OpenClaw version: 2026.5.3 (06d46f7)
  • OS: Windows 11
  • Node.js: v24.14.1
  • GCP: ADC via gcloud auth application-default login

Root Cause

The createStreamFn in extensions/google/provider-registration.ts checks model.api === "google-vertex" to return the Vertex transport:

createStreamFn: ({ model }) => {
  if (model.api === "google-generative-ai")
    return createGoogleGenerativeAiTransportStreamFn();
  if (model.api === "google-vertex" && hasGoogleVertexAuthorizedUserAdcSync())
    return createGoogleVertexTransportStreamFn();
  return undefined;
}

However, the config schema only allows these values for provider/model api: openai-completions | openai-responses | ... | google-generative-ai | ... | azure-openai-responses

"google-vertex" is not in the allowed enum.

Symptom

When adding api: "google-vertex" to models.providers.google-vertex, the gateway rejects the config with: Invalid option: expected one of "openai-completions"|...|"azure-openai-responses"

Workaround Attempts (all failed)

  1. Use api: "google-generative-ai"createStreamFn routes to AI Studio transport, building /v1beta/models/... URLs instead of Vertex /v1beta1/projects/{project}/locations/{location}/publishers/google/models/... format. Result: 404.

  2. Omit the provider entry, rely on hookAlias + template system — Template models cloned by resolveGoogleGeminiForwardCompatModel inherit api: "google-generative-ai", causing same routing issue.

  3. Use auth.profiles["google-vertex:default"]google-vertex provider contract has auth: [] (empty), profiles are silently ignored.

What Works Correctly

  • ADC authentication via application_default_credentials.json (authorized_user type)
  • GOOGLE_CLOUD_PROJECT / GOOGLE_CLOUD_LOCATION via openclaw.json env section
  • Proxy routing via request.proxy + allowPrivateNetwork
  • Model alias resolution (google-vertex/gemini-2.5-flashgemini-2.5-flash)

Proposed Fix

Add "google-vertex" to the allowed enum values for the api field on both models.providers.<name> and models.providers.<name>.models[].

Debug Trail

  1. fetch failed → DNS blocked (GFW), proxy added ✅
  2. Blocked hostname or private IP → SSRF guard, added allowPrivateNetwork
  3. 404 from Google Vertex AI API → Wrong URL path format, root caused to schema bug
  4. Confirmed via sub-agent test with google-vertex/gemini-2.5-flash

extent analysis

TL;DR

The most likely fix is to add "google-vertex" to the allowed enum values for the api field in the OpenClaw config schema.

Guidance

  • Verify that the createStreamFn function is correctly routing requests to the Vertex AI transport by checking the model.api value.
  • Update the OpenClaw config schema to include "google-vertex" as an allowed value for the api field on both models.providers.<name> and models.providers.<name>.models[].
  • Test the updated config to ensure that requests are correctly routed to the Vertex AI transport and that the 404 error is resolved.
  • Review the resolveGoogleGeminiForwardCompatModel function to ensure that it is correctly handling the updated api value.

Example

// Updated config schema
const allowedApiValues = [
  "openai-completions",
  "openai-responses",
  // ...
  "google-generative-ai",
  "google-vertex", // Added "google-vertex" to the allowed enum values
  // ...
];

// Updated createStreamFn function
createStreamFn: ({ model }) => {
  if (model.api === "google-vertex" && hasGoogleVertexAuthorizedUserAdcSync())
    return createGoogleVertexTransportStreamFn();
  // ...
}

Notes

The proposed fix assumes that the createStreamFn function is correctly implemented and that the hasGoogleVertexAuthorizedUserAdcSync() function is working as expected. Additionally, the fix may require updates to other parts of the codebase that rely on the api field.

Recommendation

Apply the workaround by adding "google-vertex" to the allowed enum values for the api field in the OpenClaw config schema, as this is the most direct solution to the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix google-vertex: schema missing google-vertex from allowed api values, blocking Vertex AI routing [1 comments, 2 participants]