Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Get current billing period usage

Retrieve usage statistics for the current billing period

GET/api/v2/billing/usage/current
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Responses
200

Current calendar-month usage and estimated cost returned.

successbooleanrequired
Allowed:true
dataobjectrequired
Show properties
currentMonthMessagesintegerrequired
min 0
currentMonthBandwidthintegerrequired

Bytes., example: 52428800

min 0
dailyMessagesintegerrequired
min 0
estimatedCostnumberrequired

Estimated cost in major currency units., example: 0.05

min 0
billingPeriodStartstring<date-time>required
billingPeriodEndstring<date-time>required
usageResetDatestring<date-time>required
actionAllowanceBillingActionAllowancerequired

This usage month's governed actions. Actions run to graceCap (the allowance plus 10%, plus action packs) and are then refused with QUOTA_EXCEEDED; nothing past the allowance is charged.

Show properties
includedinteger | nullrequired

The plan's allowance. Null when nothing caps actions (Enterprise).

min 0
creditsintegerrequired

Action-pack actions this month can use, those already drawn for it plus what is left unexpired. Packs are valid for 12 months and used after the plan allowance.

min 0
graceCapinteger | nullrequired

Where actions are refused. Null when uncapped.

min 0
usedintegerrequired

Actions run or reserved this month.

min 0
paymentRequiredbooleanrequired

True when the workspace has no plan and actions answer 402.

functionRunsFunctionRunUsage

Hosted function runs this UTC month and running now, against the plan's limits.

Show properties
usedintegerrequired
min 0
runningintegerrequired
min 0
limitsFunctionRunLimitsrequired

Hosted function runs a plan allows. A run's own action calls count as governed actions, not here.

Show properties
runsPerMonthQuotaLimitrequired

Runs started in a UTC month.

Show properties
One of:
integer
integer
string
string
concurrentRunsQuotaLimitrequired

Runs going at the same time across the workspace.

runStartsPerMinuteQuotaLimitrequired

Runs started in any 60 seconds.

availablebooleanrequired

Whether this deployment serves hosted functions yet.

401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

404

Not Found - Resource does not exist

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

429

Too Many Requests - Rate limit exceeded. A workspace's API requests are limited per minute and per UTC clock hour by plan; Retry-After says when to try again, and an hourly refusal names the limit and when the count resets. Successful responses carry the same limits in X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (the minute) and X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour, X-RateLimit-Reset-Hour (the hour).

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
fixErrorFix

How to get past this error, for a person or an agent. Present on refusals with a known next step, such as a missing scope or role, a plan or billing limit, a halted environment, or a missing secret, connected account, OAuth app or end-user header. Absent when there is no fix to give. Kept in production responses, unlike details.

Show properties
summarystringrequired

One sentence that says what to do.

commandstring

An exact anlyon CLI command that fixes it. Absent when no command does.

urlstring<uri>

An absolute console link where a person fixes it.

docsstring<uri>

A docs page that explains it.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.anlyon.com/api/v2/billing/usage/current' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "success": true,
  "data": {
    "currentMonthMessages": 5000,
    "currentMonthBandwidth": 0,
    "dailyMessages": 120,
    "estimatedCost": 0,
    "billingPeriodStart": "2019-08-24T14:15:22Z",
    "billingPeriodEnd": "2019-08-24T14:15:22Z",
    "usageResetDate": "2019-08-24T14:15:22Z",
    "actionAllowance": {
      "included": 0,
      "credits": 0,
      "graceCap": 0,
      "used": 0,
      "paymentRequired": true
    },
    "functionRuns": {
      "used": 140,
      "running": 1,
      "limits": {
        "runsPerMonth": 0,
        "concurrentRuns": 0,
        "runStartsPerMinute": 0
      },
      "available": true
    }
  }
}

Was this page helpful?