> ## 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.

# Temperature parameter included in GPT-5 prompts from SDK

> [!NOTE]
>
> **Applies to:**
>
> * Plan - Any
> * Deployment - Any
> *
> * Use case - SDK prompt fetching with GPT-5 models when passing parameters directly to OpenAI API

## Summary

**Issue:** When using the Braintrust SDK to fetch a prompt configured for a GPT-5 model, the returned parameters include a `temperature` value that OpenAI rejects, causing errors when you pass the parameters directly to OpenAI's API.

**Cause:** Whether a GPT-5 model accepts `temperature` depends on the reasoning effort. GPT-5.1 and later accept `temperature` only when reasoning effort is set to `none`. At any higher reasoning effort, and for older GPT-5 models (`gpt-5`, `gpt-5-mini`, `gpt-5-nano`) and GPT-5 Pro, OpenAI rejects `temperature`. Braintrust removes `temperature` from a prompt's stored parameters when the selected model and reasoning effort don't support it, but a prompt saved before this behavior can still carry a `temperature` value that OpenAI rejects.

**Resolution:** Re-save the prompt in the Braintrust prompt editor so its stored parameters are sanitized for the selected model and reasoning effort. If you build requests to OpenAI directly, remove `temperature` from the fetched parameters when the model doesn't support it.

## Resolution steps

### Option 1: Re-save the prompt (recommended)

#### Step 1: Open and save the prompt in the editor

Open the prompt in the Braintrust prompt editor and save it. Saving sanitizes the stored parameters for the selected model and reasoning effort, removing `temperature` when the model doesn't accept it. The SDK then returns parameters that OpenAI accepts.

### Option 2: Filter the parameter before calling OpenAI

#### Step 1: Remove temperature from the fetched parameters

If you call OpenAI directly with a prompt that still includes an unsupported `temperature`, remove it from the fetched parameters before making the request. As a rule, keep `temperature` for GPT-5.1 and later only when `reasoning_effort` is `none`, and remove it for older GPT-5 models and GPT-5 Pro. See [GPT-5 prompts include unsupported temperature](https://docs.braintrust.dev/sdks/typescript/troubleshooting.md#gpt-5-prompts-include-unsupported-temperature) for a TypeScript example.


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