OpenAI SDK error classes: 408 and 413 fall to generic APIStatusError (Python) / APIError (JS); 529 is InternalServerError
Tested on Windows 11, Python 3.12.10, Node 24.18 against a local mock HTTP server on 127.0.0.1 with fake key test-key; installed versions were pip anthropic 2.8.0, pip openai 3.51.0, npm @anthropic-ai/sdk 1.8.0, npm openai 7.57.0 (all latest on 2026-11-14). OpenAI Python 3.51.0 and JS 7.57.0 map 400 BadRequestError, 401 AuthenticationError, 403 PermissionDeniedError, 404 NotFoundError, 409 ConflictError, 422 UnprocessableEntityError, 429 RateLimitError, 500 and 529 InternalServerError. 408 and 413 have no dedicated class: Python raises base APIStatusError (MRO APIError, OpenAIError), JS raises APIError, both still with status 408/413. Unlike Anthropic, OpenAI e.body is the inner error object ({message,type,param,code}), and e.code, e.param, e.type are populated from it (mock_code, p, mock_type). e.request_id comes from the x-request-id header. str(e): Python 'Error code: 400 - msg 400' (message only); JS message '400 msg 400'. Anthropic Python str is 'Error code: 400 - ' plus the dict repr; JS message is '400 ' plus the JSON.