space.ai.limits()
Read a project’s plan limits, its own monthly limit, and what it has used this month and this minute.
Reads the project’s plan limits, its own monthly limit, the AI units it has used this month, and the requests and tokens counted this minute.
function limits(options?: CallOptions): Promise<Limits>Parameters
options.signalAbortSignalCancels the call.
options.timeoutMsnumberHow long the call may take, in milliseconds. The
timeoutMsset increateSpacewhen you leave it out, 30,000 by default.
Returns
A promise of the project’s limits:
{
"plan": {
"code": "free",
"name": "Free",
"unitsPerMonth": 100000,
"requestsPerMinute": 20,
"tokensPerMinute": 40000
},
"own": {
"unitsPerMonth": 50000,
"updatedBy": "01m3c081d2wj4g63qcr53pa1yh",
"updatedAt": "2026-09-29T10:15:00Z"
},
"month": { "start": "2026-09-01", "used": 4200, "reserved": 120 },
"minute": { "start": "2026-09-29T10:15:00Z", "requests": 3, "tokens": 12500 }
}plan.codestringThe plan’s code, such as
free.plan.namestringThe plan’s name, such as
Free.plan.unitsPerMonthnumberThe most AI units the plan allows in a month. In every plan limit, 0 means no limit.
plan.requestsPerMinutenumberThe most calls the project can send in a minute.
plan.tokensPerMinutenumberThe most tokens the project’s calls can ask for in a minute: each call’s input, and its
maxTokensof output.ownobject or nullThe project’s own limit, or
nullif it never had one. The lower of it and the plan’s applies.own.unitsPerMonthisnullwhen it was removed, and 0 stops AI for the project.own.updatedByandown.updatedAtsay who set it and when.month.startstringThe first day of this month, in UTC, such as
2026-09-01.month.usednumberThe AI units calls used this month.
month.reservednumberUnits set aside for calls in progress. See How a call is checked.
minute.startstringWhen this minute started, as an ISO 8601 string.
minute.requestsnumberThe calls counted so far in this minute.
minute.tokensnumberThe tokens those calls asked for: their input, and their
maxTokensof output.
The project’s own limit is set in the console. See Set a monthly limit of your own.
Errors
| Code | When |
|---|---|
forbidden | The key may not view usage and limits in the project |
Every call can also fail with the codes shared by all of space, such as missing_project or network_error. See SpaceError.
Example
import { space } from "digitospace"
const limits = await space.ai.limits()
console.log(`${limits.month.used} of ${limits.plan.unitsPerMonth} AI units used this month`)
console.log(`${limits.minute.requests} of ${limits.plan.requestsPerMinute} requests this minute`)
if (limits.own?.unitsPerMonth != null) {
console.log(`Own limit: ${limits.own.unitsPerMonth} AI units a month`)
}Last updated