moderations
Creates, updates, deletes, gets or lists a moderations resource.
Overview
| Name | moderations |
| Type | Resource |
| Id | openai_admin.usage.moderations |
Fields
The following fields are returned by SELECT queries:
- list
Usage data retrieved successfully.
| Name | Datatype | Description |
|---|---|---|
end_time | integer | |
object | string | (bucket) |
results | array | |
start_time | integer |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | start_time | end_time, bucket_width, project_ids, user_ids, api_key_ids, models, 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.
| Name | Datatype | Description |
|---|---|---|
start_time | integer | Start time (Unix seconds) of the query time range, inclusive. |
api_key_ids | array | Return only usage for these API keys. |
bucket_width | string | Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d. |
end_time | integer | End time (Unix seconds) of the query time range, exclusive. |
group_by | array | Group the usage data by the specified fields. Support fields include project_id, user_id, api_key_id, model or any combination of them. |
limit | integer | Specifies 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 |
models | array | Return only usage for these models. |
page | string | A cursor for use in pagination. Corresponding to the next_page field from the previous response. |
project_ids | array | Return only usage for these projects. |
user_ids | array | Return only usage for these users. |
SELECT examples
- list
Usage data retrieved successfully.
SELECT
end_time,
object,
results,
start_time
FROM openai_admin.usage.moderations
WHERE start_time = '{{ start_time }}' -- required
AND end_time = '{{ end_time }}'
AND bucket_width = '{{ bucket_width }}'
AND project_ids = '{{ project_ids }}'
AND user_ids = '{{ user_ids }}'
AND api_key_ids = '{{ api_key_ids }}'
AND models = '{{ models }}'
AND group_by = '{{ group_by }}'
AND limit = '{{ limit }}'
AND page = '{{ page }}'
;