Skip to main content

code_interpreter_sessions

Creates, updates, deletes, gets or lists a code_interpreter_sessions resource.

Overview

Namecode_interpreter_sessions
TypeResource
Idopenai_admin.usage.code_interpreter_sessions

Fields

The following fields are returned by SELECT queries:

Usage data retrieved successfully.

NameDatatypeDescription
end_timeinteger
objectstring (bucket)
resultsarray
start_timeinteger

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectstart_timeend_time, bucket_width, project_ids, group_by, limit, page

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
start_timeintegerStart time (Unix seconds) of the query time range, inclusive.
bucket_widthstringWidth of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.
end_timeintegerEnd time (Unix seconds) of the query time range, exclusive.
group_byarrayGroup the usage data by the specified fields. Support fields include project_id.
limitintegerSpecifies the number of buckets to return. - bucket_width=1d: default: 7, max: 31 - bucket_width=1h: default: 24, max: 168 - bucket_width=1m: default: 60, max: 1440
pagestringA cursor for use in pagination. Corresponding to the next_page field from the previous response.
project_idsarrayReturn only usage for these projects.

SELECT examples

Usage data retrieved successfully.

SELECT
end_time,
object,
results,
start_time
FROM openai_admin.usage.code_interpreter_sessions
WHERE start_time = '{{ start_time }}' -- required
AND end_time = '{{ end_time }}'
AND bucket_width = '{{ bucket_width }}'
AND project_ids = '{{ project_ids }}'
AND group_by = '{{ group_by }}'
AND limit = '{{ limit }}'
AND page = '{{ page }}'
;