Usage#

Usage tracking and quotas

Get current usage#

GET/organizations/{org_id}/usage

Get 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#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization 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/history

Get 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#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID
start_datestringqueryNoStart date (YYYY-MM-DD)
end_datestringqueryNoEnd date (YYYY-MM-DD)
offsetintegerqueryNoNumber of items to skip
limitintegerqueryNoMaximum 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}/usage

Get 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#

NameTypeLocationRequiredDescription
project_idstringpathYesProject 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
    }
  ]
}