You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTML/CSS to Image supports converting html into png, jpg or webp. Learn how to check your account usage.
8
+
Learn how to monitor your HTML/CSS to Image API usage through response headers and dedicated endpoints.
9
9
---
10
-
# Checking account usage
10
+
11
+
# Monitoring API Usage
11
12
{: .no_toc }
12
13
{: .fs-9 }
13
14
14
-
You have two options for checking your current usage via the API
15
+
Two simple ways to track your image generation usage
15
16
{: .fs-6 .fw-300 }
16
17
17
18
<hr>
18
19
19
-
## Usage headers
20
+
Table of contents
21
+
{: .text-delta }
22
+
- TOC
23
+
{:toc}
24
+
25
+
<hr>
26
+
27
+
## Automated Usage Alerts
28
+
29
+
We automatically send email notifications when your account reaches usage thresholds:
30
+
- At 80% of your monthly limit
31
+
- At 100% of your monthly limit
32
+
33
+
## Response Headers
20
34
21
-
Whenever you create an image, we return your current usage in the response headers.
35
+
The simplest way to monitor usage is through the response headers returned with each image creation. These headers provide real-time usage information:
22
36
23
-
-`x-renders-allowed`: the total allowed for the current billing period.
24
-
-`x-renders-consumed`: the number used by the created image.
25
-
-`x-renders-used`: the total number used this period.
37
+
| Header | Description |
38
+
|:-------|:------------|
39
+
|`x-renders-allowed`| Your total image allowance for the current billing period |
40
+
|`x-renders-consumed`| Number of renders used by this specific request |
41
+
|`x-renders-used`| Total renders used in the current billing period |
26
42
43
+
{% include hint.md title="Monitoring Tip" text="These headers make it easy to implement usage alerts in your application before hitting your plan limits." %}
27
44
28
-
## Usage endpoint
45
+
## Usage API Endpoint
46
+
47
+
For detailed usage statistics, use our dedicated usage endpoint:
29
48
30
49
<preclass="http-method fs-4">
31
50
<span>get</span> https://hcti.io<b>/v1/usage</b>
32
51
</pre>
33
52
34
-
To check your account usage, you can make a request to the `usage` endpoint. It will return the total images created for your account rolled up into different time periods.
53
+
This endpoint returns comprehensive usage data broken down by:
54
+
- Hourly usage (last 72 hours)
55
+
- Daily usage (last 60 days)
56
+
- Monthly usage (last 12 months)
57
+
- Per billing period statistics
35
58
36
-
### Example response
37
-
```
38
-
STATUS: 200 OK
59
+
### Example Request
60
+
61
+
```bash
62
+
curl -X GET https://hcti.io/v1/usage \
63
+
-u 'user-id:api-key'
39
64
```
40
65
66
+
### Response Format
67
+
68
+
The response includes usage data organized into different time periods:
69
+
41
70
```javascript
42
71
{
43
72
"data": {
44
73
"hour": {
45
-
"2021-11-14T14:00:00Z":54,
46
-
"2021-11-14T15:00:00Z":56,
47
-
"2021-11-14T16:00:00Z":56,
48
-
"2021-11-14T17:00:00Z":57,
49
-
"2021-11-14T18:00:00Z":59,
50
-
"2021-11-14T19:00:00Z":55,
51
-
"2021-11-14T20:00:00Z":58,
52
-
"2021-11-14T21:00:00Z":54,
53
-
"2021-11-14T22:00:00Z":57,
54
-
"2021-11-14T23:00:00Z":57,
55
-
"2021-11-15T00:00:00Z":60,
56
-
"2021-11-15T01:00:00Z":56,
57
-
"2021-11-15T02:00:00Z":56,
58
-
"2021-11-15T03:00:00Z":55,
59
-
"2021-11-15T04:00:00Z":57,
60
-
"2021-11-15T05:00:00Z":55,
61
-
"2021-11-15T06:00:00Z":55,
62
-
"2021-11-15T07:00:00Z":56,
63
-
"2021-11-15T08:00:00Z":55,
64
-
"2021-11-15T09:00:00Z":60,
65
-
"2021-11-15T10:00:00Z":62,
66
-
"2021-11-15T11:00:00Z":60,
67
-
"2021-11-15T12:00:00Z":62,
68
-
"2021-11-15T13:00:00Z":62,
69
-
"2021-11-15T14:00:00Z":62,
70
-
"2021-11-15T15:00:00Z":61,
71
-
"2021-11-15T16:00:00Z":61,
72
-
"2021-11-15T17:00:00Z":60,
73
-
"2021-11-15T18:00:00Z":61,
74
-
"2021-11-15T19:00:00Z":64,
75
-
"2021-11-15T20:00:00Z":61,
76
-
"2021-11-15T21:00:00Z":61,
77
-
"2021-11-15T22:00:00Z":62,
78
-
"2021-11-15T23:00:00Z":63,
79
-
"2021-11-16T00:00:00Z":62,
80
-
"2021-11-16T01:00:00Z":62,
81
-
"2021-11-16T02:00:00Z":60,
82
-
"2021-11-16T03:00:00Z":60,
83
-
"2021-11-16T04:00:00Z":62,
84
-
"2021-11-16T05:00:00Z":53,
85
-
"2021-11-16T06:00:00Z":60,
86
-
"2021-11-16T07:00:00Z":60,
87
-
"2021-11-16T08:00:00Z":60,
88
-
"2021-11-16T09:00:00Z":60,
89
-
"2021-11-16T10:00:00Z":60,
90
-
"2021-11-16T11:00:00Z":60,
91
-
"2021-11-16T12:00:00Z":68,
92
-
"2021-11-16T13:00:00Z":62,
93
-
"2021-11-16T14:00:00Z":61,
94
-
"2021-11-16T15:00:00Z":60,
95
-
"2021-11-16T16:00:00Z":60,
96
-
"2021-11-16T17:00:00Z":65,
97
-
"2021-11-16T18:00:00Z":63,
98
-
"2021-11-16T19:00:00Z":60,
99
-
"2021-11-16T20:00:00Z":60,
100
-
"2021-11-16T21:00:00Z":60,
101
-
"2021-11-16T22:00:00Z":62,
102
-
"2021-11-16T23:00:00Z":61,
103
-
"2021-11-17T00:00:00Z":60,
104
-
"2021-11-17T01:00:00Z":60,
105
-
"2021-11-17T02:00:00Z":65,
106
-
"2021-11-17T03:00:00Z":63,
107
-
"2021-11-17T04:00:00Z":62,
108
-
"2021-11-17T05:00:00Z":63,
109
-
"2021-11-17T06:00:00Z":63,
110
-
"2021-11-17T07:00:00Z":64,
111
-
"2021-11-17T08:00:00Z":63,
112
-
"2021-11-17T09:00:00Z":64,
113
-
"2021-11-17T10:00:00Z":60,
114
-
"2021-11-17T11:00:00Z":61,
115
-
"2021-11-17T12:00:00Z":61,
116
-
"2021-11-17T13:00:00Z":29
74
+
"2024-03-17T13:00:00Z":29,
75
+
// ... hourly data
117
76
},
118
77
"day": {
119
-
"2021-09-19T00:00:00Z":1569,
120
-
"2021-09-20T00:00:00Z":1722,
121
-
"2021-09-21T00:00:00Z":1604,
122
-
"2021-09-22T00:00:00Z":1560,
123
-
"2021-09-23T00:00:00Z":1571,
124
-
"2021-09-24T00:00:00Z":1627,
125
-
"2021-09-25T00:00:00Z":1660,
126
-
"2021-09-26T00:00:00Z":1527,
127
-
"2021-09-27T00:00:00Z":1588,
128
-
"2021-09-28T00:00:00Z":1549,
129
-
"2021-09-29T00:00:00Z":1523,
130
-
"2021-09-30T00:00:00Z":1662,
131
-
"2021-10-01T00:00:00Z":1556,
132
-
"2021-10-02T00:00:00Z":1585,
133
-
"2021-10-03T00:00:00Z":1539,
134
-
"2021-10-04T00:00:00Z":1556,
135
-
"2021-10-05T00:00:00Z":1487,
136
-
"2021-10-06T00:00:00Z":1580,
137
-
"2021-10-07T00:00:00Z":1498,
138
-
"2021-10-08T00:00:00Z":1485,
139
-
"2021-10-09T00:00:00Z":1474,
140
-
"2021-10-10T00:00:00Z":1487,
141
-
"2021-10-11T00:00:00Z":1513,
142
-
"2021-10-12T00:00:00Z":1477,
143
-
"2021-10-13T00:00:00Z":1464,
144
-
"2021-10-14T00:00:00Z":1458,
145
-
"2021-10-15T00:00:00Z":1452,
146
-
"2021-10-16T00:00:00Z":1477,
147
-
"2021-10-17T00:00:00Z":1471,
148
-
"2021-10-18T00:00:00Z":1482,
149
-
"2021-10-19T00:00:00Z":1499,
150
-
"2021-10-20T00:00:00Z":1504,
151
-
"2021-10-21T00:00:00Z":1530,
152
-
"2021-10-22T00:00:00Z":1502,
153
-
"2021-10-23T00:00:00Z":1501,
154
-
"2021-10-24T00:00:00Z":1486,
155
-
"2021-10-25T00:00:00Z":1475,
156
-
"2021-10-26T00:00:00Z":1469,
157
-
"2021-10-27T00:00:00Z":1460,
158
-
"2021-10-28T00:00:00Z":1451,
159
-
"2021-10-29T00:00:00Z":1443,
160
-
"2021-10-30T00:00:00Z":1447,
161
-
"2021-10-31T00:00:00Z":1443,
162
-
"2021-11-01T00:00:00Z":1455,
163
-
"2021-11-02T00:00:00Z":1473,
164
-
"2021-11-03T00:00:00Z":1482,
165
-
"2021-11-04T00:00:00Z":1463,
166
-
"2021-11-05T00:00:00Z":1472,
167
-
"2021-11-06T00:00:00Z":1452,
168
-
"2021-11-07T00:00:00Z":1469,
169
-
"2021-11-08T00:00:00Z":1478,
170
-
"2021-11-09T00:00:00Z":1494,
171
-
"2021-11-10T00:00:00Z":1469,
172
-
"2021-11-11T00:00:00Z":1471,
173
-
"2021-11-12T00:00:00Z":1465,
174
-
"2021-11-13T00:00:00Z":1462,
175
-
"2021-11-14T00:00:00Z":1336,
176
-
"2021-11-15T00:00:00Z":1427,
177
-
"2021-11-16T00:00:00Z":1461,
178
-
"2021-11-17T00:00:00Z":838
78
+
"2024-03-17T00:00:00Z":838,
79
+
// ... daily data
179
80
},
180
81
"month": {
181
-
"2020-12-01T00:00:00Z":44847,
182
-
"2021-01-01T00:00:00Z":44973,
183
-
"2021-02-01T00:00:00Z":43263,
184
-
"2021-03-01T00:00:00Z":59095,
185
-
"2021-04-01T00:00:00Z":56422,
186
-
"2021-05-01T00:00:00Z":50747,
187
-
"2021-06-01T00:00:00Z":46309,
188
-
"2021-07-01T00:00:00Z":46777,
189
-
"2021-08-01T00:00:00Z":48160,
190
-
"2021-09-01T00:00:00Z":47341,
191
-
"2021-10-01T00:00:00Z":46251,
192
-
"2021-11-01T00:00:00Z":24167
82
+
"2024-03-01T00:00:00Z":50747,
83
+
// ... monthly data
193
84
}
194
85
},
195
86
"per_billing_period": [
196
-
{
197
-
"total_images":439,
198
-
"start":"2018-11-02T22:57:29.015Z",
199
-
"end":"2018-12-02T22:57:29.015Z"
200
-
},
201
-
{
202
-
"total_images":3744,
203
-
"start":"2018-12-02T22:57:29.015Z",
204
-
"end":"2019-01-01T22:57:29.015Z"
205
-
},
206
-
{
207
-
"total_images":595,
208
-
"start":"2019-01-01T22:57:29.015Z",
209
-
"end":"2019-01-31T22:57:29.015Z"
210
-
},
211
-
{
212
-
"total_images":123570,
213
-
"start":"2019-01-31T22:57:29.015Z",
214
-
"end":"2019-03-02T22:57:29.015Z"
215
-
},
216
-
{
217
-
"total_images":55398,
218
-
"start":"2019-03-02T22:57:29.015Z",
219
-
"end":"2019-04-01T22:57:29.015Z"
220
-
},
221
87
{
222
88
"total_images":40935,
223
-
"start":"2019-04-01T22:57:29.015Z",
224
-
"end":"2019-05-01T22:57:29.015Z"
89
+
"start":"2024-03-01T00:00:00Z",
90
+
"end":"2024-04-01T00:00:00Z"
225
91
}
92
+
// ... previous billing periods
226
93
]
227
94
}
228
95
```
96
+
97
+
{% include hint.md title="Usage Tracking" text="Consider implementing regular usage checks with this endpoint to monitor trends and plan capacity needs." %}
0 commit comments