GET /v1/usage
Retrieve usage statistics for your organization.
Endpoint
GET https://api.glyphnet.io/v1/usageAuthentication
Requires API key in X-API-Key header.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
period | string | No | day, week, month. Default: month |
start_date | string | No | ISO 8601 start date |
end_date | string | No | ISO 8601 end date |
Example Request
import requests
# Get this month's usage
response = requests.get(
"https://api.glyphnet.io/v1/usage",
headers={"X-API-Key": "gn_live_your_key_here"},
params={"period": "month"}
)
usage = response.json()
print(f"Used: {usage['current_usage']:,} / {usage['monthly_limit']:,}")
print(f"Remaining: {usage['remaining']:,}")Response
{
"organization": {
"id": "org_abc123",
"name": "Acme Corp",
"plan": "professional"
},
"period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-01-31T23:59:59Z"
},
"current_usage": 123456,
"monthly_limit": 500000,
"remaining": 376544,
"percentage_used": 24.69,
"rate_limit": {
"requests_per_minute": 500,
"current_minute_usage": 12
},
"breakdown": {
"verify": 110234,
"harm_detect": 13222
},
"daily": [
{
"date": "2024-01-01",
"requests": 4521,
"verified_claims": 12543,
"avg_confidence": 0.923
},
{
"date": "2024-01-02",
"requests": 5123,
"verified_claims": 14231,
"avg_confidence": 0.918
}
]
}Response Fields
Root Object
| Field | Type | Description |
|---|---|---|
organization | object | Organization details |
period | object | Time period for stats |
current_usage | number | Total requests this period |
monthly_limit | number | Plan's monthly limit |
remaining | number | Requests remaining |
percentage_used | number | Usage as percentage |
rate_limit | object | Rate limit details |
breakdown | object | Usage by endpoint |
daily | array | Day-by-day breakdown |
Daily Object
| Field | Type | Description |
|---|---|---|
date | string | Date (YYYY-MM-DD) |
requests | number | Requests on this day |
verified_claims | number | Claims verified |
avg_confidence | number | Average confidence score |
Usage Monitoring Example
import requests
import os
def check_usage_and_alert():
"""Check usage and send alert if over 80%."""
response = requests.get(
"https://api.glyphnet.io/v1/usage",
headers={"X-API-Key": os.environ["GLYPHNET_API_KEY"]}
)
usage = response.json()
percentage = usage["percentage_used"]
if percentage >= 90:
send_alert(f"CRITICAL: {percentage:.1f}% of monthly limit used!")
elif percentage >= 80:
send_alert(f"WARNING: {percentage:.1f}% of monthly limit used")
return {
"used": usage["current_usage"],
"limit": usage["monthly_limit"],
"remaining": usage["remaining"],
"percentage": percentage
}Plan Limits Reference
| Plan | Monthly Limit | Rate Limit |
|---|---|---|
| Free | 1,000 | 60/min |
| Starter | 50,000 | 200/min |
| Professional | 500,000 | 500/min |
| Enterprise | 10,000,000 | 2,000/min |