Get code interpreter sessions usage details for the organization.
Query parameters
-
Start time (Unix seconds) of the query time range, inclusive.
-
End time (Unix seconds) of the query time range, exclusive.
-
Width of each time bucket in response. Currently
1m
,1h
and1d
are supported, default to1d
.Values are
1m
,1h
, or1d
. Default value is1d
. -
Return only usage for these projects.
-
Group the usage data by the specified fields. Support fields include
project_id
.Value is
project_id
. -
Specifies the number of buckets to return.
bucket_width=1d
: default: 7, max: 31bucket_width=1h
: default: 24, max: 168bucket_width=1m
: default: 60, max: 1440
-
A cursor for use in pagination. Corresponding to the
next_page
field from the previous response.
GET
/organization/usage/code_interpreter_sessions
curl \
--request GET 'https://api.openai.com/v1/organization/usage/code_interpreter_sessions?start_time=42' \
--header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
"object": "page",
"data": [
{
"object": "bucket",
"start_time": 42,
"end_time": 42,
"result": [
{
"object": "organization.usage.completions.result",
"input_tokens": 42,
"input_cached_tokens": 42,
"output_tokens": 42,
"input_audio_tokens": 42,
"output_audio_tokens": 42,
"num_model_requests": 42,
"project_id": "string",
"user_id": "string",
"api_key_id": "string",
"model": "string",
"batch": true
}
]
}
],
"has_more": true,
"next_page": "string"
}