Zhenfy

Token Usage

Every interaction with your agent processes tokens through the model. Token usage is tracked automatically and available on the agent dashboard and via the API.

Viewing Usage

Token usage is displayed on the agent detail page. The dashboard shows the total tokens processed across all interactions.

Usage API

You can query token usage programmatically for any agent you own:

GET /v1/agents/{agent_id}/usage

# Optional query parameters:
#   start  — ISO 8601 date (e.g. 2026-04-01)
#   end    — ISO 8601 date (e.g. 2026-04-30)

# Response:
{
  "data": {
    "agent_id": "abc-123",
    "total_tokens": 150000,
    "estimated_cost": 0.525,
    "model": "claude-sonnet-4-6",
    "record_count": 42
  }
}

Usage data is retained indefinitely and can be filtered by date range for reporting.