curl --request GET \
--url https://{subdomain}.mihu.ai/api/v1/workspace/billing \
--header 'Authorization: Bearer <token>'import requests
url = "https://{subdomain}.mihu.ai/api/v1/workspace/billing"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{subdomain}.mihu.ai/api/v1/workspace/billing', 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://{subdomain}.mihu.ai/api/v1/workspace/billing",
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: Bearer <token>"
],
]);
$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://{subdomain}.mihu.ai/api/v1/workspace/billing"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{subdomain}.mihu.ai/api/v1/workspace/billing")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/workspace/billing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"currency": "EUR",
"has_custom_pricing": true,
"plan": {
"id": 4,
"name": "Pro",
"status": "active",
"seats": 1,
"price": {
"amount": "600.0000",
"currency": "EUR",
"interval": "month",
"total": "600.0000"
},
"trial_ends_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
},
"usage": [
{
"key": "voice",
"label": "AI voice usage",
"amount": "0.1800",
"unit": "minute",
"billed": true
}
],
"actions": {
"included": 30000,
"amount": "0.0040",
"unit": "action",
"billed": true
},
"agents": {
"ai_agents_included": 6,
"live_agent_seats_included": 20,
"additional_agent_cost": "75.0000"
},
"wallet": {
"uuid": "<string>",
"balance": "390.7540",
"currency": "EUR",
"auto_topup": {
"enabled": true,
"threshold": "<string>",
"amount": "<string>",
"last_success_at": "2023-11-07T05:31:56Z"
}
},
"packages": {
"expires_at": "2023-11-07T05:31:56Z",
"is_expired": true,
"items": [
{
"key": "voice",
"label": "Voice minutes",
"remaining": 1250.5,
"unit": "minute",
"remaining_seconds": 123
}
]
},
"payments": {
"last": {},
"next": {
"date": "2023-11-07T05:31:56Z",
"amount": "<string>",
"currency": "<string>"
},
"history": [
{
"amount": "<string>",
"currency": "<string>",
"status": "paid",
"method": "<string>",
"date": "2023-11-07T05:31:56Z",
"invoice_number": "<string>",
"invoice_pdf_url": "<string>"
}
]
}
}
}Plan, rates, packages, wallet and payments in one read
Everything commercial about this workspace, so a billing screen or an invoice reconciliation can be built from a single request.
What comes back
plan— which plan the workspace is on, what it costs per seat and per interval, and where the subscription stands.usage— the price of every unit of usage. This is what the workspace is charged, with any negotiated pricing already applied.actions— the monthly automation-flow allowance and the price beyond it.agents— how many AI agents and live agent seats the plan includes, and the price of an extra AI agent.- Calls and SMS are priced by destination rather than by a single figure — see
/api/v1/phone-numbers/ratesand/api/v1/sms/rates. Those rates apply only to traffic that goes through our telephony; bring your own carrier or SIP trunk and that provider bills you instead. wallet— the current balance and the auto top-up settings.packages— prepaid units still unused, and when they expire.payments— the last payment taken, the next one due, and recent history.
Two things worth knowing
billed: false on a usage row means the price is published and agreed but nothing raises a charge for it yet. Treat those as forthcoming, not as something appearing on an invoice today.
has_custom_pricing tells you whether the rates in usage come from a negotiated agreement rather than the plan’s standard ladder. The rates themselves already reflect it either way; the flag exists so you can label them.
Access
A workspace API token is required. A member’s own token is refused even when it carries a matching scope, because these are terms for the account rather than anything belonging to one person.
curl --request GET \
--url https://{subdomain}.mihu.ai/api/v1/workspace/billing \
--header 'Authorization: Bearer <token>'import requests
url = "https://{subdomain}.mihu.ai/api/v1/workspace/billing"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{subdomain}.mihu.ai/api/v1/workspace/billing', 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://{subdomain}.mihu.ai/api/v1/workspace/billing",
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: Bearer <token>"
],
]);
$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://{subdomain}.mihu.ai/api/v1/workspace/billing"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{subdomain}.mihu.ai/api/v1/workspace/billing")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/workspace/billing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"currency": "EUR",
"has_custom_pricing": true,
"plan": {
"id": 4,
"name": "Pro",
"status": "active",
"seats": 1,
"price": {
"amount": "600.0000",
"currency": "EUR",
"interval": "month",
"total": "600.0000"
},
"trial_ends_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
},
"usage": [
{
"key": "voice",
"label": "AI voice usage",
"amount": "0.1800",
"unit": "minute",
"billed": true
}
],
"actions": {
"included": 30000,
"amount": "0.0040",
"unit": "action",
"billed": true
},
"agents": {
"ai_agents_included": 6,
"live_agent_seats_included": 20,
"additional_agent_cost": "75.0000"
},
"wallet": {
"uuid": "<string>",
"balance": "390.7540",
"currency": "EUR",
"auto_topup": {
"enabled": true,
"threshold": "<string>",
"amount": "<string>",
"last_success_at": "2023-11-07T05:31:56Z"
}
},
"packages": {
"expires_at": "2023-11-07T05:31:56Z",
"is_expired": true,
"items": [
{
"key": "voice",
"label": "Voice minutes",
"remaining": 1250.5,
"unit": "minute",
"remaining_seconds": 123
}
]
},
"payments": {
"last": {},
"next": {
"date": "2023-11-07T05:31:56Z",
"amount": "<string>",
"currency": "<string>"
},
"history": [
{
"amount": "<string>",
"currency": "<string>",
"status": "paid",
"method": "<string>",
"date": "2023-11-07T05:31:56Z",
"invoice_number": "<string>",
"invoice_pdf_url": "<string>"
}
]
}
}
}Authorizations
Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"