curl --request GET \
--url https://app.tryspecter.com/api/v1/organization/credits \
--header 'X-API-Key: <api-key>'import requests
url = "https://app.tryspecter.com/api/v1/organization/credits"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://app.tryspecter.com/api/v1/organization/credits', 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.tryspecter.com/api/v1/organization/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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.tryspecter.com/api/v1/organization/credits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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.tryspecter.com/api/v1/organization/credits")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tryspecter.com/api/v1/organization/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"credit_limit": 100000,
"used": 42000,
"remaining": 58000,
"unlimited": false,
"daily_cap": 0,
"daily_used": 0,
"daily_remaining": 0
}{
"errorCode": "API_KEY_MISSING",
"message": "No API Key was presented on the header X-API-KEY"
}{
"errorCode": "<string>",
"message": "<string>"
}Get credit balance
Returns the calling organization’s API credit balance for the current billing window: the provisioned limit, credits used, and credits remaining. This endpoint stays readable when the budget is spent, so you can always check where you stand.
What you need
Nothing beyond your API key. This call is free.
Behaviour
Returns your organization’s current credit balance, so you can check how many credits remain before running a larger job. It does not consume credits.
daily_cap, daily_used and daily_remaining are 0 unless a daily credit limit is set for your organization.
curl --request GET \
--url https://app.tryspecter.com/api/v1/organization/credits \
--header 'X-API-Key: <api-key>'import requests
url = "https://app.tryspecter.com/api/v1/organization/credits"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://app.tryspecter.com/api/v1/organization/credits', 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.tryspecter.com/api/v1/organization/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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.tryspecter.com/api/v1/organization/credits"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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.tryspecter.com/api/v1/organization/credits")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tryspecter.com/api/v1/organization/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"credit_limit": 100000,
"used": 42000,
"remaining": 58000,
"unlimited": false,
"daily_cap": 0,
"daily_used": 0,
"daily_remaining": 0
}{
"errorCode": "API_KEY_MISSING",
"message": "No API Key was presented on the header X-API-KEY"
}{
"errorCode": "<string>",
"message": "<string>"
}Authorizations
Response
The organization's API credit balance for the current billing window.
The provisioned monthly credit budget for the organization. A value of -1 means unlimited.
100000
Credits consumed so far in the current billing window.
42000
Credits left in the current billing window.
58000
Whether the organization has an unlimited credit budget.
false
A limit on credits spent per UTC day, where one is set for the organization. 0 means none is set, and daily_used and daily_remaining are then 0 as well.
0
Credits spent by API calls today (UTC). Against a finite monthly budget the daily limit is a tighter ceiling on the same pool, so this is part of used rather than additional to it. An unlimited budget reports used as 0, and daily_used stands on its own.
0
Credits left before today's limit is reached.
0
Was this page helpful?