curl --request GET \
--url https://api.peachdeskai.com/api/v1/sa/billing/margin \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.peachdeskai.com/api/v1/sa/billing/margin"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.peachdeskai.com/api/v1/sa/billing/margin', 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://api.peachdeskai.com/api/v1/sa/billing/margin",
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://api.peachdeskai.com/api/v1/sa/billing/margin"
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://api.peachdeskai.com/api/v1/sa/billing/margin")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peachdeskai.com/api/v1/sa/billing/margin")
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{
"today": {
"calls": 123,
"call_minutes": 123,
"revenue_usd": 123,
"cogs_usd": 123,
"telephony_usd": 123,
"margin_usd": 123,
"failover_usd": 0,
"margin_pct": 123
},
"month": {
"calls": 123,
"call_minutes": 123,
"revenue_usd": 123,
"cogs_usd": 123,
"telephony_usd": 123,
"margin_usd": 123,
"failover_usd": 0,
"margin_pct": 123
},
"price_per_min_usd": 123,
"avg_call_minutes": 123,
"revenue_per_call_usd": 123,
"marginal_cogs_per_call_usd": 123,
"contribution_per_call_usd": 123,
"fixed_daily_cost_usd": 123,
"fixed_daily_gpu_usd": 123,
"fixed_daily_aws_usd": 123,
"aws_monthly_usd": 123,
"aws_cost_basis": "<string>",
"per_org": [
{
"org_id": 123,
"minutes": 123,
"revenue_usd": 123,
"cogs_usd": 123,
"margin_pct": 123
}
],
"fixed_daily_gpu_source": "unmeasured",
"break_even_calls_per_day": 123,
"cogs_unallocated_planes": []
}Call Billing Margin
Flat-call-billing margin: revenue/COGS/margin off call_charges for
today + this calendar month (UTC), the active per-minute price, the daily
break-even call count at the realized CONTRIBUTION margin per call, and
the monthтАЩs per-org top-10 by minutes.
curl --request GET \
--url https://api.peachdeskai.com/api/v1/sa/billing/margin \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.peachdeskai.com/api/v1/sa/billing/margin"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.peachdeskai.com/api/v1/sa/billing/margin', 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://api.peachdeskai.com/api/v1/sa/billing/margin",
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://api.peachdeskai.com/api/v1/sa/billing/margin"
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://api.peachdeskai.com/api/v1/sa/billing/margin")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.peachdeskai.com/api/v1/sa/billing/margin")
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{
"today": {
"calls": 123,
"call_minutes": 123,
"revenue_usd": 123,
"cogs_usd": 123,
"telephony_usd": 123,
"margin_usd": 123,
"failover_usd": 0,
"margin_pct": 123
},
"month": {
"calls": 123,
"call_minutes": 123,
"revenue_usd": 123,
"cogs_usd": 123,
"telephony_usd": 123,
"margin_usd": 123,
"failover_usd": 0,
"margin_pct": 123
},
"price_per_min_usd": 123,
"avg_call_minutes": 123,
"revenue_per_call_usd": 123,
"marginal_cogs_per_call_usd": 123,
"contribution_per_call_usd": 123,
"fixed_daily_cost_usd": 123,
"fixed_daily_gpu_usd": 123,
"fixed_daily_aws_usd": 123,
"aws_monthly_usd": 123,
"aws_cost_basis": "<string>",
"per_org": [
{
"org_id": 123,
"minutes": 123,
"revenue_usd": 123,
"cogs_usd": 123,
"margin_pct": 123
}
],
"fixed_daily_gpu_source": "unmeasured",
"break_even_calls_per_day": 123,
"cogs_unallocated_planes": []
}Authorizations
Interactive user session: the login JWT, sent as Authorization: Bearer <token>.
Response
Successful Response
One window (today / month-to-date) of the ledger.
telephony_usd and failover_usd are OPERATOR-ONLY BREAKOUTS OF
cogs_usd, both sitting below that line and neither added on top of it:
the carrier pass-through and the external-provider cost of a partially
failed-over call are each already inside the total. Neither is, or has ever
been, part of revenue_usd тАФ the retail charge is minutes x price and
nothing else, which
test_revenue_is_byte_identical_whatever_the_failover_slice_is pins at
both the write path and here.
Show child attributes
Show child attributes
One window (today / month-to-date) of the ledger.
telephony_usd and failover_usd are OPERATOR-ONLY BREAKOUTS OF
cogs_usd, both sitting below that line and neither added on top of it:
the carrier pass-through and the external-provider cost of a partially
failed-over call are each already inside the total. Neither is, or has ever
been, part of revenue_usd тАФ the retail charge is minutes x price and
nothing else, which
test_revenue_is_byte_identical_whatever_the_failover_slice_is pins at
both the write path and here.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes

