OpenAI API

UsageCodeInterpreterSessionsResult

object

The aggregated code interpreter sessions usage details of the specific time bucket.

objectstringrequired

Allowed values:organization.usage.code_interpreter_sessions.result

num_sessionsinteger

The number of code interpreter sessions.

project_idstring

When group_by=project_id, this field provides the project ID of the grouped usage result.

Example

UsageCompletionsResult

object

The aggregated completions usage details of the specific time bucket.

objectstringrequired

Allowed values:organization.usage.completions.result

input_tokensintegerrequired

The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens.

input_cached_tokensinteger

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.

output_tokensintegerrequired

The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens.

input_audio_tokensinteger

The aggregated number of audio input tokens used, including cached tokens.

output_audio_tokensinteger

The aggregated number of audio output tokens used.

num_model_requestsintegerrequired

The count of requests made to the model.

project_idstring

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_idstring

When group_by=user_id, this field provides the user ID of the grouped usage result.

api_key_idstring

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

modelstring

When group_by=model, this field provides the model name of the grouped usage result.

batchboolean

When group_by=batch, this field tells whether the grouped usage result is batch or not.

Example

UsageEmbeddingsResult

object

The aggregated embeddings usage details of the specific time bucket.

objectstringrequired

Allowed values:organization.usage.embeddings.result

input_tokensintegerrequired

The aggregated number of input tokens used.

num_model_requestsintegerrequired

The count of requests made to the model.

project_idstring

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_idstring

When group_by=user_id, this field provides the user ID of the grouped usage result.

api_key_idstring

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

modelstring

When group_by=model, this field provides the model name of the grouped usage result.

Example

UsageImagesResult

object

The aggregated images usage details of the specific time bucket.

objectstringrequired

Allowed values:organization.usage.images.result

imagesintegerrequired

The number of images processed.

num_model_requestsintegerrequired

The count of requests made to the model.

sourcestring

When group_by=source, this field provides the source of the grouped usage result, possible values are image.generation, image.edit, image.variation.

sizestring

When group_by=size, this field provides the image size of the grouped usage result.

project_idstring

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_idstring

When group_by=user_id, this field provides the user ID of the grouped usage result.

api_key_idstring

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

modelstring

When group_by=model, this field provides the model name of the grouped usage result.

Example

UsageModerationsResult

object

The aggregated moderations usage details of the specific time bucket.

objectstringrequired

Allowed values:organization.usage.moderations.result

input_tokensintegerrequired

The aggregated number of input tokens used.

num_model_requestsintegerrequired

The count of requests made to the model.

project_idstring

When group_by=project_id, this field provides the project ID of the grouped usage result.

user_idstring

When group_by=user_id, this field provides the user ID of the grouped usage result.

api_key_idstring

When group_by=api_key_id, this field provides the API key ID of the grouped usage result.

modelstring

When group_by=model, this field provides the model name of the grouped usage result.

Example