feat(api): add compute_units to Responses and Chat Completions usage - #142
Conversation
Castiron-Internal-PR: openai/openai-cli-internal#46 Castiron-Source-SHA: 04f92df602fd4bed4d173f40a70cddfb928fc1b8 Castiron-Public-Base-SHA: 0cb94ba
Castiron custom code✅ No new custom-code files detected. 5 mixed files remain; 0 existing customizations changed. Compared 5 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 33094237411 --repo openai/openai-cli \
--name castiron-custom-code-33094237411-1 --dir /tmp/castiron-custom-code-33094237411-1
git apply --stat /tmp/castiron-custom-code-33094237411-1/custom-code.patch
cat /tmp/castiron-custom-code-33094237411-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 0cb94baec8f39fa26ad2bbf815c4b0aabded2213 d6e48a06cdf7aee6a556758050303d04bdaa80fa
python3 scripts/castiron/custom_code_report.py report \
--base 0cb94baec8f39fa26ad2bbf815c4b0aabded2213 \
--head d6e48a06cdf7aee6a556758050303d04bdaa80fa --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-d6e48a06cdf7
cat /tmp/castiron-custom-code-d6e48a06cdf7/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
There was a problem hiding this comment.
Pull request overview
This PR updates the generated OpenAPI reference artifacts to expose a new compute_units field in usage objects (Responses and Chat Completions) and refreshes Castiron generation metadata accordingly.
Changes:
- Add
compute_units(nullable non-negative integer) toCompletionUsage,ResponseUsage, andBetaResponseUsage. - Add two new
tenant.trusted_access.*event strings to the relevant webhook/event enum list in the transformed spec. - Update
.castiron.stats.ymlto reflect the new generation/spec hashes and codegen SHAs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| api_reference/openapi.transformed.yml | Adds compute_units to usage schemas and introduces two new tenant trusted-access event identifiers. |
| .castiron.stats.yml | Updates Castiron generation metadata/hashes to match the regenerated OpenAPI artifacts. |
Suppressed comments (2)
api_reference/openapi.transformed.yml:54967
- The description text is self-contradictory: it says
compute_unitsis "null when available". This should read as null until it’s available (or null when unavailable) so API consumers aren’t misled.
api_reference/openapi.transformed.yml:73863 - The description text is self-contradictory: it says
compute_unitsis "null when available". This should read as null until it’s available (or null when unavailable) so API consumers aren’t misled.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - tenant.trusted_access.business_verification.started | ||
| - tenant.trusted_access.application.submitted |
| description: | | ||
| Compute units for the request. Currently null when available. |
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Reviewed d6e48a06cdf7aee6a556758050303d04bdaa80fa. The three usage schemas consistently add an optional, nullable, non-negative integer, and the CLI's raw-response/RawJSON output paths preserve the new field without requiring response-model changes here. The two event-enum additions are additive. I also verified the transformed specification's MD5 matches the updated generation metadata.
No substantive issues or additional inline findings. The already-reported description wording nit is non-blocking and can be corrected in the authoritative schema.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Verified the schema-only update adds optional nullable nonnegative compute_units consistently to Responses and Chat usage without changing CLI runtime behavior or dependencies; generated metadata and canonical enum synchronization are consistent.
Automated Release PR --- ## [1.10.0](openai/openai-cli@v1.9.0...v1.10.0) (2026-09-02) ### Features * **api:** add compute_units to Responses and Chat Completions usage ([openai#142](openai#142)) ([fe626c6](openai@fe626c6)) * **api:** make function call output call IDs optional ([openai#140](openai#140)) ([0cb94ba](openai@0cb94ba)) * **api:** update usage APIs and documentation ([openai#147](openai#147)) ([f0c1afd](openai@f0c1afd)) ### Chores * **deps:** bump the codeql group across 1 directory with 2 updates ([openai#145](openai#145)) ([5933dd5](openai@5933dd5)) * **deps:** update openai-go to v3.54.0 ([openai#139](openai#139)) ([23ade14](openai@23ade14)) ### Documentation * add canonical CLI security model ([openai#146](openai#146)) ([682a6e8](openai@682a6e8)) --- 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>
Adds
compute_unitsto Responses and Chat Completions usage.