Skip to content

Add per-thread usage queries to the backend client - #38270

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/16c83590b2c804e0182b4493cf2aa39206029c77
Aug 12, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/16c83590b2c804e0182b4493cf2aa39206029c77

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Add per-thread usage queries to the backend client

What changed

  • Add Client::get_thread_usage for querying authoritative estimated credit
    and dollar usage for a thread across both supported backend path styles.
  • Expose usage totals and optional model, reasoning effort, speed, and token
    breakdowns through ThreadUsage and ThreadUsageBreakdownGroup.
  • Reject responses that do not include the requested thread.

Testing

  • Cover endpoint paths, request serialization, complete and partial usage
    responses, and mismatched thread IDs.

## What changed

- Add `Client::get_thread_usage` for querying authoritative estimated credit
  and dollar usage for a thread across both supported backend path styles.
- Expose usage totals and optional model, reasoning effort, speed, and token
  breakdowns through `ThreadUsage` and `ThreadUsageBreakdownGroup`.
- Reject responses that do not include the requested thread.

## Testing

- Cover endpoint paths, request serialization, complete and partial usage
  responses, and mismatched thread IDs.

GitOrigin-RevId: 16c83590b2c804e0182b4493cf2aa39206029c77
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/16c83590b2c804e0182b4493cf2aa39206029c77 branch from 3fc51dc to 842fae2 Compare August 12, 2026 22:59
@copyberry
copyberry Bot merged commit 842fae2 into main Aug 12, 2026
28 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/16c83590b2c804e0182b4493cf2aa39206029c77 branch August 12, 2026 23:00
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 12, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants