Skip to main content

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:

NameTypeRequiredDescription
schemaVersionStringyesContract version, major 1 (1.x); minor bumps stay backward compatible.
eventIdStringyesId of the usage event.
occurredAtOffsetDateTimeyesTime the usage happened.
tenantIdStringyesTenant of the agent. Default default.
projectIdStringyesIdentifier of the project, the workspace of a tenant that owns agents, knowledge bases, quotas and secrets.
environmentStringyesEnvironment of the consumption.
agentIdStringyesId of the agent that consumed.
sessionIdStringyesId of the session.
runIdStringyesId of the run.
taskIdStringyesId of the task.
requestIdStringyesId of the platform request.
providerRequestIdStringyesRequest id given by the provider, may be null.
traceIdStringyesW3C trace id, 32 lowercase hexadecimal characters, to correlate the event with a trace.
usageTypeStringyesUsage type, such as llm, embeddings, tool or sandbox.
providerStringyesProvider that served the call.
modelIdStringyesModel of the call, matched against the model patterns of the price cards.
deploymentIdStringyesModel deployment running on the GPU during the sample.
regionStringyesProcessing region, for example eu-west-1.
unitsMap<String, Object>yesConsumed units, such as the map built by TokenUnits.of.
pricingJsonNodeyesPrice applied, as a JSON object.
costJsonNodeyesCost of the consumption, as a JSON object.
statusStringyesCost status: estimated, measured or reconciled.
sourceStringyesEmitter of the event, such as gateway, litellm, adapter, runtime or sandbox.
labelsMap<String, String>yesLabels of the host as a map of strings, replacing the current ones, for example {"zone": "a"}.