Skip to content

API Reference

The single endpoint for sending events from your agents to agent-os. Both SDKs use this endpoint internally.

Authorization: Bearer <api-key>

API keys are created in Settings > API Keys. See the API Keys guide.

200 requests per minute per API key.

{
"event_type": "run_start",
"sdk_run_id": "abc123",
"payload": { ... },
"agent_name": "my-agent",
"occurred_at": "2026-04-02T10:00:00Z"
}
FieldTypeRequiredDescription
event_typestringYesOne of the supported event types
sdk_run_idstringYesUnique run identifier (generated by SDK)
payloadobjectYesEvent-specific data
agent_namestringNoAgent name (used for auto-registration)
occurred_atstringNoISO-8601 timestamp (defaults to server time)
Event typeEffect
run_startCreates a new AgentRun record, auto-registers agent
stepRecords a node/step execution event
tool_callRecords a tool invocation event
errorRecords an error, sets run status to error
run_endMarks run as success, captures tokens, cost, model
human_input_requestedSets run status to waiting_for_input
human_input_receivedSets run status back to running

The run status is updated based on the event type:

Event typeRun status
run_startrunning
run_endsuccess
errorerror
human_input_requestedwaiting_for_input
human_input_receivedrunning
{
"event_type": "run_start",
"sdk_run_id": "run_a1b2c3",
"agent_name": "research-agent",
"payload": {
"framework": "langgraph",
"input": { "query": "What is the weather in Zurich?" }
}
}
{
"event_type": "step",
"sdk_run_id": "run_a1b2c3",
"payload": {
"node_name": "search_web",
"phase": "end",
"duration_ms": 890,
"output": { "results": ["..."] }
}
}
{
"event_type": "tool_call",
"sdk_run_id": "run_a1b2c3",
"payload": {
"tool_name": "web_search",
"phase": "end",
"input_preview": "Zurich weather today",
"output_preview": "12°C and cloudy",
"duration_ms": 740
}
}
{
"event_type": "run_end",
"sdk_run_id": "run_a1b2c3",
"payload": {
"output": { "answer": "It is 12°C and cloudy." },
"prompt_tokens": 150,
"completion_tokens": 45,
"total_tokens": 195,
"cost_usd": 0.0023,
"model": "gpt-4"
}
}
{
"event_type": "error",
"sdk_run_id": "run_a1b2c3",
"payload": {
"error_type": "ValueError",
"error_message": "API rate limit exceeded",
"traceback": "Traceback (most recent call last):\n ..."
}
}

Success:

{
"status": "ok",
"event_id": 42
}

With budget warning:

{
"status": "ok",
"event_id": 42,
"budget_warning": "Agent 'my-agent' has exceeded its budget of $10.00"
}

When an event is ingested:

  1. PersistedAgentEvent record created in Postgres
  2. Run updatedAgentRun status, tokens, and cost updated
  3. Broadcast — Event pushed to WebSocket channel user.{userId} via Laravel Reverb
  4. Alerts checked — Matching alert rules fire and dispatch notification jobs
  5. Agent registered — On run_start, the agent is auto-created if it doesn’t exist