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": 5000,
"daily_used": 1200,
"daily_remaining": 3800
}{
"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, plus today’s spend against your organization’s own daily limit when one is set. This endpoint stays readable when either ceiling is reached, 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 report your organization’s own daily spending limit, which admins set in the API console. daily_cap is 0 when no limit is set. See Rate Limits & Credit Limits for how the limit behaves.
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": 5000,
"daily_used": 1200,
"daily_remaining": 3800
}{
"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
The organization's own limit on credits spent per UTC day, set in the API console. A value of 0 means no daily limit is set, and daily_used and daily_remaining are then 0 as well.
5000
Credits spent by API calls today (UTC). The daily limit is a tighter ceiling on the same budget, so this is part of used, not additional to it. Specter Agent and MCP usage is not subject to the limit and is not counted here, though it does count towards used.
1200
Credits left before today's limit is reached.
3800
Was this page helpful?