API Docs
Precursor
Endpoint
Base URL
Get usage summary
Returns a single JSON document containing:
- A top level name
- Aggregate stats for the requested period
- A daily time_series array for the requested period
Parameters
- fields=name,stats.total_events,stats.total_tokens
- fields=stats.time_series - time series only
- fields=stats - all stats
Example request
curl "https://JTPCK.com/api/v1/public/1b2fa7aa-7838-41f4-8e5b-7bfc889d54dd?period=7d"
You can also see a sample right here in your browser.
Field filtering example
curl "https://JTPCK.com/api/v1/public/1b2fa7aa-7838-41f4-8e5b-7bfc889d54dd?period=7d&fields=name,stats.total_events,stats.total_tokens"
# Returns:
{
"name": "Alex Smith",
"stats": {
"total_events": 11,
"total_tokens": 10096
}
}
Response
Success (200 OK)
Content type: application/json
Response body shape
Top level
- name (string)
- stats (object)
- generated_at (string, RFC 3339 timestamp)
stats
- total_events (integer): total number of events in the period
- total_tokens (integer): total tokens in the period
- input_tokens (integer): total input tokens in the period
- output_tokens (integer): total output tokens in the period
- avg_latency_ms (integer): average latency in milliseconds across events in the period
- success_rate (number): success rate percentage for the period (0 to 100)
- events_by_model (object<string, integer>): event count per model
- tokens_by_model (object<string, integer>): token count per model
- events_by_provider (object<string, integer>): event count per provider
- events_by_application (object<string, integer>): event count per application
- time_series (array): daily tokens and sessions for the period
- sessions_count (integer): total coding sessions in the period
- weekly_avg_sessions (integer): average sessions per week in the period
- total_commits (integer): total commits made across all sessions
- total_active_time_seconds (integer): total active coding time in seconds
- total_lines_of_code (integer): total lines of code written
- cache_efficiency (number): cache hit rate percentage (0 to 100)
time_series[] items
- date (string, YYYY-MM-DD)
- tokens (integer): total tokens for that day
- tokens_by_model (object<string, integer>): tokens for that day grouped by model
- coding_sessions (integer): number of coding sessions started on that day
Time series expectations
- The time_series array contains one entry per day for the requested period (7, 30, or 90 days).
- Days with no activity are included with tokens: 0.
- Dates are returned in ascending order.
Example response
{
"name": "Alex Smith",
"stats": {
"total_events": 11,
"total_tokens": 10096,
"input_tokens": 7118,
"output_tokens": 2978,
"avg_latency_ms": 1408,
"success_rate": 81.8,
"events_by_model": {
"gpt-4": 7,
"claude-3-opus": 3,
"gpt-3.5-turbo": 1
},
"tokens_by_model": {
"gpt-4": 6531,
"claude-3-opus": 2917,
"gpt-3.5-turbo": 648
},
"events_by_provider": {
"anthropic": 6,
"openai": 5
},
"events_by_application": {
"claude-code": 11
},
"time_series": [
{
"date": "2026-01-01",
"tokens": 1390,
"tokens_by_model": { "gpt-4": 1390, "claude-3-opus": 0, "gpt-3.5-turbo": 0 },
"coding_sessions": 2
}
],
"sessions_count": 8,
"weekly_avg_sessions": 8,
"total_commits": 12,
"total_active_time_seconds": 14523,
"total_lines_of_code": 847,
"cache_efficiency": 23.4
},
"generated_at": "2026-01-08T17:25:24Z"
}
Errors
All error responses are JSON with this shape:
{
"error": {
"code": "string",
"message": "string"
}
}
Common error codes
400 Bad Request
invalid_period: period must be one of 7d, 30d, 90d
404 Not Found
not_found: User not found or API access disabled
429 Too Many Requests
rate_limited: too many requests
500 Internal Server Error
server_error: unexpected error
Notes
This endpoint returns only the data associated with the provided public_id. Model, provider, and application keys are returned as strings and may expand over time as new integrations are added. Events with unknown or null model/provider values are excluded from the response.