A 422 error means the request was understood by the server but could not be processed because one or more parameters are invalid, missing, or out of range.Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-kb-refresh.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Why this happens
- Unsupported parameter for the model: Some parameters (such as
frequency_penalty,logprobs, orresponse_format) are not supported by all models. Passing an unsupported parameter returns a 422. - Parameter value out of range: Values like
temperaturemust fall within a valid range (typically 0–2). Passing a value outside that range causes a 422. - Malformed messages array: The
messagesfield must be a list of objects withroleandcontentkeys. Missing or incorrectly typed fields return a 422. - Invalid
response_format: Requesting JSON mode (response_format: {"type": "json_object"}) with a model that does not support structured outputs causes a 422.
What you can do
-
Check the error message body
- The 422 response body contains a
detailfield that identifies which parameter is invalid and why. Read it before troubleshooting.
- The 422 response body contains a
-
Verify parameter support for your model
- Review the W&B Inference supported models list for the specific parameters and ranges each model accepts.
-
Validate your messages array
- Each message must have a
role(system,user, orassistant) and acontentstring. Tool call messages require additional fields—consult the API reference for the correct schema.
- Each message must have a
-
Remove unsupported parameters
- If you are adapting code from another provider, remove any parameters that are not in the W&B Inference API reference. Extra parameters that the model does not support will trigger a 422.
Authentication & Access