mirror of
https://github.com/openai/codex.git
synced 2026-11-19 15:04:25 +00:00
Add per-thread usage queries to the backend client (#38270)
## 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
This commit is contained in:
1 parent
5664a5c07c
commit
842fae26c9
4 files changed
+240
No files matched your search
@@ -35,6 +35,10 @@ use serde::de::DeserializeOwned;
|
||||
use std::fmt;
|
||||
|
||||
mod rate_limit_resets;
|
||||
mod thread_usage;
|
||||
|
||||
pub use thread_usage::ThreadUsage;
|
||||
pub use thread_usage::ThreadUsageBreakdownGroup;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum RequestError {
|
||||
|
||||
Reference in new issue
Block a user