openai / openai/openai-python

Allow setting reasoning effort via environment variable

Open
#2,686 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
31.6k
Forks
5.7k
Avg merge
1d 6h
Merged PRs (30d)
96

Description

Confirm this is a feature request for the Python library and not the underlying OpenAI API.
  • This is a feature request for the Python library
Describe the feature or improvement you're requesting

Problem
If you don’t want the default medium reasoning effort, you currently have to pass reasoning={"effort": ...} on every request or build a wrapper, there’s no simple, per-environment way to set a different default.

Proposal

  • Support an env var OPENAI_REASONING_EFFORT with values: minimal, low, medium, high.
  • Precedence: per-request param > env var > SDK default.

Example

export OPENAI_REASONING_EFFORT=low
from openai import OpenAI
client = OpenAI()
resp = client.responses.create(model="gpt-5", input=[{"role":"user","content":"Hi"}])
# uses "low" unless explicitly overridden

Notes

  • Invalid values: warn once and ignore.
  • No breaking changes; opt-in only.
  • Helps reduce boilerplate and enables ops-friendly config.
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the OpenAI client and the responses.create entry point, then trace how reasoning options are resolved before requests are sent. Check existing environment-variable handling and related tests; done means per-request values override OPENAI_REASONING_EFFORT, valid environment values override the SDK default, and invalid values are warned about once and ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.