curl --request GET \
--url https://app.miget.com/api/v1/workspace/usage \
--header 'Authorization: <api-key>'import requests
url = "https://app.miget.com/api/v1/workspace/usage"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.miget.com/api/v1/workspace/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.miget.com/api/v1/workspace/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.miget.com/api/v1/workspace/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.miget.com/api/v1/workspace/usage")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/workspace/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"billed_in_cents": 123,
"pending_in_cents": 123,
"total_in_cents": 123,
"minimum_in_cents": 123,
"projected_in_cents": 123,
"limit_reached_on": "2023-12-25",
"spend_limit_in_cents": 123,
"spend_limit_floor_in_cents": 123,
"pay_per_use_enabled": true,
"charge_threshold_in_cents": 123,
"charged_early_in_cents": 123,
"credits_applied_in_cents": 123,
"due_after_first_payment_in_cents": 123,
"cycle_start": "<string>",
"cycle_end": "<string>",
"billed_through": "<string>",
"workloads": [
{
"workload_type": "<string>",
"workload_id": 123,
"name": "<string>",
"amount_in_cents": 123,
"resources": {}
}
],
"adjustments": [
{
"amount_in_cents": 123,
"note": "<string>",
"made_at": "<string>"
}
]
}Read this cycle's usage
Returns what the workspace’s workloads on Usage Billing have run up this billing cycle, broken down by workload, together with the monthly minimum, the spend limit, the threshold at which usage is charged before the renewal and what was charged at it, and any adjustments made to it. A workspace running nothing on Usage Billing answers with zeroes and no workloads. An enterprise contract has no usage bill and is refused with 422.
curl --request GET \
--url https://app.miget.com/api/v1/workspace/usage \
--header 'Authorization: <api-key>'import requests
url = "https://app.miget.com/api/v1/workspace/usage"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.miget.com/api/v1/workspace/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.miget.com/api/v1/workspace/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.miget.com/api/v1/workspace/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.miget.com/api/v1/workspace/usage")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/workspace/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"billed_in_cents": 123,
"pending_in_cents": 123,
"total_in_cents": 123,
"minimum_in_cents": 123,
"projected_in_cents": 123,
"limit_reached_on": "2023-12-25",
"spend_limit_in_cents": 123,
"spend_limit_floor_in_cents": 123,
"pay_per_use_enabled": true,
"charge_threshold_in_cents": 123,
"charged_early_in_cents": 123,
"credits_applied_in_cents": 123,
"due_after_first_payment_in_cents": 123,
"cycle_start": "<string>",
"cycle_end": "<string>",
"billed_through": "<string>",
"workloads": [
{
"workload_type": "<string>",
"workload_id": 123,
"name": "<string>",
"amount_in_cents": 123,
"resources": {}
}
],
"adjustments": [
{
"amount_in_cents": 123,
"note": "<string>",
"made_at": "<string>"
}
]
}Authorizations
Response
Read this cycle's usage
Api_V1_Entities_WorkspaceUsage model
Unbilled usage beyond the minimum is charged to the card whenever it reaches this amount, rather than waiting for the renewal. It starts at 2500 and each paid renewal raises it a step (5000, 25000, 100000, 400000); during a free trial, until a charge in it is paid, it is 500. A value Miget set for the workspace, on an approved limit increase or otherwise, replaces the ladder; null once usage is charged with the renewal alone, and before the subscription's first payment, when nothing is charged. A refused charge stops the workspace's workloads on Usage Billing until it is paid
What the workspace's credits pay of this cycle's usage beyond the minimum, before the card: what they paid of the hours already sent to billing, plus what the balance left covers of the rest, the hour in progress included. The renewal and the threshold bill only the usage beyond the minimum and these credits
Usage that ran before the subscription's first payment, as during an onboarding Miget set up, and is not billed yet: all of it, with no monthly minimum taken off, is charged to the card right after that payment, the workspace's credits paying first. 0 once the subscription is paid

