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.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
    • Overview
  • Runtype API
      • GETGet model usage statistics
      • GETGet model usage details
Dashboard
LogoLogo
Runtype APIModel Usage

Get model usage statistics

GET
/v1/model-usage
GET
/v1/model-usage
$curl https://api.runtype.com/v1/model-usage \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json"
1{
2 "meta": {
3 "endDate": "2024-05-07",
4 "startDate": "2024-05-01",
5 "dataSource": "runtype-analytics-db",
6 "granularity": "day",
7 "period": "last_7_days"
8 },
9 "summary": {
10 "totalCost": 48.75,
11 "totalRequests": 1523,
12 "totalTokens": 125000,
13 "platformCost": 12.5,
14 "platformTokens": 30000,
15 "userCost": 36.25,
16 "userTokens": 95000
17 },
18 "usageByModel": {
19 "gpt-4-runtype": {
20 "avgCostPerRequest": 0.0333,
21 "modelId": "gpt-4-runtype",
22 "provider": "OpenAI",
23 "requestCount": 900,
24 "totalCost": 30,
25 "totalTokens": 75000,
26 "modelName": "GPT-4 Runtype Edition"
27 },
28 "gpt-3.5-turbo": {
29 "avgCostPerRequest": 0.0301,
30 "modelId": "gpt-3.5-turbo",
31 "provider": "OpenAI",
32 "requestCount": 623,
33 "totalCost": 18.75,
34 "totalTokens": 50000,
35 "modelName": "GPT-3.5 Turbo"
36 }
37 },
38 "timeSeries": [
39 {
40 "cost": 6.75,
41 "date": "2024-05-01",
42 "requests": 210,
43 "tokens": 17000
44 },
45 {
46 "cost": 7.25,
47 "date": "2024-05-02",
48 "requests": 230,
49 "tokens": 18000
50 },
51 {
52 "cost": 7,
53 "date": "2024-05-03",
54 "requests": 220,
55 "tokens": 17500
56 },
57 {
58 "cost": 6.5,
59 "date": "2024-05-04",
60 "requests": 210,
61 "tokens": 16500
62 },
63 {
64 "cost": 6,
65 "date": "2024-05-05",
66 "requests": 190,
67 "tokens": 15000
68 },
69 {
70 "cost": 7.5,
71 "date": "2024-05-06",
72 "requests": 230,
73 "tokens": 18500
74 },
75 {
76 "cost": 7.75,
77 "date": "2024-05-07",
78 "requests": 230,
79 "tokens": 18500
80 }
81 ]
82}
Get aggregated model usage statistics with optional date range and time series.
Was this page helpful?
Previous

Get model usage details

Next
Built with

Authentication

AuthorizationBearer
API key or Clerk session token

Query parameters

startDatestringOptional

Start date (YYYY-MM-DD)

endDatestringOptional

End date (YYYY-MM-DD)

periodstringOptional

Convenience preset (today, yesterday, last_7_days, last_30_days, current_month, last_month, current_year)

granularitystringOptional

Time series granularity (hour, day, week, month)

modelConfigIdstringOptional
Filter by model config ID

Response

Model usage statistics
metaobject
summaryobject
usageByModelmap from strings to objects
timeSerieslist of objects

Errors

401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error
503
Service Unavailable Error