#Cloud Code API error: Invalid JSON
1 messages · Page 1 of 1 (latest)
That specific 400 is almost always Cloud Code Assist (Gemini) tool-schema incompatibility: the endpoint only accepts a subset of JSON Schema, and it rejects keywords like patternProperties (exactly what your error says).
Fix
- Check your OpenClaw version (this was fixed by adding a “Gemini schema cleaner” in newer builds):
- Run:
openclaw --version - If you’re older than 2026.1.9, update OpenClaw and restart the gateway, then retry.
- If you can’t update right now, work around it by:
- Switching to a non–Cloud Code Assist model/provider for tool use (Cloud Code is the picky one), or
- Simplifying/removing custom tools that generate
patternProperties(common culprit: “dictionary/map” types). Stick to:type: "object",properties,required, simpleenum- avoid
anyOf/oneOf/allOf,patternProperties,additionalProperties,minLength/maxLength,format, etc.
Quick questions so I can point you to the exact next step
- What does
openclaw --versionshow? - Are you using a
google-antigravity/...model (Cloud Code Assist), and did you add any custom tools?
(There’s also a troubleshooting note here—currently in the zh-CN docs, but the checklist is exactly the above: https://docs.openclaw.ai/zh-CN/gateway/troubleshooting )