Usage
Usage tracking and quotas
Get current usage
GET
/organizations/{org_id}/usageGet current billing cycle usage and quotas
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/organizations/{org_id}/usage" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"billing_cycle_start": "2025-10-02",
"billing_cycle_end": "2025-10-02",
"metrics": [
{
"metric_type": "search_query",
"current": 5000,
"limit": 10000,
"remaining": 5000,
"percentage": 50
}
],
"is_frozen": true,
"frozen_reason": "Quota exceeded without billing configured"
}Get usage history
GET
/organizations/{org_id}/usage/historyGet historical usage data by billing cycle
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
start_date | string | query | No | Start date (YYYY-MM-DD) |
end_date | string | query | No | End date (YYYY-MM-DD) |
offset | integer | query | No | Number of items to skip |
limit | integer | query | No | Maximum number of items to return |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/organizations/{org_id}/usage/history?start_date=value&end_date=value&offset=value&limit=value" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"data": [
{
"billing_cycle": "2025-10-02",
"metrics": [
{
"metric_type": "search_query",
"total": 0
}
]
}
],
"meta": {
"offset": 0,
"limit": 1,
"total": 0
}
}Get project usage
GET
/projects/{project_id}/usageGet current billing cycle usage for specific project
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
project_id | string | path | Yes | Project ID |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/projects/{project_id}/usage" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"project_id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"billing_cycle_start": "2025-10-02",
"billing_cycle_end": "2025-10-02",
"metrics": [
{
"metric_type": "search_query",
"current": 5000,
"limit": 10000,
"remaining": 5000,
"percentage": 50
}
]
}