Concepts

Key concepts for working with the Keito API.

Time Entries

A time entry records work done by a human or agent. Key fields:

FieldTypeDescription
idstringUnique identifier
project_idstringThe project this work is for
task_idstringThe task within the project (optional)
user_idstringThe human or agent user
spent_datestringDate the work was performed (YYYY-MM-DD)
hoursnumberDuration in decimal hours
notesstringDescription of work done
is_runningbooleanWhether a timer is currently active
is_billablebooleanWhether this entry is billable
sourcestringOrigin: web, cli, api, agent
metadataobjectAgent context (JSON, max 4KB)

Expenses

An expense records a cost against a project. For agent work, this is typically LLM token usage.

FieldTypeDescription
idstringUnique identifier
project_idstringThe project this cost is for
expense_category_idstringCategory (e.g., “LLM Usage”)
spent_datestringDate of the expense (YYYY-MM-DD)
unitsnumberQuantity (e.g., tokens in thousands)
unit_pricenumberPrice per unit
total_costnumberCalculated total
notesstringDescription
sourcestringOrigin: web, cli, api, agent
metadataobjectAgent context (JSON, max 4KB)

Users

FieldTypeDescription
idstringUnique identifier
namestringDisplay name
emailstringEmail (agents may use placeholder)
user_typestringhuman or agent
is_activebooleanWhether the user is active

Source Values

SourceCreated ByBadge Colour
webKeito web appNone
cliKeito CLIAmber
apiDirect REST API callNone
agentAI agent via API or SDKViolet

Metadata Schema

The metadata field is a freeform JSON object (max 4KB). Recommended fields for agent entries:

{
  "agent_id": "string — unique identifier for this agent",
  "agent_type": "string — platform: claude-code, codex, cursor, etc.",
  "session_id": "string — UUID grouping related entries",
  "model": "string — LLM model used",
  "input_tokens": "number — input tokens consumed (expenses only)",
  "output_tokens": "number — output tokens consumed (expenses only)"
}

Use session_id to correlate a time entry with its corresponding LLM expense.