feat(api): update usage APIs and documentation - #3779
Conversation
Castiron-Internal-PR: openai/openai-python-internal#74 Castiron-Source-SHA: 32e4345bf0fe2dd35455774de84b8d07d1e6879e Castiron-Public-Base-SHA: b19c216
Castiron custom code✅ No new custom-code files detected. 34 mixed files remain; 0 existing customizations changed; 4 generated baselines changed. Compared
30 existing customizations unchanged
A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 33572010822 --repo openai/openai-python \
--name castiron-custom-code-33572010822-1 --dir /tmp/castiron-custom-code-33572010822-1
git apply --stat /tmp/castiron-custom-code-33572010822-1/custom-code.patch
cat /tmp/castiron-custom-code-33572010822-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin b19c2161b1eac80fbf1f6f67a64a50af99c53356 93586687533ffc588f84235d57594f1e494c2f90
python3 scripts/castiron/custom_code_report.py report \
--base b19c2161b1eac80fbf1f6f67a64a50af99c53356 \
--head 93586687533ffc588f84235d57594f1e494c2f90 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-93586687533f
cat /tmp/castiron-custom-code-93586687533f/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d504a9def
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Blocking scope issue: the stated outcome is limited to removing the unlaunched compute_units usage fields, but this exact diff also promotes unrelated schema and public-surface changes—for example, a new organization-cost line_items filter, a new max_messages incomplete-reason value, and broad model/example/documentation updates. Those changes are not narrowly necessary for the field removal and make the patch carry behavior/API surface that the PR does not describe. Please regenerate from a baseline/config containing only the compute_units removal, or split and explicitly document/approve the broader promotion. I understand the compatibility/breaking-change checks triggered by the intentional field removal; that expected break is not this finding.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Thanks for broadening the description. One public-surface change is still missing from the stated scope: this diff adds max_messages to the Responses/Beta Responses incomplete-reason enum/type in addition to the usage and documentation changes. That is a generated public API change, not merely a documentation refresh. Please explicitly include it in the description (or remove it) so the reviewed scope matches the exact diff.
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Reviewed the complete diff at 93586687533f, including the intentional removal of the unlaunched compute_units field, optional organization-cost line_items filtering, stable/beta max_messages reason support, and schema/documentation updates. Checked sync/async filter propagation and query encoding, admin authentication, remaining usage contracts, and stable/beta response-model consumers.
No substantive issues found. Static source review only.
Automated Release PR --- ## [3.7.0](openai/openai-python@v3.6.0...v3.7.0) (2026-09-02) ### Features * **api:** update usage APIs and documentation ([openai#3779](openai#3779)) ([6f0da16](openai@6f0da16)) ### Bug Fixes * avoid repeated numpy checks for embeddings ([openai#3757](openai#3757)) ([b19c216](openai@b19c216)) --- 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>
Summary
Updates organization usage filtering, Responses and Chat Completions usage types, and API documentation.
Changes
line_itemsfiltering to organization cost usage requests, allowing results to be limited to exact cost line-item namescompute_unitsfield from Responses and Chat Completions usage types