Get the usage
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://vms.dev/api/v1/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://vms.dev/api/v1/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://vms.dev/api/v1/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"granularity": "minute",
"unitSeconds": 4503599627370495,
"costMicros": 0,
"points": [
{
"at": "2023-11-07T05:31:56Z",
"unitSeconds": 4503599627370495,
"costMicros": 0
}
],
"funds": {
"creditMicros": 0,
"balanceMicros": 0,
"totalMicros": 0
},
"groups": [
{
"value": "<string>",
"unitSeconds": 4503599627370495,
"costMicros": 0
}
]
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}Billing
Get the usage
Returns the capacity-unit seconds and the cost of each minute, hour, or day in a window, and the credit and the balance of the workspace. Only running time that is not degraded costs money. Needs the billing:read scope.
GET
/
v1
/
usage
Get the usage
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://vms.dev/api/v1/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://vms.dev/api/v1/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://vms.dev/api/v1/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"granularity": "minute",
"unitSeconds": 4503599627370495,
"costMicros": 0,
"points": [
{
"at": "2023-11-07T05:31:56Z",
"unitSeconds": 4503599627370495,
"costMicros": 0
}
],
"funds": {
"creditMicros": 0,
"balanceMicros": 0,
"totalMicros": 0
},
"groups": [
{
"value": "<string>",
"unitSeconds": 4503599627370495,
"costMicros": 0
}
]
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}{
"error": {
"code": "no_capacity",
"message": "<string>",
"requestId": "<string>",
"retryAfterSeconds": 4503599627370495,
"sandboxId": "<string>"
}
}Authorizations
Query Parameters
The start of the window. The default is 24 hours before the end.
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$The end of the window. The default is now.
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$Response
The usage and the funds.