Skip to main content

rate_limits

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

Overview

Namerate_limits
TypeResource
Idopenai_admin.projects.rate_limits

Fields

The following fields are returned by SELECT queries:

Project rate limits listed successfully.

NameDatatypeDescription
idstringThe identifier, which can be referenced in API endpoints.
batch_1_day_max_input_tokensintegerThe maximum batch input tokens per day. Only present for relevant models.
max_audio_megabytes_per_1_minuteintegerThe maximum audio megabytes per minute. Only present for relevant models.
max_images_per_1_minuteintegerThe maximum images per minute. Only present for relevant models.
max_requests_per_1_dayintegerThe maximum requests per day. Only present for relevant models.
max_requests_per_1_minuteintegerThe maximum requests per minute.
max_tokens_per_1_minuteintegerThe maximum tokens per minute.
modelstringThe model this rate limit applies to.
objectstringThe object type, which is always project.rate_limit (project.rate_limit)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectproject_idlimit, after, before
updateupdateproject_id, rate_limit_id

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
project_idstringThe ID of the project.
rate_limit_idstringThe ID of the rate limit.
afterstringA cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforestringA cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, beginning with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.
limitintegerA limit on the number of objects to be returned. The default is 100.

SELECT examples

Project rate limits listed successfully.

SELECT
id,
batch_1_day_max_input_tokens,
max_audio_megabytes_per_1_minute,
max_images_per_1_minute,
max_requests_per_1_day,
max_requests_per_1_minute,
max_tokens_per_1_minute,
model,
object
FROM openai_admin.projects.rate_limits
WHERE project_id = '{{ project_id }}' -- required
AND limit = '{{ limit }}'
AND after = '{{ after }}'
AND before = '{{ before }}'
;

UPDATE examples

No description available.

UPDATE openai_admin.projects.rate_limits
SET
max_requests_per_1_minute = {{ max_requests_per_1_minute }},
max_tokens_per_1_minute = {{ max_tokens_per_1_minute }},
max_images_per_1_minute = {{ max_images_per_1_minute }},
max_audio_megabytes_per_1_minute = {{ max_audio_megabytes_per_1_minute }},
max_requests_per_1_day = {{ max_requests_per_1_day }},
batch_1_day_max_input_tokens = {{ batch_1_day_max_input_tokens }}
WHERE
project_id = '{{ project_id }}' --required
AND rate_limit_id = '{{ rate_limit_id }}' --required
RETURNING
id,
batch_1_day_max_input_tokens,
max_audio_megabytes_per_1_minute,
max_images_per_1_minute,
max_requests_per_1_day,
max_requests_per_1_minute,
max_tokens_per_1_minute,
model,
object;