v2.31.0

openai-python Releases / 4/9/2026

📰 NewsDeveloper Stack & InfrastructureSignals & Early TrendsTools & Practical Usage

Key Points

  • openai-python v2.31.0 adds an optional `phase` field to conversation messages and extends response typing to include `web_search_call.results` in `ResponseIncludable`.
  • The client library now supports short-lived tokens and can send raw data over WebSockets, enabling more flexible and time-bounded auth and streaming/data transport.
  • Internal serialization logic was updated to support an `indices` array format for query and form encoding.
  • Bug fixes include preserving hardcoded query parameters when merging with user parameters, along with corresponding type adjustments for `web_search_call.results`.
  • Documentation and test dependencies were updated (vector store file parameter descriptions and `steady` test library bumps).

2.31.0 (2026-04-08)

Full Changelog: v2.30.0...v2.31.0

Features

  • api: add phase field to conversations message (3e5834e)
  • api: add web_search_call.results to ResponseIncludable type (ffd8741)
  • client: add support for short-lived tokens (#1608) (22fe722)
  • client: support sending raw data over websockets (f1bc52e)
  • internal: implement indices array format for query and form serialization (49194cf)

Bug Fixes

  • client: preserve hardcoded query params when merging with user params (92e109c)
  • types: remove web_search_call.results from ResponseIncludable (d3cc401)

Chores

  • tests: bump steady to v0.20.1 (d60e2ee)
  • tests: bump steady to v0.20.2 (6508d47)

Documentation

  • api: update file parameter descriptions in vector_stores files and file_batches (a9e7ebd)