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

Last verified 2026-10-10 against 7.32.0. Page updated . Also as Markdown and JSON.

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

Python SDK:

pip install -U openai
python3 -c "import openai; print(openai.__version__)"   # 3.28.0

Verify Node.js runtime version (v7 requirement):

node --version   # >=22.0.0 required since v7.0.0

Stay on v6.x maintenance line (Node 18 / 20):

npm i openai@^6.49.0

OpenAI SDK key facts

What changed in the last 5 OpenAI SDK releases?

OpenAI SDK 7.32.0 (2026-10-09 20:41 UTC)

  • Add agent environment suspension and expiration events and webhooks (agent.session.environment.suspended, agent.session.environment.expired). (source)
  • Preserve detailed token usage (prompt_tokens_details, completion_tokens_details) in runner totalUsage(). (source)

OpenAI SDK 7.31.0 (2026-10-09 04:03 UTC)

  • Add prewarmed hosted environments via client.beta.agents.environments and 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.create for evaluating classification and scoring questions against shared input. (source)

OpenAI SDK 7.29.0 (2026-10-06 18:50 UTC)

  • Support tool search in typed function helpers via defer_loading: true in zodResponsesFunction. (source)
  • Observe local tool failures and propagate error details during agent turn execution. (source)
  • Run local tools during session creation streams. (source)

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 tightened EnvironmentParam so passing environment_id prohibits inline configuration.
  • 7.32.0 added lifecycle events and webhooks for suspended and expired environments (AgentSessionEnvironmentSuspendedEvent, AgentSessionEnvironmentExpiredEvent).
  • 7.30.1 dropped VoiceCreateParams.Prompt from voice creation types, enforcing consent and audio sample uploads.
  • 7.32.0 runner totalUsage() preserves nested prompt_tokens_details and completion_tokens_details instead 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 Decisions
  • openai DecisionCreateParams
  • openai DecisionInputImage
  • openai DecisionInputMessage
  • openai DecisionInputPart
  • openai DecisionInputText
  • openai Audio.Voices
  • openai Audio.VoiceCreateParams
CommandFlags addedFlags removed
openai clientdecisionsnone
openai audiovoicesnone
openai beta.agents.sessionstracesartifactsnone
openai helpers/zod zodResponsesFunctiondefer_loadingnone
openai chat.completions image_urldetail: '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 export OpenAI.Decisions.
  • 7.28.0 added client.audio.voices for 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?: boolean to zodResponsesFunction options 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?

VersionChangeMigration
7.0.0Node 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.0Python 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-23OpenAI 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)

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)

  • 7.23.0 (2026-09-23): GCP external storage support, GPT-Rosalind research model. (source)
  • 7.22.0 (2026-09-22): GPT-6 Sol and Luna model identifiers. (source)
  • 7.21.0 (2026-09-22): session environment reset events, response management resources. (source)

2026-08: Node 7.4.0 to 7.8.0; Python 3.0.0 to 3.6.0 (5 versions)

  • Python 3.0.0 (2026-08-12): major Python release migrating to HTTPX2 by default. (source)
  • Node 7.7.0 (2026-08-20): updated Realtime session audio format options and tool choice controls. (source)

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)

  • Node 7.0.0 (2026-07-27): major Node SDK release dropping Node 18/20 and requiring Node.js 22 LTS or later. (source)
  • Node 6.49.0 (2026-07-25): final stable release on the v6.x maintenance line. (source)

2026-06: Node 6.40.0 to 6.45.0; Python 2.42.0 to 2.47.0 (6 versions)

  • Node 6.45.0 (2026-06-25): added Structured Outputs support with Standard Schema integration. (source)
  • Node 6.42.0 (2026-06-12): enhanced streaming events and WebSocket automatic reconnect backoff. (source)

2026-05: Node 6.36.0 to 6.39.1; Python 2.37.0 to 2.41.0 (5 versions)

  • Node 6.39.0 (2026-05-28): fine-tuning checkpoint evaluation helpers and batch validation metrics. (source)
  • Node 6.37.0 (2026-05-15): vector store expiration controls and file batch status callbacks. (source)

Sources

Last verified: 2026-10-10.