long endTime
JsonValue; object_
constant
constant
List<Result> results
One of the following:
class OrganizationUsageCompletionsResult:

The aggregated completions usage details of the specific time bucket.

long inputTokens

The aggregated number of input tokens used, including cached and cache-write tokens. This includes text, audio, and image tokens. For customers subscribed to Scale Tier, this includes Scale Tier tokens.

long numModelRequests

The count of requests made to the model.

JsonValue; object_
constant
constant
long outputTokens

The aggregated number of output tokens used across text, audio, and image outputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.

Optional<String> apiKeyId

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

Optional<ApiSource> apiSource

When grouped by api_source, agents_api identifies attributed Agents API activity and unlabeled includes all records without published source attribution, including historical and unknown origins. Unlabeled does not imply direct API usage. Without source grouping, this field is null.

One of the following:
AGENTS_API("agents_api")
UNLABELED("unlabeled")
Optional<Boolean> batch

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

Optional<Long> inputAudioTokens

The aggregated number of uncached audio input tokens used.

Optional<Long> inputCacheWrite12hTokens

The aggregated number of input tokens written to the cache with a 12-hour retention period.

Optional<Long> inputCacheWrite30mTokens

The aggregated number of input tokens written to the cache with a 30-minute retention period. May be absent or null for older responses.

Optional<Long> inputCacheWriteTokens

The aggregated number of input tokens written to the cache across 30-minute and 12-hour retention periods.

Optional<Long> inputCachedAudioTokens

The aggregated number of cached audio input tokens used.

Optional<Long> inputCachedImageTokens

The aggregated number of cached image input tokens used.

Optional<Long> inputCachedTextTokens

The aggregated number of cached text input tokens used.

Optional<Long> inputCachedTokens

The aggregated number of cached input tokens used across text, audio, and image inputs. For customers subscribed to Scale Tier, this includes Scale Tier tokens.

Optional<Long> inputImageTokens

The aggregated number of uncached image input tokens used.

Optional<Long> inputTextTokens

The aggregated number of uncached text input tokens used, excluding cache-write tokens.

Optional<Long> inputUncachedTokens

The aggregated number of uncached input tokens used across text, audio, and image inputs, excluding cache-write tokens.

Optional<String> model

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

Optional<Long> outputAudioTokens

The aggregated number of audio output tokens used.

Optional<Long> outputImageTokens

The aggregated number of image output tokens used.

Optional<Long> outputTextTokens

The aggregated number of text output tokens used.

Optional<String> projectId

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

Optional<String> serviceTier

When group_by=service_tier, this field provides the service tier of the grouped usage result.

Optional<String> userId

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

class OrganizationUsageEmbeddingsResult:

The aggregated embeddings usage details of the specific time bucket.

long inputTokens

The aggregated number of input tokens used.

long numModelRequests

The count of requests made to the model.

JsonValue; object_
constant
constant
Optional<String> apiKeyId

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

Optional<String> model

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

Optional<String> projectId

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

Optional<String> userId

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

class OrganizationUsageModerationsResult:

The aggregated moderations usage details of the specific time bucket.

long inputTokens

The aggregated number of input tokens used.

long numModelRequests

The count of requests made to the model.

JsonValue; object_
constant
constant
Optional<String> apiKeyId

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

Optional<String> model

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

Optional<String> projectId

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

Optional<String> userId

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

class OrganizationUsageImagesResult:

The aggregated images usage details of the specific time bucket.

long images

The number of images processed.

long numModelRequests

The count of requests made to the model.

JsonValue; object_
constant
constant
Optional<String> apiKeyId

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

Optional<String> model

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

Optional<String> projectId

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

Optional<String> size

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

Optional<String> source

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

Optional<String> userId

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

class OrganizationUsageAudioSpeechesResult:

The aggregated audio speeches usage details of the specific time bucket.

long characters

The number of characters processed.

long numModelRequests

The count of requests made to the model.

JsonValue; object_
constant
constant
Optional<String> apiKeyId

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

Optional<String> model

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

Optional<String> projectId

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

Optional<String> userId

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

class OrganizationUsageAudioTranscriptionsResult:

The aggregated audio transcriptions usage details of the specific time bucket.

long numModelRequests

The count of requests made to the model.

JsonValue; object_
constant
constant
long seconds

The number of seconds processed.

formatint64
Optional<String> apiKeyId

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

Optional<String> model

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

Optional<String> projectId

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

Optional<String> userId

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

class OrganizationUsageVectorStoresResult:

The aggregated vector stores usage details of the specific time bucket.

JsonValue; object_
constant
constant
long usageBytes

The vector stores usage in bytes.

Optional<String> projectId

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

class OrganizationUsageCodeInterpreterSessionsResult:

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

long numSessions

The number of code interpreter sessions.

JsonValue; object_
constant
constant
Optional<String> projectId

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

class OrganizationUsageFileSearchesResult:

The aggregated file search calls usage details of the specific time bucket.

long numRequests

The count of file search calls.

JsonValue; object_
constant
constant
Optional<String> apiKeyId

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

Optional<String> projectId

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

Optional<String> userId

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

Optional<String> vectorStoreId

When group_by=vector_store_id, this field provides the vector store ID of the grouped usage result.

class OrganizationUsageWebSearchesResult:

The aggregated web search calls usage details of the specific time bucket.

long numModelRequests

The count of model requests.

long numRequests

The count of web search calls.

JsonValue; object_
constant
constant
Optional<String> apiKeyId

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

Optional<ApiSource> apiSource

When grouped by api_source, agents_api identifies attributed Agents API activity and unlabeled includes all records without published source attribution, including historical and unknown origins. Unlabeled does not imply direct API usage. Without source grouping, this field is null.

One of the following:
AGENTS_API("agents_api")
UNLABELED("unlabeled")
Optional<String> contextLevel

When group_by=context_level, this field provides the search context size of the grouped usage result.

Optional<String> model

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

Optional<String> projectId

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

Optional<String> userId

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

class OrganizationCostsResult:

The aggregated costs details of the specific time bucket.

JsonValue; object_
constant
constant
Optional<Amount> amount

The monetary value in its associated currency.

Optional<String> currency

Lowercase ISO-4217 currency e.g. “usd”

Optional<Double> value

The numeric value of the cost.

Optional<String> apiKeyId

When group_by=api_key_id, this field provides the API Key ID of the grouped costs result.

Optional<ApiSource> apiSource

When grouped by api_source, agents_api identifies attributed Agents API activity and unlabeled includes all records without published source attribution, including historical and unknown origins. Unlabeled does not imply direct API usage. Without source grouping, this field is null.

One of the following:
AGENTS_API("agents_api")
UNLABELED("unlabeled")
Optional<String> lineItem

When group_by=line_item, this field provides the line item of the grouped costs result.

Optional<String> projectId

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

Optional<Double> quantity

When group_by=line_item, this field provides the quantity of the grouped costs result.

Optional<CostQuantityUnit> quantityUnit

The unit of the quantity value. If no single supported unit applies to the result, this field is null.

One of the following:
TOKENS("tokens")
_1000_TOKENS("1000_tokens")
DURATION_SECONDS("duration_seconds")
DURATION_MINUTES("duration_minutes")
DURATION_HOURS("duration_hours")
GIBIBYTE_HOURS("gibibyte_hours")
IMAGES("images")
CHARACTERS("characters")
Optional<String> userId

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

long startTime