[Bug] Anthropic API Error: Invalid JSON Request Body Parsing
Resolved 💬 3 comments Opened Aug 24, 2025 by osmant Closed Aug 27, 2025
Bug Description
I started getting the following message and there seem to be no way around it.
⎿ 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 433942
(char 433941)"},"request_id":"req_011CSSBR4EQSFGxwLuCd6FS3"}
Environment Info
- Platform: darwin
- Terminal: WarpTerminal
- Version: 1.0.89
- Feedback ID:
Errors
[{"error":"MaxFileReadTokenExceededError: File content (26814 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at nt2 (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1770:432)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1765:994)\n at async RL5 (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3408:10495)\n at async fgB (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3408:6814)\n at async tt2 (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1770:3411)\n at async dBB (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1955:843)\n at async OL5 (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3408:6025)\n at async NL5 (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3408:5397)\n at async DE (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3408:2920)","timestamp":"2025-08-23T05:34:19.265Z"},{"error":"MaxFileReadTokenExceededError: File content (27101 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at nt2 (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1770:432)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1765:994)\n at async XM (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1770:2956)\n at async file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1784:1032","timestamp":"2025-08-23T05:43:01.797Z"},{"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 433942 (char 433941)\"},\"request_id\":\"req_011CSSBFvezfeSTVUpaxMcLR\"}\n at b4.generate (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:926:2412)\n at HP.makeStatusError (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:943:2101)\n at HP.makeRequest (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:943:5314)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async NZ1.showErrors (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1898:27491)\n at async NZ1 (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1898:16486)\n at async qBB (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1898:27321)\n at async file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1898:22275\n at async XD0 (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1898:3656)\n at async $e (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1898:22245)","timestamp":"2025-08-24T07:56:48.451Z"},{"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 433942 (char 433941)\"},\"request_id\":\"req_011CSSBKJrKEuHsfSg2L1wxe\"}\n at b4.generate (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:926:2412)\n at HP.makeStatusError (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:943:2101)\n at HP.makeRequest (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:943:5314)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async NZ1.showErrors (file:///Users/myuser/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1898:27491)\n at async NZ1 (file:///Users/myuser/.claude/local/node_modules/@anthrop
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗