openai-python 3.40/3.41 and openai-node 7.45.1: breakpoint TTL semantics, tool_usage, and Realtime item references
openai-python v3.40.0/v3.41.0 and openai-node v7.45.1 (2026-10-27/28): breakpoint TTL wording, Response.tool_usage, Realtime item_reference, session metadata filters, WS binary-frame preservation, and the /v1/audio/translations deprecation.
openai-python v3.40.0 and v3.41.0, together with openai-node v7.45.1, shipped across 2026-10-27 and 10-28: the Python side settles the prompt-cache breakpoint TTL inheritance wording and lands four new surfaces — hosted-tool usage on the Responses object, typed item references for Realtime inputs, metadata filtering for agent session lists, and binary-frame preservation in the WebSocket reconnect queue; the Node side mirrors the TTL wording and widens the vertex provider's google-auth-library range. Every parameter name and enum value in this article comes from the two repositories' tag sources (verified 2026-10-31), not from release-notes titles.
1. Versions and registry status
| Package | Version | Release (UTC) | Registry (UTC) |
|---|---|---|---|
| openai-python | v3.40.0 | 2026-10-27 15:37 | PyPI 2026-10-27 15:38 |
| openai-python | v3.41.0 | 2026-10-28 22:26 | PyPI 2026-10-28 22:27 |
| openai-node | v7.45.1 | 2026-10-27 15:37 | npm 2026-10-27 15:49 |
openai-python v3.40.0 and openai-node v7.45.1 released in the same minute (the two repos run synchronized CI); what you can install from PyPI today is v3.41.0. On the Node side this line has a single point release — the v7.45.0 (10-26) feature surface (scheduled automations, gpt-6.1-terra, and siblings) already appears in the 2026-10-26 entry of OpenAI Models Release Notes (2026, Living Document) and is not repeated here.
2. Breakpoint TTL: the field on 10-26, the semantics on 10-27
This story has two steps, and either release notes page alone reads it wrong:
Step one (the field): the breakpoint-level ttl field first appeared in python v3.38.0 (2026-10-26) — PromptCacheBreakpoint gained ttl: Literal["30m", "12h"]; the same file in the immediately preceding v3.37.0 has no such field.
Step two (the semantics): #4188 in v3.40.0 carries the title add prompt cache breakpoint TTL options, but its only type-layer change is documentation wording: the breakpoint inherits the request TTL became when ttl is omitted, the breakpoint inherits the request's prompt_cache_options.ttl — inheritance happens only when the breakpoint does not set its own ttl. On the Node side, #3057 in v7.45.1 applied the same wording across four resource files: responses, beta responses, chat completions, and conversations.
The breakpoint parameter definition on the v3.41.0 tag (from src/openai/types/responses/response_input_text_param.py, quoted verbatim):
class PromptCacheBreakpoint(TypedDict, total=False):
"""Marks the exact end of a reusable prompt prefix.
When `ttl` is omitted, the breakpoint inherits the request's
`prompt_cache_options.ttl`; the boundary is not rounded to a token block.
"""
mode: Required[Literal["explicit"]]
"""The breakpoint mode. Always `explicit`."""
ttl: Literal["30m", "12h"]
"""The minimum lifetime of this cache breakpoint. Defaults to the request TTL."""
Note that the request level did not widen: PromptCacheOptions.ttl on the v3.41.0 tag is still Literal["30m"], docstring verbatim — the ttl defaults to 30m, which is currently the only supported value. In other words, 12h exists only as a breakpoint-level override: keep the request at 30m and write ttl: "12h" on individual critical breakpoints — that is the combination the current type layer allows.
3. Response.tool_usage: hosted-tool usage, accounted separately
#4201 in v3.41.0 adds tool_usage: Optional[ToolUsage] to the Responses response object (beta variant included). The docstring positions it precisely: usage reported by hosted tools, separate from base model usage — sitting next to, and not inside, the base model usage; the whole field is omitted when unavailable, and tool families with no recorded usage report zero.
The two tool-family structures (assembled from the tag type files):
{
"tool_usage": {
"image_gen": {
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0,
"cached_tokens": null,
"input_tokens_details": { "image_tokens": 0, "text_tokens": 0 },
"output_tokens_details": { "image_tokens": 0, "text_tokens": 0 },
"cached_tokens_details": { "cached_image_tokens": 0, "cached_text_tokens": 0 }
},
"web_search": { "num_requests": 0 }
}
}
Three semantic boundaries deserve quoting verbatim: image_gen sums available token counts across image generation calls, calls with missing or incomplete usage records may be skipped, and output details plus cached counts can be omitted — an omitted cache count means cache usage is unknown; web_search.num_requests counts billable searches — discounted searches and actions such as opening a page are excluded; and the closing sentence: use billing records to reconcile final charges.
For cost observation, this lets you read hosted-tool usage aggregates from a single response object instead of summing per-call records yourself — but the aggregation-gaps boundary means it fits observation, not billing, at least until reconciled against invoices.
4. Realtime: referencing existing session items with item_reference
#4189 adds typed references to Realtime response.create inputs. The new ResponseItemReferenceParam has exactly two fields: type: Literal["item_reference"] and id: Required[str] (the ID of an existing item in the same Realtime session). The type file's restriction is worth quoting verbatim: item references are only accepted in the response input array, not as new conversation items.
The WithReferences variant types input as Iterable[Union[ConversationItemParam, ResponseItemReferenceParam]] — regular items and references can interleave (example assembled from the tag type files):
event = {
"type": "response.create",
"response": {
"input": [
{"type": "item_reference", "id": "item_123"},
]
},
}
connection.send(event) # send() unions now accept the WithReferences variant (sync and async)
Accordingly, the send() method unions on both the sync and async WebSocket connections now also accept ResponseCreateEventWithReferencesParam — without that, reference-carrying events fail type checking.
5. Agent session lists: exact metadata filtering
#4200 adds a metadata filter to client.beta.agents.sessions.list (SessionListParams.metadata: Dict[str, str]). The docstring constraints, one by one: matching is exact string equality supplied as metadata[key]=value; all supplied pairs must match; up to 16 pairs; keys 1-64 characters and values up to 512 characters; new sessions and metadata updates may take time to appear in filtered results.
page = client.beta.agents.sessions.list(
metadata={"team": "platform"},
limit=50,
) # SyncCursorPage[AgentSession]; agent_id filter and after cursor also available
This is a filter, not a search: exact matching, all-pairs-must-match, no fuzzy queries — treating metadata as a full-text index will not produce the expected results. The eventual-consistency sentence also rules it out for create-then-immediately-query strong-consistency flows.
6. The WebSocket reconnect queue: binary frames no longer decoded
#4191 reworks how the reconnect send queue treats frame types. Before, outbound frames during a reconnection window were queued uniformly as strings — binary frames were force-decoded to UTF-8; now SendQueue keeps str | bytes as-is, so binary frames are enqueued verbatim and replayed verbatim after reconnection.
When the connection still ends up closed, the raised WebSocketConnectionClosedError has three behaviors worth knowing:
- A new unsent_frames property preserves text and binary frames in their original order;
- The existing unsent_messages property stays a text compatibility view: UTF-8-decodable binary becomes text, while undecodable opaque binary lives only in unsent_frames;
- Ordinary exception-attribute snapshots are redacted — the recovery data object's
__repr__prints<redacted WebSocket recovery data>, keeping binary content out of logs by default.
Real-time audio or binary-protocol bridge applications that previously rolled their own convert-bytes-to-strings-before-reconnect fallback can hand that job to the SDK's queue after this batch.
7. Deprecation annotations: the translations endpoint, model rows, and image docs
#4199, titled document upcoming model shutdowns, writes a set of existing shutdown facts into the SDK layer — one of them is a new endpoint-level deprecation:
The /v1/audio/translations endpoint is marked deprecated. The audio.translations.create method and its overloads in python v3.41.0 now carry typing_extensions.deprecated (the SDK's own tests were updated to expect DeprecationWarning). The docstring verbatim: this endpoint supports only whisper-1, the endpoint and model are deprecated and scheduled to shut down on February 26, 2027, and the migration target is /v1/realtime/translations, which requires a separate integration — the same day the transcription quartet shuts down, and OpenAI says outright that the Realtime-side integration is a separate project.
The ChatModel 2027-04-01 deprecation row grew to four values: the previous two (gpt-5.4-nano, gpt-5.1) are joined by the dated snapshots gpt-5.4-nano-2026-03-17 and gpt-5.1-2025-11-13; gpt-5.3-codex still does not appear in this annotation row — the deprecation page, verified 2026-10-31, still lists it in the 2027-04-01 section (replaced by gpt-6-sol), and the mismatch between the SDK annotation and the page is the current state.
Image-model docstrings refreshed (#4198): gpt-image-1 is removed from the GPT image models input-constraints list (consistent with its 2026-10-23 shutdown), chatgpt-image-latest moves to its own sentence — follows the same input constraints as GPT image models — and the quality parameter's low-only wording now names gpt-image-1.5 only.
The Node side's one other change is #3046: the vertex provider's google-auth-library peer range widened from >=9.15.1 <11 to >=9.15.1 <12 (verified by comparing v7.45.0 and v7.45.1 package.json) — projects on Google's auth library v11 are no longer blocked by the peer dependency.
8. Upgrade notes and common traps
- From v3.39.x to v3.41.0 is purely additive: all four features in this batch are new surfaces, and the only changes to existing signatures are additive union widenings (such as #4189's send() accepting the new variant); v3.40.0's type-layer change is documentation wording only.
- Do not write articles from release-notes titles: the actual diff behind add prompt cache breakpoint TTL options is a wording refresh — the two-step timeline in section 2 (field on 10-26, semantics on 10-27) follows the tag-source comparison.
- tool_usage gaps are normal: the aggregate may skip calls with incomplete usage records and cache counts can be omitted — fine for observation; for billing, follow the official line and reconcile against billing records.
- The translations migration has integration cost: the docstring says requires a separate integration — it is not an endpoint-string swap; schedule it as a new integration.
- Node users: if you need only the TTL wording and google-auth-library v11 compatibility, v7.45.1 suffices; the rest of this batch (tool_usage, item_reference, session metadata filters, the binary-frame queue) does not appear in node release notes as of v7.45.1.
9. Next steps
- For the previous SDK surface (prompt-created voices, Live audio fixtures, Decisions with prompt caching), see openai-python 3.32.0 and openai-node 7.35.0: prompt-created voices, Live audio fixtures, and Decisions in Live.
- For cache prewarming and explicit-breakpoint basics, see openai-python 3.15/3.16 and openai-node 7.18/7.19: Cache Prewarming, Webhook Management, connector_id Deprecation.
- For background on the agent session system this batch's filters live in, see Hosted agent environments surface in the OpenAI SDKs: prewarmed creation, idle suspension, expiration.
- For the vertex provider and google-auth-library integration details, see OpenAI models land on Google Cloud: the Responses API on Vertex AI and the SDK vertex() provider.
Key points
- Versions and registry status (verified 2026-10-31): openai-python v3.40.0 (release 2026-10-27 15:37 UTC) and v3.41.0 (release 2026-10-28 22:26 UTC, on PyPI at 22:27 UTC); openai-node v7.45.1 (release 2026-10-27 15:37 UTC, on npm at 15:49 UTC)
- Breakpoint TTL semantics in two steps: the breakpoint-level ttl field (Literal[30m, 12h], optional) first appeared in python v3.38.0 (2026-10-26; v3.37.0 lacks it); v3.40.0 #4188 (release-notes title: add prompt cache breakpoint TTL options) changed documentation wording at the type layer — the breakpoint inherits the request-level prompt_cache_options.ttl only when its own ttl is omitted; the request-level ttl remains Literal[30m] (docstring verbatim: currently the only supported value, checked on the v3.41.0 tag)
- Response.tool_usage (python v3.41.0 #4201, Responses and beta together): hosted-tool usage separate from base model usage, the whole field omitted when unavailable; image_gen aggregates input/output/total tokens with optional cache counts, calls with missing records may be skipped; web_search.num_requests counts billable searches only — discounted searches and actions such as opening a page are excluded, and the page says to reconcile final charges with billing records
- Realtime item references (#4189): ResponseItemReferenceParam has the type literal item_reference and a required id that must point at an existing item in the same Realtime session; page verbatim — accepted only in the response input array, not as new conversation items; new WithReferences parameter variants joined the sync/async WebSocket send() unions
- Two filters and one recovery: beta agents sessions list supports exact metadata[key]=value matching (all supplied pairs must match, up to 16 pairs, keys 1-64 characters, values up to 512 characters, new sessions may take time to appear, #4200); the WebSocket reconnect queue keeps str or bytes as-is, WebSocketConnectionClosedError gains unsent_frames preserving text and binary frames in order while unsent_messages stays a text compatibility view (#4191)
- Deprecation annotations (#4199): the /v1/audio/translations endpoint is marked deprecated in the SDK — supports only whisper-1, shutting down 2027-02-26, migrate to /v1/realtime/translations which the docstring says requires a separate integration; the ChatModel 2027-04-01 row grew to four values (adding the dated snapshots gpt-5.4-nano-2026-03-17 and gpt-5.1-2025-11-13, still no gpt-5.3-codex); node #3046 widened the vertex provider's google-auth-library peer range from <11 to <12
Frequently asked questions
Official references
Related articles
Decisions API goes GA: a fast, low-cost judgment endpoint, explained
The 2026-10-22 announcement makes the Decisions API generally available: POST /v1/decisions, gpt-6-luna only, uncached input at $0.10 per 1M tokens with free output, up to 400 questions per request. The beta first shipped 2026-10-06.
Read articleOpenAI SDKs Ship Four Releases in One Day: safety_identifier and Translation (v3.33-3.34, v7.36-7.37)
On 2026-10-17 openai-python shipped v3.33.0/v3.34.0 and openai-node shipped v7.36.0/v7.37.0: safety_identifier reached image requests and responses, Realtime Translation sessions landed, and node added GPT-4 alias shutdown notices.
Read articleopenai-python 3.32.0 and openai-node 7.35.0: prompt-created voices, Live audio fixtures, and Decisions in Live
Both official SDKs shipped on 2026-10-16: voices created from a text description (Live only), 30-second Live audio fixtures, Decisions transcript triggers, and prompt caching for the Decisions API - all from the CHANGELOGs and tag sources.
Read articleSubscribe to GPTMap Weekly
One email every Monday: curated OpenAI updates, deep dives, and best practices. No ads, unsubscribe anytime.
Submitting opens Buttondown in a new tab to confirm your subscription.