Usage
Query usage statistics for API keys including token counts, costs, and breakdowns by date, model, or referer.
Get usage summary for an API key
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
API key ID
uuidQuery Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage"{
"first_request_at": "string",
"last_request_at": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by date for an API key
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
API key ID
uuidQuery Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage/by-date"[
{
"date": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by model for an API key
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
API key ID
uuidQuery Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage/by-model"[
{
"model": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by referer for an API key
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
API key ID
uuidQuery Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage/by-referer"[
{
"http_referer": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get cost forecast for an API key
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
API key ID
uuidQuery Parameters
Number of days of historical data to use (default: 30)
int32Number of days to forecast ahead (default: 7)
0 <= valueResponse Body
application/json
application/json
curl -X GET "https://loading/admin/v1/api-keys/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage/forecast"{
"avg_daily_spend": 0.1,
"budget_limit": 0,
"budget_period": "string",
"budget_utilization_percent": 0,
"current_spend": 0.1,
"days_until_exhaustion": 0,
"days_until_exhaustion_lower": 0,
"days_until_exhaustion_upper": 0,
"projected_exhaustion_date": "string",
"projected_period_spend": 0,
"sample_days": 0,
"std_dev_daily_spend": 0.1,
"time_series_forecast": {}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage summary for a project
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Project slug
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/projects/string/usage"{
"first_request_at": "string",
"last_request_at": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by date for a project
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Project slug
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/projects/string/usage/by-date"[
{
"date": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by model for a project
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Project slug
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/projects/string/usage/by-model"[
{
"model": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get cost forecast for a project
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Project slug
Query Parameters
Number of days of historical data to use (default: 30)
int32Number of days to forecast ahead (default: 7)
0 <= valueResponse Body
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/projects/string/usage/forecast"{
"avg_daily_spend": 0.1,
"budget_limit": 0,
"budget_period": "string",
"budget_utilization_percent": 0,
"current_spend": 0.1,
"days_until_exhaustion": 0,
"days_until_exhaustion_lower": 0,
"days_until_exhaustion_upper": 0,
"projected_exhaustion_date": "string",
"projected_period_spend": 0,
"sample_days": 0,
"std_dev_daily_spend": 0.1,
"time_series_forecast": {}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage summary for an organization
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/usage"{
"first_request_at": "string",
"last_request_at": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by date for an organization
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/usage/by-date"[
{
"date": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by model for an organization
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/usage/by-model"[
{
"model": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by provider for an organization
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/usage/by-provider"[
{
"provider": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get cost forecast for an organization
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Organization slug
Query Parameters
Number of days of historical data to use (default: 30)
int32Number of days to forecast ahead (default: 7)
0 <= valueResponse Body
application/json
application/json
curl -X GET "https://loading/admin/v1/organizations/string/usage/forecast"{
"avg_daily_spend": 0.1,
"budget_limit": 0,
"budget_period": "string",
"budget_utilization_percent": 0,
"current_spend": 0.1,
"days_until_exhaustion": 0,
"days_until_exhaustion_lower": 0,
"days_until_exhaustion_upper": 0,
"projected_exhaustion_date": "string",
"projected_period_spend": 0,
"sample_days": 0,
"std_dev_daily_spend": 0.1,
"time_series_forecast": {}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage summary for a provider
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Provider name
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
curl -X GET "https://loading/admin/v1/providers/string/usage"{
"first_request_at": "string",
"last_request_at": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}Get usage by date for a provider
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Provider name
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
curl -X GET "https://loading/admin/v1/providers/string/usage/by-date"[
{
"date": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]Get usage by model for a provider
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Provider name
Query Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
curl -X GET "https://loading/admin/v1/providers/string/usage/by-model"[
{
"model": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]Get cost forecast for a provider
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
Provider name
Query Parameters
Number of days of historical data to use (default: 30)
int32Number of days to forecast ahead (default: 7)
0 <= valueResponse Body
application/json
curl -X GET "https://loading/admin/v1/providers/string/usage/forecast"{
"avg_daily_spend": 0.1,
"budget_limit": 0,
"budget_period": "string",
"budget_utilization_percent": 0,
"current_spend": 0.1,
"days_until_exhaustion": 0,
"days_until_exhaustion_lower": 0,
"days_until_exhaustion_upper": 0,
"projected_exhaustion_date": "string",
"projected_period_spend": 0,
"sample_days": 0,
"std_dev_daily_spend": 0.1,
"time_series_forecast": {}
}Get usage summary for a user
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
User ID
uuidQuery Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage"{
"first_request_at": "string",
"last_request_at": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by date for a user
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
User ID
uuidQuery Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage/by-date"[
{
"date": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get usage by model for a user
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
User ID
uuidQuery Parameters
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Response Body
application/json
application/json
curl -X GET "https://loading/admin/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage/by-model"[
{
"model": "string",
"request_count": 0,
"total_cost": 0.1,
"total_tokens": 0
}
]{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}Get cost forecast for a user
Authorization
api_key API key authentication using Bearer token format
In: header
Path Parameters
User ID
uuidQuery Parameters
Number of days of historical data to use (default: 30)
int32Number of days to forecast ahead (default: 7)
0 <= valueResponse Body
application/json
application/json
curl -X GET "https://loading/admin/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage/forecast"{
"avg_daily_spend": 0.1,
"budget_limit": 0,
"budget_period": "string",
"budget_utilization_percent": 0,
"current_spend": 0.1,
"days_until_exhaustion": 0,
"days_until_exhaustion_lower": 0,
"days_until_exhaustion_upper": 0,
"projected_exhaustion_date": "string",
"projected_period_spend": 0,
"sample_days": 0,
"std_dev_daily_spend": 0.1,
"time_series_forecast": {}
}{
"error": {
"code": "budget_exceeded",
"message": "Budget limit exceeded for monthly period",
"param": null,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "invalid_request_error"
}
}