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

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

FieldDescription
usage.todayToday's calls
usage.monthThis month's calls
usage.functionsThe workspace's functions
usage.deploysTodayToday's publications and tests
limits.functionsPerWorkspaceFunctions per workspace
limits.callsPerMinutePerFunctionCalls per minute to a single function
limits.callsPerDayPerWorkspace, callsPerMonthPerWorkspaceThe workspace's calls per day and per month
limits.deploysPerDayPerWorkspacePublications and tests per day
limits.timeoutSecondsTime per execution: min, max and default, in seconds
limits.memoryMbMemory of each execution
limits.inputBytes, outputBytesMaximum size of the input and the output
limits.sourceBytesMaximum size of the code
limits.httpCallsPerRun, httpTimeoutSeconds, httpResponseBytesHTTP calls per execution, wait per call and size of each response
limits.allowedDomains, secretSlotsDomains and secret slots per function

Errors

Statusdetails.codeWhen
403FORBIDDENThe person behind the token does not have access to Integrations

Notes

  • When a call or deployment limit is exceeded, the response is 429 LIMIT_REACHED with details.limit and details.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.