Everything Observatory shows is built on top of a stream of events. The decorators emit them for you, but you can also callDocumentation Index
Fetch the complete documentation index at: https://docs.flowx.ai/llms.txt
Use this file to discover all available pages before exploring further.
track_event() directly when you need a custom signal.
The wire protocol
Events are HTTP-POSTed to/api/report as a JSON object with an events array. Each event is one object:
Authorization: Bearer <FLOWX_OBSERVATORY_API_KEY> and resolves app_id from the metadata or, failing that, from the project the key belongs to.
Batching
The SDK queues events in memory and a background consumer flushes them on a short interval, posting each batch as{"events": [...]} to /api/report. On shutdown, the SDK flushes the remaining queue. Delivery is best-effort — if a flush fails, those events are dropped rather than blocking your app.
Cost and token rules
The Observatory API computes cost only for events withtype=llm. The rules:
- The event must include
prompt_tokensandcompletion_tokens(ortotal_tokens). - The event must include
model. - There must be a row for the model in the API’s model cost table.
cost = 0 for that event.
Custom events
Three custom events have semantic meaning to Observatory:saved
Marking a run as saved persists it past retention windows and surfaces it for dataset workflows.
chat
A chat event represents one message in a conversation. The Threads view groups consecutive chat events by thread_id into a single thread.
thread_id, the SDK falls back to grouping by agent + user within a 30-minute window.
feedback
Attaching feedback to a run or thread message.
Advanced filtering
The runs endpoint accepts the full filter set used by the LLM Calls UI:| Parameter | Type | Notes |
|---|---|---|
status | enum | success / error / started. |
model | string | Exact match. |
agent | string | Exact match. |
min_latency_s / max_latency_s | float | Wall-clock seconds. |
min_cost / max_cost | float | USD. |
tags | list | Any-of match. |
user_email | string | Exact match. |
from / to | ISO timestamp | Inclusive window. |
Direct API use
If you can’t use the Python SDK (different language, edge environment), report events directly:Related resources
Decorators
The Python wrappers that emit standard events for you.
Threads
Where
chat events become conversations.
