Skip to content

HTTP 400 Bad Request in Claude Code API Call #3549

@kommadot

Description

@kommadot

Bug Description
400 error

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 1.0.51
  • Feedback ID: 27071de8-b2ef-4271-a795-5513badf7a26

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 eD (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:712:4489)\n    at file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:13989\n    at Q (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:14406)\n    at QF (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:13129)\n    at cC (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:11995)\n    at qB (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:16609)","timestamp":"2025-07-15T12:31:46.223Z"},{"error":"Error: Command failed: security delete-generic-password -a $USER -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 eD (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:712:4489)\n    at RlA (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:15101)\n    at MlA (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:14975)\n    at WQA (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2134:2567)\n    at w21.startOAuthFlow (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2134:3733)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-15T12:32:11.252Z"},{"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 eD (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:712:4489)\n    at file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:13989\n    at Q (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:14406)\n    at QF (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:13129)\n    at cC (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:11995)\n    at qB (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:624:16609)","timestamp":"2025-07-15T12:32:11.465Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.84: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01UKxg45kCnpK3zszmhfPmB6. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at Z6.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:12578)\n    at iq.makeStatusError (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1332:2100)\n    at iq.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1332:5311)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async tA1.showErrors (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1706:23178)\n    at async tA1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1706:12720)\n    at async oO2 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1706:23029)\n    at async file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1706:18138\n    at async c0A (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1706:5121)\n    at async Tc (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1706:18108)","timestamp":"2025-07-15T13:27:48.819Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.84: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01UKxg45kCnpK3zszmhfPmB6. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at Z6.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:12578)\n    at iq.makeStatusError (file:///usr/local/lib/nod

Note: Error logs were truncated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions