Cloud usage
Revised
curl 'https://ollama.com/api/usage?range=24h' \
-H "Authorization: Bearer $OLLAMA_API_KEY"
{
"range": "24h",
"scope": "self",
"granularity": "hour",
"from": "2026-09-30T02:00:00Z",
"until": "2026-10-01T02:30:00Z",
"totals": {
"request_count": 15,
"usage_usd": 0.01718,
"input_tokens": 106000,
"cached_input_tokens": 46000,
"output_tokens": 13600
},
"buckets": [
{
"from": "2026-09-30T12:00:00Z",
"until": "2026-09-30T13:00:00Z",
"request_count": 4,
"usage_usd": 0.0052,
"input_tokens": 24000,
"cached_input_tokens": 0,
"output_tokens": 3200
},
{
"from": "2026-10-01T00:00:00Z",
"until": "2026-10-01T01:00:00Z",
"request_count": 8,
"usage_usd": 0.0088,
"input_tokens": 64000,
"cached_input_tokens": 40000,
"output_tokens": 8000
},
{
"from": "2026-10-01T02:00:00Z",
"until": "2026-10-01T02:30:00Z",
"partial": true,
"request_count": 3,
"usage_usd": 0.00318,
"input_tokens": 18000,
"cached_input_tokens": 6000,
"output_tokens": 2400
}
]
}
New usage can1 take time to appear.?1
For your remaining included and purchased credits, use Balance.
Unsupported or repeated query parameters return 400. Errors follow Ollama's JSON error format.
Time ranges
| Range | Starts at | Bucket size | Buckets |
|---|---|---|---|
24h |
24 hours before the start of the current UTC hour | Hour | 25 |
7d |
Seven days ago at 00:00 UTC | Day | 8 |
30d |
Thirty days ago at 00:00 UTC | Day | 31 |
Every range ends at the time of the request. For example, at 02:30 UTC on October 1, 24h starts at 02:00 UTC on September 30. It returns 24 complete hourly buckets followed by the current 02:00–02:30 bucket. The 7d and 30d ranges return seven and 302 complete days, followed by today so far.
Buckets appear in chronological order, including zeroes for hours or days with no recorded requests. The final bucket covers the current hour or day and has partial: true.
All timestamps are in UTC. Each from is inclusive and each until is exclusive.
Usage totals and buckets
totals summarizes usage across the entire range. buckets breaks that usage into hours or days.
granularity is set automatically: hour for 24h and day for 7d and 30d. The top-level from and until describe the entire range. Each3 bucket has its own boundaries.
partial indicates whether the hour or day is still in progress, rather than whether all usage has been recorded.
Model breakdown
Add group_by=model to see usage by model:
curl 'https://ollama.com/api/usage?range=7d&group_by=model' \
-H "Authorization: Bearer $OLLAMA_API_KEY"
The response includes groups in both totals and every bucket.
{
"totals": {
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 12,
"usage_usd": 0.0132
}
]
},
"buckets": [
{
"from": "2026-09-30T00:00:00Z",
"until": "2026-10-01T00:00:00Z",
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 6,
"usage_usd": 0.0066
}
]
}
]
}
Example with multiple models and buckets4
{
"range": "7d",
"scope": "self",
"granularity": "day",
"group_by": "model",
"from": "2026-09-24T00:00:00Z",
"until": "2026-10-01T02:30:00Z",
"totals": {
"request_count": 16,
"usage_usd": 0.0268,
"input_tokens": 116000,
"cached_input_tokens": 60000,
"output_tokens": 15000,
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 12,
"usage_usd": 0.0132,
"input_tokens": 96000,
"cached_input_tokens": 60000,
"output_tokens": 12000
},
{
"model": "glm-5.3",
"request_count": 2,
"usage_usd": 0.01,
"input_tokens": 4000,
"cached_input_tokens": 0,
"output_tokens": 1000
},
{
"model": "gpt-oss:120b",
"request_count": 2,
"usage_usd": 0.0036,
"input_tokens": 16000,
"cached_input_tokens": 0,
"output_tokens": 2000
}
]
},
"buckets": [
{
"from": "2026-09-30T00:00:00Z",
"until": "2026-10-01T00:00:00Z",
"request_count": 8,
"usage_usd": 0.0166,
"input_tokens": 52000,
"cached_input_tokens": 30000,
"output_tokens": 7000,
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 6,
"usage_usd": 0.0066,
"input_tokens": 48000,
"cached_input_tokens": 30000,
"output_tokens": 6000
},
{
"model": "glm-5.3",
"request_count": 2,
"usage_usd": 0.01,
"input_tokens": 4000,
"cached_input_tokens": 0,
"output_tokens": 1000
}
]
},
{
"from": "2026-10-01T00:00:00Z",
"until": "2026-10-01T02:30:00Z",
"partial": true,
"request_count": 8,
"usage_usd": 0.0102,
"input_tokens": 64000,
"cached_input_tokens": 30000,
"output_tokens": 8000,
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 6,
"usage_usd": 0.0066,
"input_tokens": 48000,
"cached_input_tokens": 30000,
"output_tokens": 6000
},
{
"model": "gpt-oss:120b",
"request_count": 2,
"usage_usd": 0.0036,
"input_tokens": 16000,
"cached_input_tokens": 0,
"output_tokens": 2000
}
]
}
]
}
Currently, up to 10 groups appear under groups, ranked by total usage_usd across the range.
Every bucket uses the same selection and order. Groups with no requests in a bucket are omitted. An empty bucket has groups: [].5
Additional groups are combined under remainder, omitted when empty. Totals always include all usage.
Legacy plans
For usage that includes requests from legacy plans, only request counts are available. If the range includes legacy requests, groups are ranked by request count instead of cost.
Rate limits
X40This endpoint allows 10 requests per minute per user, shared across API keys and devices. We recommend polling once per minute. A 429 response includes a Retry-After header with the number of seconds to wait before retrying.
Team usage
By default, everyone sees their own usage (scope=self).
Team admins can use scope=team to see usage for the whole team:
curl 'https://ollama.com/api/usage?range=7d&scope=team' \
-H "Authorization: Bearer $OLLAMA_API_KEY"
Coming soon
We plan to add custom time ranges, usage breakdowns by API key, and breakdowns by team member for team admins.?2
Reference?3
Notes on this page
1 Wording Audit: improved Uses can for what is possible; the meaning is unchanged.
Was:
mayterm-may-can-might2 Wording Audit: improved The standard uses numerals for 10 and up.
Was:
thirtySpelledNumbers3 Wording Audit: improved Splits the sentence in two instead of joining them with a semicolon.
Was:
; eachSemicolon4 Structure Audit: improved This heading and the Legacy plans heading went from level 2 straight to level 4; both are now level 3.
Was:
#### Example with multiple models and bucketslong-no-skipped-levels5 Wording Audit: improved Splits the sentence in two instead of joining them with a semicolon.
Was:
Groups with no requests in a bucket are omitted; an empty bucket hasgroups: [].Semicolon
Questions for the owner
?1 How long can new usage take to appear, so the page can give a number?
About: “New usage may take time to appear.”
?2 Should the Coming soon section stay, since it states product plans without dates or a commitment?
About: “We plan to add custom time ranges, usage breakdowns by API key, and breakdowns by team member for team admins.”
?3 The page ends with a Reference heading that has nothing under it; what content belongs there?
About: “## Reference”
X40 Rate limit paragraph on Balance and Cloud usage. The same rate limit text appears on both endpoint pages. Is the limit separate for each endpoint or shared between them, and should one section state it?
Pages: Balance, Cloud usage
Original
curl 'https://ollama.com/api/usage?range=24h' \
-H "Authorization: Bearer $OLLAMA_API_KEY"
{
"range": "24h",
"scope": "self",
"granularity": "hour",
"from": "2026-09-30T02:00:00Z",
"until": "2026-10-01T02:30:00Z",
"totals": {
"request_count": 15,
"usage_usd": 0.01718,
"input_tokens": 106000,
"cached_input_tokens": 46000,
"output_tokens": 13600
},
"buckets": [
{
"from": "2026-09-30T12:00:00Z",
"until": "2026-09-30T13:00:00Z",
"request_count": 4,
"usage_usd": 0.0052,
"input_tokens": 24000,
"cached_input_tokens": 0,
"output_tokens": 3200
},
{
"from": "2026-10-01T00:00:00Z",
"until": "2026-10-01T01:00:00Z",
"request_count": 8,
"usage_usd": 0.0088,
"input_tokens": 64000,
"cached_input_tokens": 40000,
"output_tokens": 8000
},
{
"from": "2026-10-01T02:00:00Z",
"until": "2026-10-01T02:30:00Z",
"partial": true,
"request_count": 3,
"usage_usd": 0.00318,
"input_tokens": 18000,
"cached_input_tokens": 6000,
"output_tokens": 2400
}
]
}
New usage may take time to appear.
For your remaining included and purchased credits, use Balance.
Unsupported or repeated query parameters return 400. Errors follow Ollama's JSON error format.
Time ranges
| Range | Starts at | Bucket size | Buckets |
|---|---|---|---|
24h |
24 hours before the start of the current UTC hour | Hour | 25 |
7d |
Seven days ago at 00:00 UTC | Day | 8 |
30d |
Thirty days ago at 00:00 UTC | Day | 31 |
Every range ends at the time of the request. For example, at 02:30 UTC on October 1, 24h starts at 02:00 UTC on September 30. It returns 24 complete hourly buckets followed by the current 02:00–02:30 bucket. The 7d and 30d ranges return seven and thirty complete days, followed by today so far.
Buckets appear in chronological order, including zeroes for hours or days with no recorded requests. The final bucket covers the current hour or day and has partial: true.
All timestamps are in UTC. Each from is inclusive and each until is exclusive.
Usage totals and buckets
totals summarizes usage across the entire range. buckets breaks that usage into hours or days.
granularity is set automatically: hour for 24h and day for 7d and 30d. The top-level from and until describe the entire range; each bucket has its own boundaries.
partial indicates whether the hour or day is still in progress, rather than whether all usage has been recorded.
Model breakdown
Add group_by=model to see usage by model:
curl 'https://ollama.com/api/usage?range=7d&group_by=model' \
-H "Authorization: Bearer $OLLAMA_API_KEY"
The response includes groups in both totals and every bucket.
{
"totals": {
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 12,
"usage_usd": 0.0132
}
]
},
"buckets": [
{
"from": "2026-09-30T00:00:00Z",
"until": "2026-10-01T00:00:00Z",
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 6,
"usage_usd": 0.0066
}
]
}
]
}
Example with multiple models and buckets
{
"range": "7d",
"scope": "self",
"granularity": "day",
"group_by": "model",
"from": "2026-09-24T00:00:00Z",
"until": "2026-10-01T02:30:00Z",
"totals": {
"request_count": 16,
"usage_usd": 0.0268,
"input_tokens": 116000,
"cached_input_tokens": 60000,
"output_tokens": 15000,
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 12,
"usage_usd": 0.0132,
"input_tokens": 96000,
"cached_input_tokens": 60000,
"output_tokens": 12000
},
{
"model": "glm-5.3",
"request_count": 2,
"usage_usd": 0.01,
"input_tokens": 4000,
"cached_input_tokens": 0,
"output_tokens": 1000
},
{
"model": "gpt-oss:120b",
"request_count": 2,
"usage_usd": 0.0036,
"input_tokens": 16000,
"cached_input_tokens": 0,
"output_tokens": 2000
}
]
},
"buckets": [
{
"from": "2026-09-30T00:00:00Z",
"until": "2026-10-01T00:00:00Z",
"request_count": 8,
"usage_usd": 0.0166,
"input_tokens": 52000,
"cached_input_tokens": 30000,
"output_tokens": 7000,
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 6,
"usage_usd": 0.0066,
"input_tokens": 48000,
"cached_input_tokens": 30000,
"output_tokens": 6000
},
{
"model": "glm-5.3",
"request_count": 2,
"usage_usd": 0.01,
"input_tokens": 4000,
"cached_input_tokens": 0,
"output_tokens": 1000
}
]
},
{
"from": "2026-10-01T00:00:00Z",
"until": "2026-10-01T02:30:00Z",
"partial": true,
"request_count": 8,
"usage_usd": 0.0102,
"input_tokens": 64000,
"cached_input_tokens": 30000,
"output_tokens": 8000,
"groups": [
{
"model": "glm-5.3-flash",
"request_count": 6,
"usage_usd": 0.0066,
"input_tokens": 48000,
"cached_input_tokens": 30000,
"output_tokens": 6000
},
{
"model": "gpt-oss:120b",
"request_count": 2,
"usage_usd": 0.0036,
"input_tokens": 16000,
"cached_input_tokens": 0,
"output_tokens": 2000
}
]
}
]
}
Currently, up to 10 groups appear under groups, ranked by total usage_usd across the range.
Every bucket uses the same selection and order. Groups with no requests in a bucket are omitted; an empty bucket has groups: [].
Additional groups are combined under remainder, omitted when empty. Totals always include all usage.
Legacy plans
For usage that includes requests from legacy plans, only request counts are available. If the range includes legacy requests, groups are ranked by request count instead of cost.
Rate limits
This endpoint allows 10 requests per minute per user, shared across API keys and devices. We recommend polling once per minute. A 429 response includes a Retry-After header with the number of seconds to wait before retrying.
Team usage
By default, everyone sees their own usage (scope=self).
Team admins can use scope=team to see usage for the whole team:
curl 'https://ollama.com/api/usage?range=7d&scope=team' \
-H "Authorization: Bearer $OLLAMA_API_KEY"
Coming soon
We plan to add custom time ranges, usage breakdowns by API key, and breakdowns by team member for team admins.
Reference
What Changed
Two semicolon sentences become two sentences each, a spelled-out number becomes a numeral, and the example and legacy plan headings no longer skip a heading level. Three questions go to the owner: how long new usage takes to appear, whether to keep the Coming soon section, and what the empty Reference heading at the end should hold. The shared rate limit paragraph is attached as an inventory question.
Content type: reference. The page documents one API endpoint: its request, response fields, parameters, limits, and examples.
Automated check, original: 0 errors, 1 warnings, 2 suggestions. Revised: 0 errors, 0 warnings, 0 suggestions.
Independent audit (GPT-6): improved. The revision makes the page easier to scan and follows the standard’s number and sentence guidance. I found no meaning changes or broken links in the listed edits.
What the revision missed:
- The rate-limit paragraph states a precise limit of 10 requests per minute but gives no source, despite the standard requiring a source beside every statistic.
Structure (1)
- 4 This heading and the Legacy plans heading went from level 2 straight to level 4; both are now level 3. improved