io.enterpriseai.model.UsageEvent
Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/model/UsageEvent.java. Back to the Java SDK reference index.
note
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Model UsageEvent
Usage Event v1 (contracts/v1/usage-event.schema.json): one consumption event with units, price and costs.
Fields:
| Name | Type | Required | Description |
|---|---|---|---|
schemaVersion | String | yes | Contract version, major 1 (1.x); minor bumps stay backward compatible. |
eventId | String | yes | Id of the usage event. |
occurredAt | OffsetDateTime | yes | Time the usage happened. |
tenantId | String | yes | Tenant of the agent. Default default. |
projectId | String | yes | Identifier of the project, the workspace of a tenant that owns agents, knowledge bases, quotas and secrets. |
environment | String | yes | Environment of the consumption. |
agentId | String | yes | Id of the agent that consumed. |
sessionId | String | yes | Id of the session. |
runId | String | yes | Id of the run. |
taskId | String | yes | Id of the task. |
requestId | String | yes | Id of the platform request. |
providerRequestId | String | yes | Request id given by the provider, may be null. |
traceId | String | yes | W3C trace id, 32 lowercase hexadecimal characters, to correlate the event with a trace. |
usageType | String | yes | Usage type, such as llm, embeddings, tool or sandbox. |
provider | String | yes | Provider that served the call. |
modelId | String | yes | Model of the call, matched against the model patterns of the price cards. |
deploymentId | String | yes | Model deployment running on the GPU during the sample. |
region | String | yes | Processing region, for example eu-west-1. |
units | Map<String, Object> | yes | Consumed units, such as the map built by TokenUnits.of. |
pricing | JsonNode | yes | Price applied, as a JSON object. |
cost | JsonNode | yes | Cost of the consumption, as a JSON object. |
status | String | yes | Cost status: estimated, measured or reconciled. |
source | String | yes | Emitter of the event, such as gateway, litellm, adapter, runtime or sandbox. |
labels | Map<String, String> | yes | Labels of the host as a map of strings, replacing the current ones, for example {"zone": "a"}. |