Tool pages / OpenAI SDK
OpenAI SDK 7.32.0 and 3.28.0: latest versions, API diff and gotchas
Latest: OpenAI SDK 7.32.0, released (release notes).
The latest OpenAI SDK is 7.32.0 for Node.js (openai on npm) and 3.28.0 for Python (openai on PyPI), both released on 2026-10-09 (Node published 20:41 UTC, Python 20:49 UTC); upgrade with npm i openai@latest or pip install -U openai. Release 7.32.0 introduces agent environment suspension and expiration events (agent.session.environment.suspended and agent.session.environment.expired) plus detailed token usage aggregation in runners, 7.31.0 adds prewarmed hosted environments (client.beta.agents.environments.create), 7.30.1 restricts custom voices to consent recordings and audio samples, and 7.30.0 adds standalone Decisions (client.decisions.create). Node SDK v7 requires Node.js 22 LTS or later (dropped Node 18 and 20), while Python SDK v3 migrated to HTTPX2 by default. Legacy snapshot models shut down on 2026-10-23.
How do I install or upgrade to OpenAI SDK 7.32.0?
Node.js / TypeScript SDK (Node 22 or later):
npm i openai@latest
npm ls openai # openai@7.32.0Python SDK:
pip install -U openai
python3 -c "import openai; print(openai.__version__)" # 3.28.0Verify Node.js runtime version (v7 requirement):
node --version # >=22.0.0 required since v7.0.0Stay on v6.x maintenance line (Node 18 / 20):
npm i openai@^6.49.0OpenAI SDK key facts
- Dual ecosystem: OpenAI maintains both the Node.js/TypeScript SDK (
openaion npm, repoopenai/openai-node) and Python SDK (openaion PyPI, repoopenai/openai-python). Both share API feature parity and Stainless OpenAPI code generation. - Latest releases: Node SDK 7.32.0 (GitHub tag
v7.32.02026-10-09 20:41 UTC, npm 21:16 UTC) and Python SDK 3.28.0 (GitHub tagv3.28.02026-10-09 20:49 UTC, PyPI 20:50 UTC). Both shipped agent environment suspension and expiration support on the same day. - Eight Node releases in October 2026: 7.26.0 (2026-10-01 21:01 UTC), 7.27.0 (2026-10-01 23:01 UTC), 7.28.0 (2026-10-04 18:22 UTC), 7.29.0 (2026-10-06 18:50 UTC), 7.30.0 (2026-10-06 21:50 UTC), 7.30.1 (2026-10-08 08:51 UTC), 7.31.0 (2026-10-09 04:03 UTC), and 7.32.0 (2026-10-09 20:41 UTC).
- Weekly download demand: 50,858,207 weekly downloads on npm for
openaiand 73,895,792 weekly downloads on PyPI (measured 2026-09-28 to 2026-10-04), totaling over 124 million weekly package downloads across both ecosystems. - Runtime requirements: Node SDK v7.0.0 (released 2026-07-27 21:56 UTC) enforces
engines.node >=22.0.0; Node 18 and Node 20 are no longer supported. Python SDK v3.0.0 (released 2026-08-12 01:54 UTC) migrated to HTTPX2 by default and stopped installing legacyhttpx. - Model deprecation deadline: 2026-10-23 is the announced shutdown date for legacy model IDs including
gpt-4o-2024-05-13,gpt-4-1106-preview,gpt-4-0613,gpt-3.5-turbo-0125,o1-2024-12-17,o3-mini-2025-01-31, ando4-mini-2025-04-16;gpt-4-turbo-2024-04-09is listed as a replacement forgpt-4-turbo, not as a shutdown ID. - Beta Agents hosted environments: 7.31.0 and 7.32.0 added prewarmed environment creation and listing (
client.beta.agents.environments), session attachment by environment ID (EnvironmentParamPrewarmed), and snapshot suspension and expiration events (agent.session.environment.suspended,agent.session.environment.expired).
What changed in the last 5 OpenAI SDK releases?
OpenAI SDK 7.32.0 (2026-10-09 20:41 UTC)
OpenAI SDK 7.31.0 (2026-10-09 04:03 UTC)
- Add prewarmed hosted environments via
client.beta.agents.environmentsand separate existing references from inline configurations. (source)
OpenAI SDK 7.30.1 (2026-10-08 08:51 UTC)
- Correct custom voice creation parameters to require consent recordings and audio samples, dropping prompt-based creation. (source)
- Parse structured text only in final message phases, leaving non-final commentary unparsed. (source)
- Safely decode valid UTF-8 percent escapes in URL filename inference. (source)
OpenAI SDK 7.30.0 (2026-10-06 21:50 UTC)
- Add standalone Decisions support via
client.decisions.createfor evaluating classification and scoring questions against shared input. (source)
OpenAI SDK 7.29.0 (2026-10-06 18:50 UTC)
Which OpenAI SDK commands and flags were added or removed?
OpenAI SDK 7.30.0 → 7.32.0
0 exports added, 0 removed, 0 exports with public members added or removed; 12 declarations changed in any way.
Method: bin/tool-snapshot installed both versions in a throwaway Linux sandbox and listed every export of every package entry point from the type declarations with the TypeScript compiler API (921 and 921 exported symbols), then bin/tool-diff compared them. In the tables, "command" is an exported symbol and "flags" are its public members (function parameters in parentheses).
- Sandbox diff from 7.30.0 to 7.32.0. Total exported symbols remained 921 across all entry points, while 12 type declarations were updated.
- 7.31.0 added prewarmed hosted environment management (
client.beta.agents.environments.create,.retrieve,.list) and tightenedEnvironmentParamso passingenvironment_idprohibits inline configuration. - 7.32.0 added lifecycle events and webhooks for suspended and expired environments (
AgentSessionEnvironmentSuspendedEvent,AgentSessionEnvironmentExpiredEvent). - 7.30.1 dropped
VoiceCreateParams.Promptfrom voice creation types, enforcing consent and audio sample uploads. - 7.32.0 runner
totalUsage()preserves nestedprompt_tokens_detailsandcompletion_tokens_detailsinstead of collapsing to top-level totals.
OpenAI SDK 7.25.0 → 7.30.0
8 exports added, 0 removed, 5 namespaces with public members or options added; 154 repository files changed across the October 2026 release cycle.
Method: Built from source (not run): compared GitHub tags v7.25.0 to v7.30.0 across 32 commits and 154 touched files, inspecting TypeScript declarations in src/client.ts, src/resources/decisions.ts, src/resources/audio/voices.ts, src/resources/beta/agents/sessions/traces.ts, src/helpers/zod.ts, and src/resources/shared.ts. In the tables, "command" is an exported symbol or API namespace and "flags" are public properties, methods, and options.
Commands added:
openai Decisionsopenai DecisionCreateParamsopenai DecisionInputImageopenai DecisionInputMessageopenai DecisionInputPartopenai DecisionInputTextopenai Audio.Voicesopenai Audio.VoiceCreateParams
| Command | Flags added | Flags removed |
|---|---|---|
openai client | decisions | none |
openai audio | voices | none |
openai beta.agents.sessions | tracesartifacts | none |
openai helpers/zod zodResponsesFunction | defer_loading | none |
openai chat.completions image_url | detail: 'original' | none |
- Source diff from v7.25.0 (2026-09-29) to v7.30.0 (2026-10-06). 7.30.0 added the Decisions client namespace (
client.decisions) and top-level exportOpenAI.Decisions. - 7.28.0 added
client.audio.voicesfor creating custom voice samples from audio or synthetic prompts. - 7.26.0 and 7.27.0 added beta agent trace exploration (
traces.list) returning OTLP spans and artifact handling (artifacts.download). - 7.29.0 added
defer_loading?: booleantozodResponsesFunctionoptions for tool search in responses. - Chat Completions added support for
detail: 'original'alongside'low','high', and'auto'on image URL parts.
What breaks when upgrading OpenAI SDK, and how do I migrate?
| Version | Change | Migration |
|---|---|---|
| 7.0.0 | Node SDK v7 dropped support for Node.js 18 and 20, requiring node >= 22.0.0 in package.json engines. | Upgrade your runtime environment to Node.js 22 LTS or later. If pinned to Node 18 or 20, stay on openai@^6.49.0. |
| 3.0.0 | Python SDK v3 migrated to HTTPX2 by default. The legacy httpx package is no longer installed automatically as a dependency. | Update custom HTTP client transports or configuration to HTTPX2 equivalents, or install httpx separately if using the legacy escape hatch. Follow the HTTPX2 migration guide. |
| 2026-10-23 | OpenAI lists legacy model IDs including gpt-4o-2024-05-13, gpt-4-1106-preview, gpt-4-0613, gpt-3.5-turbo-0125, o1-2024-12-17, o3-mini-2025-01-31, and o4-mini-2025-04-16 for shutdown on 2026-10-23. | Use the replacement shown for each model in OpenAI's deprecations table, and test the replacement before the shutdown date. |
What OpenAI SDK errors did we reproduce, and how do I fix them?
Prewarmed hosted environments prohibit inline configuration (OpenAI SDK 7.31.0)
import OpenAI from "openai";
import type { EnvironmentParam } from "openai/resources/beta/agents/agents";
// In 7.32.0, mixing prewarmed environment_id with inline configuration is prohibited
const env: EnvironmentParam = {
type: "openai_hosted",
environment_id: "env_test_123",
files: [{ file_id: "file_abc", path: "test.txt", type: "file_id" }],
};test-env-mixed.ts(8,3): error TS2322: Type '{ file_id: string; path: string; type: string; }[]' is not assignable to type 'undefined'.Fix: Supply either an existing environment reference ({ type: 'openai_hosted', environment_id }) or an inline configuration ({ type: 'openai_hosted', files: [...] }), not both. EnvironmentParamPrewarmed sets files?: never and environment_template_id?: never. (source)
Custom voice creation requires consent audio samples; prompt voices removed from SDK types (OpenAI SDK 7.30.1)
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "test" });
async function main() {
await client.audio.voices.create({
type: "prompt",
name: "narrator",
prompt: "calm voice",
});
}test-voice.ts(5,5): error TS2322: Type '"prompt"' is not assignable to type '"audio_sample"'.Fix: Create custom voices using audio_sample and consent recording IDs. Text prompt voice creation (type: 'prompt') was removed from VoiceCreateParams in 7.30.1. (source)
Passing transport options in the query argument of `traces.list` throws TypeError (OpenAI SDK 7.26.0)
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "mock-key" });
await client.beta.agents.sessions.traces.list("session_123", {
limit: 10,
timeout: 5000,
});TypeError: Query parameters and request options must be passed as separate arguments.Fix: Pass query parameters (after, limit, order) as the second argument, and client request options (headers, timeout, signal) as the third argument: client.beta.agents.sessions.traces.list(sessionID, { limit: 10 }, { timeout: 5000 }). (source)
Missing credentials throws during client initialization (OpenAI SDK 7.0.0)
import OpenAI from "openai";
delete process.env.OPENAI_API_KEY;
const client = new OpenAI();Error: Missing credentials. Please pass an `apiKey`, `workloadIdentity`, `adminAPIKey`, or set the `OPENAI_API_KEY` or `OPENAI_ADMIN_KEY` environment variable.Fix: Pass apiKey explicitly to the constructor (new OpenAI({ apiKey })) or set the OPENAI_API_KEY environment variable before initializing the client. (source)
Beta agents environments API returns 401 without actor biscuit (OpenAI SDK 7.31.0)
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "mock-api-key" });
await client.beta.agents.environments.retrieve("env_123");Error: 401 A valid actor biscuit is required.Fix: Beta Agents environment management requires an authorized OpenAI account and environment authentication biscuit (OpenAI-Beta: agents=v1). Ensure credentials and feature access are provisioned. (source)
OpenAI SDK release history by month
2026-10: Node 7.26.0 to 7.32.0; Python 3.23.0 to 3.28.0 (8 versions to 2026-10-10)
- 7.32.0 and 3.28.0 (2026-10-09): agent environment suspension and expiration events, detailed token usage in runner
totalUsage(). (source) - 7.31.0 and 3.27.0 (2026-10-09): prewarmed hosted environments (
client.beta.agents.environments). (source) - 7.30.1 and 3.26.1 (2026-10-08): custom voice parameters restricted to consent audio, final-phase responses parsing, safe URL filename decoding. (source)
- 7.30.0 and 3.26.0 (2026-10-06): standalone Decisions API (
client.decisions.create). (source) - 7.29.0 (2026-10-06): tool search support in typed functions (
defer_loading: true). (source) - 7.28.0 (2026-10-04): custom voice creation (
client.audio.voices.create). (source) - 7.26.0 and 7.27.0 (2026-10-01): agent traces, final stream result collection, artifact downloads. (source)
2026-09: Node 7.9.0 to 7.25.0; Python 3.7.0 to 3.22.1 (18 versions)
2026-08: Node 7.4.0 to 7.8.0; Python 3.0.0 to 3.6.0 (5 versions)
2026-07: Node 6.46.0 to 7.3.0 (major 7.0.0 on 2026-07-27); Python 2.48.0 to 2.53.0 (8 versions)
2026-06: Node 6.40.0 to 6.45.0; Python 2.42.0 to 2.47.0 (6 versions)
2026-05: Node 6.36.0 to 6.39.1; Python 2.37.0 to 2.41.0 (5 versions)
Sources
- openai/openai-node releases (GitHub API, page 1) (read 2026-10-10)
- openai/openai-node v7.32.0 release notes (read 2026-10-10)
- openai/openai-node v7.31.0 release notes (read 2026-10-10)
- openai/openai-node v7.30.1 release notes (read 2026-10-10)
- openai/openai-node v7.30.0 release notes (read 2026-10-10)
- openai/openai-node v7.29.0 release notes (read 2026-10-10)
- openai/openai-node compare v7.30.0...v7.32.0 (read 2026-10-10)
- openai/openai-python releases (GitHub API) (read 2026-10-10)
- openai/openai-python v3.28.0 release notes (read 2026-10-10)
- openai/openai-python v3.27.0 release notes (read 2026-10-10)
- openai/openai-python v3.26.1 release notes (read 2026-10-10)
- openai/openai-python v3.26.0 release notes (read 2026-10-10)
- openai/openai-python v3.0.0 release notes (read 2026-10-10)
- npm registry: openai package manifest and publish times (read 2026-10-10)
- PyPI package: openai JSON API (read 2026-10-10)
- npm weekly downloads: openai (read 2026-10-10)
- PyPI recent downloads: openai (read 2026-10-10)
- OpenAI API Deprecations guide (read 2026-10-10)
- openai-node source: src/resources/beta/agents/environments/environments.ts at v7.32.0 (read 2026-10-10)
- openai-node source: src/resources/beta/agents/agents.ts at v7.32.0 (read 2026-10-10)
- openai-node source: src/resources/audio/voices.ts at v7.32.0 (read 2026-10-10)
- openai-node source: src/lib/AbstractChatCompletionRunner.ts at v7.32.0 (read 2026-10-10)
- openai-node source: src/lib/ResponsesParser.ts at v7.32.0 (read 2026-10-10)
- openai-node source: src/internal/uploads.ts at v7.32.0 (read 2026-10-10)
- openai-node source: src/resources/beta/agents/sessions/traces.ts at v7.32.0 (read 2026-10-10)
- openai-node source: src/resources/shared.ts at v7.32.0 (read 2026-10-10)
Last verified: 2026-10-10.