Skip to content

feat(api): add response tool usage models - #4201

Merged
jbeckwith-oai merged 1 commit into
mainfrom
castiron/promotions/pr-370
Oct 28, 2026
Merged

jbeckwith-oai merged 1 commit into
mainfrom
castiron/promotions/pr-370

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Summary

Adds optional hosted tool usage to stable and beta Responses, separately from model token usage.

Changes

  • Read image tool token totals and input/output details from response tool usage.
  • Read billable web-search request counts and optional cached image/text token details.
  • Existing response fields and omission behavior remain unchanged.

Castiron-Internal-PR: openai/openai-python-internal#370
Castiron-Source-SHA: a8e3aeb6d14653046c1b7dbcfcba3569140267b3
Castiron-Public-Base-SHA: 77fd116
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner October 28, 2026 17:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T17:56:14.561964Z 06fddc2 PR opened
🔒 Security Review ✅ Completed 2026-10-28T17:57:06.191293Z 06fddc2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. The stable and beta response models match the added schema: optional hosted tool usage, required image and web-search groups, and optional cache/output details. Existing response fields remain unchanged.

The nested models use the existing parser and keep absent fields out of explicitly set fields. Both response models remain below 1,000 lines. The generated-file inventory matches the changed models. These are cohesive output declarations; no new dispatch layer or structural regression was found.

The public diff matches the already reviewed internal candidate byte for byte. Reviewed all five changed files with an independent source review. No tests, builds or generation ran here. Hosted checks passed where completed; skipped checks and any remaining CI are separate validation limits.

Reviewed head: 06fddc2852e79b5730d03316dfe1df60e8d7bb04; base: 77fd116d2326bc828bb23d4fd7960142972293a4.

@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 55fc500 Oct 28, 2026
26 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the castiron/promotions/pr-370 branch October 28, 2026 18:10
@openai-sdks openai-sdks Bot mentioned this pull request Oct 28, 2026
gh-actions-shared Bot pushed a commit to xf-qubit/openai-python that referenced this pull request Oct 28, 2026
Automated Release PR
---


##
[3.41.0](openai/openai-python@v3.40.0...v3.41.0)
(2026-10-28)


### Features

* **api:** accept typed references in Realtime response inputs
([openai#4189](openai#4189))
([8ecb487](openai@8ecb487))
* **api:** add response tool usage models
([openai#4201](openai#4201))
([55fc500](openai@55fc500))
* **api:** filter agent sessions by metadata
([openai#4200](openai#4200))
([77fd116](openai@77fd116))
* **websocket:** recover queued binary frames after reconnect
([openai#4191](openai#4191))
([f079868](openai@f079868))


### Bug Fixes

* **examples:** detect incomplete WebSocket responses
([openai#4187](openai#4187))
([8559299](openai@8559299))
* **examples:** handle interruptions and disconnects in push-to-talk
([openai#4192](openai#4192))
([35fc9f3](openai@35fc9f3))
* keep consumer fixtures clean under strict Pyright
([openai#4204](openai#4204))
([5012565](openai@5012565))


### Chores

* **api:** document upcoming model shutdowns
([openai#4199](openai#4199))
([5b43cce](openai@5b43cce))
* **api:** update image-model documentation
([openai#4198](openai#4198))
([fa67521](openai@fa67521))
* enforce generated-file ownership
([openai#4193](openai#4193))
([1b37b9a](openai@1b37b9a))
* migrate development type checking to ty
([openai#4202](openai#4202))
([45b9531](openai@45b9531))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants