Skip to main content
POST
/
api
/
v1
/
meters
/
model-usage
/
events
Ingest event for model usage
curl --request POST \
  --url https://dev-chat-engine.actualize.ae/api/v1/meters/model-usage/events \
  --header 'Content-Type: application/json' \
  --data '
{
  "usage": 100,
  "agentId": "agent-123",
  "sessionId": "session-456",
  "unitType": "input_tokens",
  "runId": "run-112",
  "source": "API",
  "orgId": "org-113",
  "credentialId": "openai_key_123",
  "externalCustomerId": "+971123456789",
  "eventId": "event-123",
  "modelPricingType": "llm"
}
'

Body

application/json
usage
number
required

The amount of usage

Example:

100

agentId
string
required

The ID of the agent associated with the usage

Example:

"agent-123"

sessionId
string
required

The session ID associated with the usage

Example:

"session-456"

unitType
enum<string>
required

The type of unit associated with the usage

Available options:
input_tokens,
output_tokens,
cached_tokens,
input_characters,
input_seconds
Example:

"input_tokens"

runId
string

The run ID associated with the usage

Example:

"run-112"

source
string

The source of the usage data

Example:

"API"

orgId
string

The organization ID

Example:

"org-113"

credentialId
string

The Id of the credential used to create the usage

Example:

"openai_key_123"

externalCustomerId
string

The external customer ID Note: This can be a customer ID from your customer management system, or a phone number for SIP Calls

Example:

"+971123456789"

eventId
string

The ID of the event associated with the usage Note: This is the ID of the event that triggered the usage and has to be unique for each event

Example:

"event-123"

modelPricingType
enum<string>
default:llm

The model type associated with the usage

Available options:
llm,
tts,
stt,
image
Example:

"llm"

Response

Ingested event