Skip to content
Proud to collaborate with Microsoft for Startups

agents.cost-entry-record ​

Append a token-cost ledger row for a single LLM step within an agent session

Append an immutable cost ledger entry for one LLM step within a session.

Overview ​

PropertyValue
Workflow typeLinear
LibraryApp-agents
Version1.0

Triggers ​

SourceEndpoint / EventDescription
INTERNALinternal.invocationInternal — called by the runner agent during a session

Input Schema ​

FieldTypeRequiredDefaultDescription
session_uuidstringYes——
model_namestringYes——
organization_uuidstringYes——
tokens_promptintegerNo——
tokens_completionintegerNo——
tokens_cache_readintegerNo——
tokens_cache_writeintegerNo——
tokens_reasoningintegerNo——
step_metric_uuidstringNo——
unitstringNo——
quantityfloatNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
cost_usdjsonNo——
errorstringNo——
error_typestringNo——
failed_atstringNo——
failed_at_statestringNo——
failed_layerjsonNo——
failed_stepstringNo——
failure_reasonstringNo——
session_uuidjsonNo——
model_namejsonNo——
organization_uuidjsonNo——
tokens_promptjsonNo——
tokens_completionjsonNo——
tokens_cache_readjsonNo——
tokens_cache_writejsonNo——
tokens_reasoningjsonNo——
step_metric_uuidjsonNo——
unitjsonNo——
quantityjsonNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
initiatedYesNo—run—
runNoNo—complete—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
initiatedrunrun—
runcompletecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "agents.cost-entry-record",
  "initial_data": {
    "session_uuid": "value",
    "model_name": "value",
    "organization_uuid": "value"
  }
}