Check Credit Usage
curl --request POST \
--url https://api.nozle.app/engine/api/v1/usage/check \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nozle.app/engine/api/v1/usage/check"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nozle.app/engine/api/v1/usage/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nozle.app/engine/api/v1/usage/check"
req, _ := http.NewRequest("POST", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.nozle.app/engine/api/v1/usage/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nozle.app/engine/api/v1/usage/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}HttpResponse<String> response = Unirest.post("https://api.nozle.app/engine/api/v1/usage/check")
.header("Authorization", "Bearer <token>")
.asString();Product Credits
Check Credit Usage
Calculate an advisory credit decision without mutation
POST
/
engine
/
api
/
v1
/
usage
/
check
Check Credit Usage
curl --request POST \
--url https://api.nozle.app/engine/api/v1/usage/check \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nozle.app/engine/api/v1/usage/check"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nozle.app/engine/api/v1/usage/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nozle.app/engine/api/v1/usage/check"
req, _ := http.NewRequest("POST", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.nozle.app/engine/api/v1/usage/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nozle.app/engine/api/v1/usage/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}HttpResponse<String> response = Unirest.post("https://api.nozle.app/engine/api/v1/usage/check")
.header("Authorization", "Bearer <token>")
.asString();Base URL:
Projected deductions follow the same deterministic expiry, priority, creation
time, and ID ordering as an authoritative consume, but no source or ledger row
is changed. Another request can spend credits before a later track call, so
this endpoint is not authorization to perform irreversible work.
https://api.nozle.app/engine/api/v1.
Auth: secret key only. When your organization has API key permissions, the key requires credit_system:read; a key without it returns 403 permission_denied.
{
"customer_id": "customer_123",
"feature_code": "agent_execution",
"credit_system_code": "ai_credits",
"subscription_id": "sub_pro_123",
"properties": {},
"occurred_at": "2026-07-20T12:00:00.750Z"
}
customer_id and feature_code are required. Add entity_id to check usage for one Entity of the customer. Add subscription_id, the external id of an active subscription of the customer, to choose the subscription that pays; it is optional and is chosen the same way as for Track and Consume Credits. Unknown fields return 400 invalid_request. An unknown Entity returns 404 entity_not_found, an inactive Entity returns 422 entity_inactive, and Entity usage without an explicit pool policy on the plan returns 422 credit_pool_policy_not_configured.
occurred_at is required and must be Unix seconds (a JSON number such as 1788345001 or 1788345001.5, or a numeric string such as "1788345001") or an RFC 3339 string with a time zone offset or Z. A date without a time, a time without an offset, zero or negative seconds, and any other JSON type return 400 invalid_request with occurred_at must be Unix seconds (a number or a numeric string) or an RFC 3339 timestamp with an offset or Z (zero or negative seconds: occurred_at must be greater than zero). A missing value returns 400 invalid_request with occurred_at is required. Unix seconds are available from the Engine release that includes this change; before it, only RFC 3339 is accepted. The SDKs send the current time when you omit it.
A customer with more than one active subscription and neither subscription_id nor entity_id returns 422 active_subscription_ambiguous; the message names subscription_id and entity_id. A customer with no active subscription can still check credits that do not need one, such as paid top-ups. A time with no effective Credit System rate returns 422 with code credit_usage_configuration_invalid and the message no effective credit rate.
The response includes advisory: true, exact metric_amount,
credits_required, the available balance, and the projected source
selection. projected_remaining and projected_deductions appear only when
allowed is true. When allowed is false, reason gives the code, for
example insufficient_credits. entity_id and pool_policy are included when
they apply. Empty fields are omitted.
{
"advisory": true,
"allowed": true,
"metric_amount": "1",
"credit_system": "ai_credits",
"credits_required": "2",
"available": "625",
"projected_remaining": "623",
"projected_deductions": [
{
"balance_source_id": "0f89...",
"source_type": "subscription_grant",
"source_scope": "customer",
"amount": "2",
"remaining": "373"
}
]
}