GET
/api/v1/cost/savingsGet realized cost savings / ROI report
Computes routing/cache savings, risk-prevention value, and time savings from gateway_logs, eval_runs, and security_scans for the period. projectId required; period defaults to 30d.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
projectId in queryrequiredstringperiod in querystringResponse
200 example
{
"success": true,
"data": {
"period": "30 days",
"recommendations": [
{
"title": "<CostRecommendation.description.>",
"impact": "$12.40",
"severity": "critical",
"effort": "<Fixed per recommendation type.>",
"type": "model_downgrade",
"action": "string",
"confidence": 0,
"estimatedSavingsUsd": 0
}
],
"summary": {
"totalEvals": 0,
"totalScans": 0,
"totalGatewayRequests": 0,
"totalSavings": 0,
"routingSavings": 0,
"cacheSavings": 0,
"riskPrevented": 0,
"timeSavingsHours": 0,
"timeSavingsValue": 0
},
"breakdown": {
"smartRouting": {
"description": "string",
"actualCost": 0,
"costIfAllPremium": 0,
"savings": 0,
"savingsPercent": 0,
"totalInputTokens": 0,
"totalOutputTokens": 0
},
"caching": {
"description": "string",
"cacheHits": 0,
"uniqueRequests": 0,
"estimatedSavings": 0
},
"riskPrevention": {
"description": "string",
"criticalVulnerabilities": 0,
"highVulnerabilities": 0,
"estimatedRiskPrevented": 0,
"methodology": "string"
},
"timeSavings": {
"description": "string",
"manualHoursPerRun": 0,
"automatedMinutesPerRun": 0,
"totalHoursSaved": 0,
"estimatedValue": 0,
"methodology": "string"
}
},
"roi": {
"description": "string",
"totalValue": 0,
"plan": "<The org's resolved plan key.>",
"platformCost": 0,
"platformCostBasis": "string",
"roiMultiple": "<e.g. \"4.2x\", \"N/A\", or \"∞ (free plan)\".>"
}
}
}All status codes
200Savings.
400(no description)
401(no description)
403Forbidden — the credential is valid but lacks the API-key scope, member role, or plan entitlement this operation requires.
429(no description)
500Internal Server Error — an unhandled error was converted to the standard error envelope (INTERNAL_ERROR).
Code samples
cURL
curl -X GET \ https://evalguard.ai/api/v1/cost/savings \ -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/cost/savings", {
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/cost/savings", 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/cost/savings", 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)
}Errors
400401403429500