For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
  • API Reference
      • GETUsage Summary
      • GETUsage By Language
      • GETUsage Activity
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
API Referenceusage

Usage Summary

GET
/api/v1/usage/summary
GET
/api/v1/usage/summary
$curl https://api.onepin.ai/api/v1/usage/summary \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json"
1{
2 "data": {
3 "range": "30d",
4 "activity_view": "daily",
5 "timezone": "America/New_York",
6 "period": {
7 "start": "2024-04-01T00:00:00Z",
8 "end": "2024-04-30T23:59:59Z"
9 },
10 "credits": {
11 "used": 1250,
12 "quota": 5000,
13 "percent": 25
14 },
15 "characters": {
16 "total": 350000
17 },
18 "lines": {
19 "total": 17500,
20 "avg_chars_per_line": 20
21 },
22 "runs": {
23 "total": 1500,
24 "completed": 1400,
25 "failed": 50,
26 "cancelled": 30,
27 "running": 10,
28 "pending": 10
29 },
30 "activity": {
31 "view": "daily",
32 "bucket_unit": "day",
33 "range_label": "Last 30 days",
34 "total": 17500,
35 "avg": 583.3,
36 "buckets": [
37 {
38 "label": "2024-03-31",
39 "start": "2024-03-31T00:00:00Z",
40 "end": "2024-03-31T23:59:59Z",
41 "credits": 40,
42 "characters": 12000,
43 "lines": 600,
44 "runs": 50
45 }
46 ],
47 "peak": {
48 "value": 1200,
49 "label": "2024-04-15",
50 "start": "2024-04-15T00:00:00Z",
51 "end": "2024-04-15T23:59:59Z"
52 }
53 },
54 "daily": [
55 {
56 "date": "2024-04-01",
57 "credits": 35,
58 "characters": 11000,
59 "lines": 550,
60 "runs": 45
61 }
62 ]
63 },
64 "meta": {
65 "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
66 "timestamp": "2024-04-30T23:59:59Z"
67 }
68}

Return workspace usage totals plus tab-specific aggregate activity buckets.

Was this page helpful?
Previous

Usage By Language

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token
OR
AuthorizationBearer

Onepin live API key (op_live_...). Test and public keys are reserved in Phase 1.

Headers

X-Workspace-Idstring or nullOptional

Query parameters

rangeenumOptionalDefaults to 30d

Rolling local calendar-day range.

Allowed values:
activity_viewenumOptionalDefaults to daily

Activity chart view: daily=7 local days, weekly=12 Monday-start weeks, monthly=12 months.

Allowed values:
timezonestringOptionalDefaults to UTC
IANA timezone for local day bucketing.

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error