Skip to content
Back to feed

April 24, 2026 · Cerebras

Cerebras Inference validation errors now return HTTP 400 instead of 422

API requests that fail validation now return HTTP 400 Bad Request instead of 422 Unprocessable Entity, aligning the HTTP status code with standard behavior across major inference providers. This applies to all validation errors, including missing required fields, malformed request bodies, and unsupported parameters. The error response body schema is unchanged.

SDK impact

If you use the Cerebras or OpenAI Python or Node.js SDK, validation errors now raise BadRequestError instead of UnprocessableEntityError. Both SDKs map HTTP status codes to distinct exception classes.

| | Before | After | | - | - | - | | HTTP status code | 422 | 400 | | Python exception | UnprocessableEntityError | BadRequestError | | Node.js error name | UnprocessableEntityError | BadRequestError |

Action required

  • If your code handles UnprocessableEntityError by name or checks for status code 422, update to BadRequestError or 400.
  • If you use raw HTTP and branch on the status code, update 422 to 400.
  • No changes are needed if your error handling catches the base class (APIStatusError or APIError).

Latest Cerebras Inference changes

All Cerebras Inference changes