Get usage
SDK platic.tools.functions.usage()
Read today's and the month's calls, created functions, and today's deployments. The response includes the limits for each usage category.
Example
curl "https://api.platic.ai/v1/tools/functions/usage" \
-H "Authorization: Bearer $PLATIC_API_KEY" await platic.tools.functions.usage(); Response
{
"status": "success",
"data": {
"usage": { "today": 132, "month": 2840, "functions": 3, "deploysToday": 4 },
"limits": {
"functionsPerWorkspace": 20,
"callsPerMinutePerFunction": 60,
"callsPerDayPerWorkspace": 5000,
"callsPerMonthPerWorkspace": 50000,
"deploysPerDayPerWorkspace": 50,
"timeoutSeconds": { "min": 1, "max": 60, "default": 20 },
"memoryMb": 256,
"inputBytes": 256000,
"outputBytes": 256000,
"sourceBytes": 100000,
"httpCallsPerRun": 20,
"httpTimeoutSeconds": 15,
"httpResponseBytes": 2000000,
"allowedDomains": 10,
"secretSlots": 10
}
}
} Response fields
| Field | Description |
|---|---|
usage.today | Today's calls |
usage.month | This month's calls |
usage.functions | The workspace's functions |
usage.deploysToday | Today's publications and tests |
limits.functionsPerWorkspace | Functions per workspace |
limits.callsPerMinutePerFunction | Calls per minute to a single function |
limits.callsPerDayPerWorkspace, callsPerMonthPerWorkspace | The workspace's calls per day and per month |
limits.deploysPerDayPerWorkspace | Publications and tests per day |
limits.timeoutSeconds | Time per execution: min, max and default, in seconds |
limits.memoryMb | Memory of each execution |
limits.inputBytes, outputBytes | Maximum size of the input and the output |
limits.sourceBytes | Maximum size of the code |
limits.httpCallsPerRun, httpTimeoutSeconds, httpResponseBytes | HTTP calls per execution, wait per call and size of each response |
limits.allowedDomains, secretSlots | Domains and secret slots per function |
Errors
| Status | details.code | When |
|---|---|---|
403 | FORBIDDEN | The person behind the token does not have access to Integrations |
Notes
- When a call or deployment limit is exceeded, the response is
429 LIMIT_REACHEDwithdetails.limitanddetails.resetAt. An agent that calls a function at that moment gets the same error and should not retry. - Limits can change. Read them from this response instead of hardcoding them.