Get Syntic Code analytics
⚠️
Preview — this feature is being built; the design below is the spec.
GET https://app.syntic.ai/v1/organizations/code_analyticsReturn per-person, per-day activity in Syntic Code: sessions, prompts, tokens, cost, tool use, accepted and rejected edits, and commits. Counts and costs only; the report never contains prompts, code, file or repository names. A day is complete 6 hours after it ends in UTC.
For how this fits into a full workflow, see Syntic Code usage.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <admin key>: an Admin API key (sk_admin_...). Inference keys are refused with 403 admin_key_required. See Admin API keys. |
syntic-beta | Yes, while in preview | admin-2026-11-01. Without it the call fails with 400 beta_required. See Versioning. |
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
starting_at | RFC 3339 time | Required | First day, at midnight UTC. |
ending_at | RFC 3339 time | now | Exclusive end, at most 31 days later. |
user_ids[] | string | Only these members. | |
group_by | string | user | user or day_only. |
limit | integer | 100 | 1 to 1,000 rows. |
after_id | string | Next page. | |
before_id | string | Previous page. |
Response
200 OK, Content-Type: application/json
{
"data": [
{
"date": "2026-11-04",
"user": {
"id": "user_01J9Y0A2C4E6G8J0L2N4",
"email": "dana@example.com"
},
"auth": "sign_in",
"sessions": 6,
"active_minutes": 212,
"prompts": 48,
"tokens": {
"input": 3120400,
"cached_input": 2804100,
"output": 98100
},
"cost_usd": "1.4410",
"billing_source": {
"subscription_tokens": 3218500,
"api_credit_usd": "0.0000"
},
"tool_uses": {
"edit": 31,
"write": 4,
"bash": 22,
"read": 140
},
"edits": {
"proposed": 35,
"accepted": 30,
"rejected": 5,
"lines_added": 612,
"lines_removed": 208
},
"commits_created": 3,
"models": [
{
"model": "Amara S1.2",
"output_tokens": 98100
}
],
"client_versions": [
"1.8.2"
]
}
],
"has_more": false,
"first_id": "bkt_01JC7A0B2C4D6E8F",
"last_id": "bkt_01JC7A0B2C4D6E8F"
}| Field | Type | Description |
|---|---|---|
auth | string | sign_in or api_key. |
edits | object | Edits proposed, accepted and rejected, and resulting line counts. |
billing_source | object | Tokens covered by the plan and dollars paid from credits. |
Examples
curl -sS "https://app.syntic.ai/v1/organizations/code_analytics?starting_at=2026-11-01T00%3A00%3A00Z&ending_at=2026-11-08T00%3A00%3A00Z" \
-H "Authorization: Bearer $SYNTIC_ADMIN_KEY" \
-H "syntic-beta: admin-2026-11-01"Errors
Errors use the error envelope and carry a request_id. Codes specific to this operation:
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request_error | beta_required | The syntic-beta header is missing. |
| 400 | invalid_request_error | invalid_time_range | Missing starting_at, not midnight UTC, or more than 31 days. |
| 403 | permission_error | role_required | The admin key’s creator does not have the role this needs. |
| 401 | authentication_error | invalid_api_key | The admin key is missing, unknown, revoked or expired. |
| 403 | permission_error | admin_key_required | An inference key was used. |
| 429 | rate_limit_error | rate_limited | Too many requests; wait for Retry-After. See Rate-limit headers. |
Related
Was this page helpful?