Get usage
curl --request GET \
--url https://api.nixflex.com/v1/usageimport requests
url = "https://api.nixflex.com/v1/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.nixflex.com/v1/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://api.nixflex.com/v1/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.nixflex.com/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
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.nixflex.com/v1/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixflex.com/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAccount
Get usage
GET /v1/usage
GET
/
v1
/
usage
Get usage
curl --request GET \
--url https://api.nixflex.com/v1/usageimport requests
url = "https://api.nixflex.com/v1/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.nixflex.com/v1/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://api.nixflex.com/v1/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.nixflex.com/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
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.nixflex.com/v1/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixflex.com/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyReturns your account’s usage totals and current limits: calls, minutes, spend, your rate and concurrency limits, and this month’s peak concurrency.
Or with the SDK:
This endpoint takes no parameters. For usage over a specific date range, list calls with List calls and aggregate by
Request
curl https://api.nixflex.com/v1/usage \
-H "Authorization: Bearer KEY_ID:KEY_SECRET"
const usage = await client.usage.get();
started_at.
Response
200 OK:
{
"plan": "pay_as_you_go",
"total_calls": 891,
"total_minutes": 551.54,
"total_cost": 45.9664,
"rate_limit_per_minute": 300,
"max_concurrent": 40,
"peak_concurrent_this_month": 6,
"rejected_at_cap_this_month": 0
}
| Field | Type | Notes |
|---|---|---|
plan | string | Your billing plan, e.g. pay_as_you_go. |
total_calls | number | Calls on this key, all time. |
total_minutes | number | Fractional minutes - 551.54 is 551 minutes 32 seconds. |
total_cost | number | Nixflex charges in USD, all time. Does not include carrier costs, which Twilio or Telnyx bill you directly. |
rate_limit_per_minute | number | API requests allowed per minute on this key. See Rate limits. |
max_concurrent | number | Simultaneous calls allowed on your account. |
peak_concurrent_this_month | number | The highest number of simultaneous calls reached this month. Use it to see how close you run to the cap. |
rejected_at_cap_this_month | number | Calls refused this month because the concurrency cap was already reached. Anything above zero means you are losing calls - contact us to raise the cap. |
Use cases
- Show total spend and volume in your own admin panel
- Watch
peak_concurrent_this_monthagainstmax_concurrentto plan capacity before a campaign - Alert on
rejected_at_cap_this_monthmoving above zero - the clearest signal you need a higher cap - Reconcile Nixflex charges against your own records
Your credit balance and invoices are in the dashboard under Billing. This endpoint reports usage and limits, not billing state.