feat(api): update usage APIs and documentation - #961
Conversation
Castiron-Internal-PR: openai/openai-java-internal#59 Castiron-Source-SHA: e5b37ac88e4d5eb49a0e9727c8fbb982dc069aa1 Castiron-Public-Base-SHA: aced76c
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. |
Castiron custom code✅ No new custom-code files detected. 53 mixed files remain; 0 existing customizations changed; 10 generated baselines changed. Compared
43 existing customizations unchanged
3 more in the full report. 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 33564085263 --repo openai/openai-java \
--name castiron-custom-code-33564085263-1 --dir /tmp/castiron-custom-code-33564085263-1
git apply --stat /tmp/castiron-custom-code-33564085263-1/custom-code.patch
cat /tmp/castiron-custom-code-33564085263-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin aced76c091413047b1dedf7c16d2f53f7c5bd196 775bd5cee894d9ae574f3d3ce453eaeaa93f9aa6
python3 scripts/castiron/custom_code_report.py report \
--base aced76c091413047b1dedf7c16d2f53f7c5bd196 \
--head 775bd5cee894d9ae574f3d3ce453eaeaa93f9aa6 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-775bd5cee894
cat /tmp/castiron-custom-code-775bd5cee894/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
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 775bd5cee894, 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 usage-model builders/serialization, immutable filter parameters and query encoding, admin authentication, and complete stable/beta reason conversion paths.
No substantive issues found. Static source review only.
Automated Release PR --- ## [4.56.0](openai/openai-java@v4.55.0...v4.56.0) (2026-09-02) ### Features * **api:** update usage APIs and documentation ([openai#961](openai#961)) ([517d37f](openai@517d37f)) ### Documentation * update OkHttp website links ([openai#957](openai#957)) ([fa040fd](openai@fa040fd)) --- 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