API Reference

Events

Events are the raw signals emitted by FORG adapters. Each event represents a single AI tool call: one model request with its response metadata. Events are immutable after ingestion.

The event object

{
  "id":          "evt_3a1b9c2d",
  "session_id":  "sess_4f9a2e1b8c3d",
  "user_id":     "user_abc123",
  "project_id":  "proj_xyz789",
  "ts":          "2025-05-28T09:14:37.422Z",
  "adapter":     "claude-code",
  "model":       "claude-opus-4-5",
  "tokens_in":   1024,
  "tokens_out":  512,
  "latency_ms":  1847,
  "cost_usd":    0.0042,
  "error_code":  null
}

Field reference

FieldTypeDescription
idstringUnique event identifier
session_idstringParent session
user_idstringDeveloper who triggered the event
project_idstring | nullProject context (from .forg.json or adapter)
tsISO 8601Timestamp of the event (when the model call completed)
adapterstringWhich adapter emitted this event
modelstringModel identifier (e.g., claude-opus-4-5)
tokens_innumberInput / prompt tokens consumed
tokens_outnumberOutput / completion tokens generated
latency_msnumberTime from request to first byte of response, in ms
cost_usdnumberEstimated cost in USD based on model pricing
error_codestring | nullNon-null when the model call returned an error (e.g., rate_limited, context_window_exceeded)

List events

GET /api/v1/events
ParameterTypeDescription
session_idstringFilter to a specific session
user_idstringFilter by user
project_idstringFilter by project
modelstringFilter by model (exact match)
adapterstringFilter by adapter name
fromISO 8601Events at or after this time
toISO 8601Events before this time
error_onlybooleanIf true, only return events with non-null error_code
limitnumberPage size (default: 20, max: 100)
cursorstringPagination cursor
curl "https://forg.pro/api/v1/events?session_id=sess_4f9a2e1b8c3d" \
  -H "Authorization: Bearer forg_live_..."

{
  "data": [
    {
      "id": "evt_3a1b9c2d",
      "model": "claude-opus-4-5",
      "tokens_in": 1024,
      "tokens_out": 512,
      "cost_usd": 0.0042,
      "ts": "2025-05-28T09:14:37.422Z"
    },
    ...
  ],
  "cursor": "evt_5d2e8f3a",
  "has_more": true
}

Get a single event

GET /api/v1/events/:id
© 2026 UpgradIQ, Inc.Edit this page on GitHub