Invalid JSON Request: Malformed Surrogate Character in API Payload

Resolved 💬 3 comments Opened Jul 19, 2025 by raph-sisa Closed Jan 5, 2026

Bug Description
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"The
request body is not valid JSON: no low surrogate in string: line 1 column 385842 (char
385841)"}}

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 1.0.56
  • Feedback ID: 3b590793-73dc-4632-ba20-cda094e653a2

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:892:11)\n    at execSync (node:child_process:964:15)\n    at A7 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:797:5848)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:48013\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:609:14408)\n    at fY (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:45724)\n    at QK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:44590)\n    at SB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:50639)","timestamp":"2025-07-19T18:54:02.449Z"},{"error":"Error: ENOENT: no such file or directory, open '/proc/version'\n    at Module.readFileSync (node:fs:433:20)\n    at Object.readFileSync (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:615:7077)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:615:8638\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:609:14408)\n    at kT4 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:709:62815)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-19T18:54:02.851Z"},{"error":"SyntaxError: Unexpected token '&', ...\"\"offset\": &nbsp;162,\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:704:9932\n    at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:609:14408)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1434:237\n    at Array.map (<anonymous>)\n    at R61 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1434:49)\n    at mqB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2670:13136)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2670:9066\n    at async JKA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2670:1626)","timestamp":"2025-07-19T19:24:28.820Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The request body is not valid JSON: no low surrogate in string: line 1 column 385842 (char 385841)\"}}\n    at V4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1249:6428)\n    at dM.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1266:2101)\n    at dM.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1266:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async w81.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2670:14158)\n    at async w81 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2210:1704)\n    at async mqB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2670:14009)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2670:9066\n    at async JKA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2670:1626)\n    at async ra (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2670:9036)","timestamp":"2025-07-19T19:28:42.101Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The request body is not valid JSON: no low surrogate in string: line 1 column 385842 (char 385841)\"}}\n    at V4.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1249:6428)\n    at dM.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1266:2101)\n    at dM.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1266:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async w81.showErrors (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code

Note: Error logs were truncated.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗