Skip to main content

Sending Actions

Send action events to meter agent usage:

Action Parameters

  • agent_key (required): The agent instance key
  • action_type (required): Type of action (e.g., “llm_call”, “tool_call”)
  • metadata (optional): Key-value pairs with action details
  • timestamp (optional): Event timestamp (defaults to now)

Common Action Types

  • llm_call - LLM API invocation
  • embedding - Vector embedding generation
  • tool_call - External tool or API call
  • agent_execution - Complete agent run
  • workflow_step - Step in a workflow
  • custom - Custom action type

Sending Outcomes

Send outcome events for business results:

Outcome Parameters

  • agent_key (required): The agent instance key
  • outcome_type (required): Type of outcome (e.g., “successful_hire”)
  • value (required): Outcome value (count or amount)
  • metadata (optional): Additional context
  • timestamp (optional): Event timestamp (defaults to now)

Attaching Metadata

Metadata provides context about events:

LLM Call Metadata

Tool Call Metadata

Custom Metadata

Add any custom fields:

Batch Sending

Send multiple events efficiently:

Async Sending

For async applications:

Error Handling

Handle errors gracefully:
Events are automatically buffered locally if the API is unavailable. They’ll be sent when the connection is restored.