/api/v1/billing/usageGet billable usage for current period
Returns current-month usage against plan limits for an org. `?orgId` is required (400 otherwise) and the caller must hold the org `admin` role or above. Up to three meters are reported — `evals` (eval_runs this UTC month vs `evalsPerMonth`), `security_scans` (vs `redTeamScansPerMonth`) and `seats` (org_members vs `teamMembers`) — each as `{resource, used, limit, percentage, status}` where status is `warning` at 80% or more and `exceeded` at 100% or more for `evals` and `security_scans` (unlimited plans report `limit: Infinity`, status `ok`). `seats` is the exception: it turns `exceeded` only when members STRICTLY exceed the cap, and a 1-seat plan stays `ok` at 100%. The `evals` and `security_scans` meters are omitted entirely when the org owns no projects, so a fresh org sees `seats` alone. Response also carries `period` (YYYY-MM), `hasWarnings` and `hasExceeded`. No token, trace, gateway-request or dataset meter, and no overage calculation. Passing `?alerts=true` additionally fires usage-alert emails to the org's owners/admins (fire-and-forget).
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
orgId in queryrequiredOrg to fetch usage for.
stringalerts in queryWhen true, also fires usage-threshold alerts to org admins.
booleanResponse
200 example
{
"success": true
}All status codes
Code samples
cURL
curl -X GET \ https://evalguard.ai/api/v1/billing/usage \ -H "Authorization: Bearer $EVALGUARD_API_KEY"
TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
const res = await fetch("https://evalguard.ai/api/v1/billing/usage", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
response = requests.request("GET", "https://evalguard.ai/api/v1/billing/usage", headers=headers)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequestWithContext(context.Background(), "GET", "https://evalguard.ai/api/v1/billing/usage", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}