1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* OpenAI API
*
* The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
*
* OpenAPI spec pub version: 2.3.0
*
* Generated pub by: https://github.com/swagger-api/swagger-codegen.git
*/
/// pub UsageCompletionsResult : The aggregated completions usage details of the specific time bucket.
#[allow(unused_imports)]
use serde_json::Value;
#[derive(Debug, Serialize, Deserialize)]
pub struct UsageCompletionsResult {
/// When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result.
#[serde(rename = "api_key_id")]
pub api_key_id: Option<String>,
/// When `group_by=batch`, this field tells whether the grouped usage result is batch or not.
#[serde(rename = "batch")]
pub batch: Option<bool>,
/// The aggregated number of audio input tokens used, including cached tokens.
#[serde(rename = "input_audio_tokens")]
pub input_audio_tokens: Option<i32>,
/// The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens.
#[serde(rename = "input_cached_tokens")]
pub input_cached_tokens: Option<i32>,
/// The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.
#[serde(rename = "input_tokens")]
pub input_tokens: i32,
/// When `group_by=model`, this field provides the model name of the grouped usage result.
#[serde(rename = "model")]
pub model: Option<String>,
/// The count of requests made to the model.
#[serde(rename = "num_model_requests")]
pub num_model_requests: i32,
#[serde(rename = "object")]
pub object: String,
/// The aggregated number of audio output tokens used.
#[serde(rename = "output_audio_tokens")]
pub output_audio_tokens: Option<i32>,
/// The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.
#[serde(rename = "output_tokens")]
pub output_tokens: i32,
/// When `group_by=project_id`, this field provides the project ID of the grouped usage result.
#[serde(rename = "project_id")]
pub project_id: Option<String>,
/// When `group_by=user_id`, this field provides the user ID of the grouped usage result.
#[serde(rename = "user_id")]
pub user_id: Option<String>,
}