> ## Documentation Index
> Fetch the complete documentation index at: https://docs.braintrust.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Sonnet 5.5 sampling parameter errors

> Avoid HTTP 400 errors when using Claude Sonnet 5.5 by removing sampling parameters such as temperature, top_p, and top_k from your requests.

> [!NOTE]
>
> **Applies to:**
>
> * Plan - Any
> * Deployment - Any
> *
> * Omit sampling parameters when using Claude Sonnet 5.5 to avoid 400 errors in both the UI and application code

## Summary

Claude Sonnet 5.5 requests can fail with HTTP 400 when sampling parameters are sent. Remove `temperature`, `top_p`, and `top_k` from your playground prompt or application request.

## What is happening

Claude Sonnet 5.5 does not support custom sampling values. Saved prompt settings, application code, or framework defaults can add these parameters to a request.

The validation rules depend on the Claude API version:

* With API version `2023-06-01`, non-default sampling values return HTTP 400 on Claude Sonnet 5.5.
* With API version `2026-10-21`, sending any of these parameters returns HTTP 400 on every model, even at the parameter's default value.

Omit all three parameters instead of replacing them with numeric defaults. Setting `temperature` to `0` still sends the parameter.

## Fix

### In a Braintrust playground

1. Open the failing prompt and select the affected Claude model.
2. Open **Model parameters**.
3. For each configured **Temperature**, **Top p**, or **Top k** setting, click the  beside its value to remove it.
4. Run the prompt again.

If a parameter is already absent, leave it unset.

### In application code

Remove `temperature`, `top_p`, and `top_k` from the parameters passed to your model client.

For Braintrust prompt definitions, remove these keys from `params`. For direct Anthropic Messages API requests, remove them from the top level of the request body.

Check framework defaults and gateway overrides if the error persists. These settings can add sampling parameters after you remove them from your application code.

For direct Anthropic Messages API requests, set `model` to `claude-sonnet-5-5`. If you use another provider, use its corresponding identifier from [Anthropic's model comparison](https://platform.claude.com/docs/en/models/overview#latest-models).

## How to confirm it worked

* Retry the same prompt and confirm that the sampling parameter error no longer appears.
* For application requests, inspect the outgoing request body and confirm that `temperature`, `top_p`, and `top_k` are absent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.