api request_error ai_generated true

400 Bad Request: JSON parse error

ID: api/json-parse-error

Also available as: JSON · Markdown
88%Fix Rate
90%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

Request body is not valid JSON.

generic

Workarounds

  1. 92% success Validate JSON before sending: use json.dumps() not string concat
  2. 88% success Check for trailing commas, single quotes, and unescaped characters

Dead Ends

Common approaches that don't work:

  1. URL-encode the JSON string 82% fail

    Double-encoding, parse still fails

  2. Send raw string without JSON serialization 85% fail

    Not valid JSON