I’m getting HTTP 422 “Unprocessable Entity.” What does it mean?

Last updated: August 6, 2026

422 means the request reached us but something in it is invalid. Unlike some providers, we validate your request — including tool/function JSON schemas — rather than silently ignoring unsupported fields. The message in the response body tells you the cause; here are the common ones:

A. Tool schema issues

Message

Cause

Fix

'oneOf' with multiple schemas is not supported

A tool/function schema uses oneOf, often injected by an MCP server or agent framework.

Replace oneOf with anyOf in the tool schema.

Reference not found: #/…

A tool schema contains a JSON $ref whose definition wasn’t included — common when auto-generated from an OpenAPI spec.

Inline the referenced definitions so the schema is self-contained.

tool calling is not supported

The model doesn’t have tool calling enabled on that endpoint. LangChain’s bind_tools sends the same field and fails the same way.

Use a tool-capable model — check the “Supported Functionality” panel via GET /v1/models.

Function names should not be blank.

A tool object is missing its function sub-field, or the function object has no name.

Include at least a name field in the function object.

B. Field combination conflicts

Message

Cause

Fix

The 'response_format' field cannot be set when tools are specified

response_format and tools were sent together.

Remove response_format when using tools, or use them in separate requests.

The field 'min_tokens' is unsupported when tools are specified

min_tokens and tools were sent together.

Remove min_tokens when using tools.

C. Unknown fields — we reject unknown fields rather than silently ignoring them:

{"message":"invalid JSON payload: no such field: '<field_name>'"}

Common fields that trigger this: thinking, advanced, enable_thinking, extended_thinking. If you need to toggle reasoning on a model that supports it, use chat_template_kwargs: {"enable_thinking": true} instead.

reasoning_effort sent as a boolean (e.g., True) returns a different message: "expected number or string at reasoning_effort". Use a string value ("high", "medium", "low") or a number instead.

D. Malformed messages — sending messages as a plain string instead of an array of objects:

{"message":"invalid JSON payload: unexpected character: '\"'; expected '{' at messages"}

Sending the messages field to the /v1/completions endpoint (which expects prompt) returns "no such field: 'messages'". Chat requests should go to /v1/chat/completions.

E. Parameter range validation

Message

Cause

Fix

top_p should be in range between 0 (exclusive) and 1.0.

top_p set > 1.0

Set to a value in (0, 1.0]

max_tokens/max_completion_tokens must be greater than 0

max_tokens ≤ 0

Set to a positive integer

n should be <= 32.

n exceeds 32

Reduce to 32 or fewer

no valid input; 'messages' parameter is required.

messages is empty or missing

Provide at least one message object

F. top_logprobstop_logprobs is not supported on any current serverless model because all models have reasoning content parsing enabled:

{"message":"top_logprobs is not supported with reasoning content parsing."}

logprobs: true alone (without top_logprobs) is accepted.

G. Context length and KV-cache

Message

Cause

Fix

input is too long (received … tokens; max …)

Input exceeds the model’s context window. Context length = input + output combined.

Shorten the prompt or switch to a model with a larger context window.

not enough kv_cache_size to process this request; try with smaller max_tokens/n option or shorter prompt

Prompt + max_tokens × n exceeds available KV-cache capacity at request time, often under load.

Reduce max_tokens/n, or shorten the prompt, and retry.