# Get top API keys by usage Retrieve the top-performing API keys for an organization, ranked by total cost for a specified month. #### Path Parameters **`org_id`** string required The organization ID. **`month`** integer required Month (1-12). **`year`** integer required Year (e.g., 2025). #### Query Parameters **`limit`** integer Number of top keys to return. Default: `10`. Range: 1-100. **`period`** string Period type. Default: `monthly`. Options: `daily`, `monthly`. #### Returns Returns a list of top API keys with usage metrics including total requests, cost, synapses, and neurons. ```bash curl "https://api.aitronos.com/v1/analytics/org_abc123/api-keys/top/11/2025?limit=5" \ -H "X-API-Key: $FREDDY_API_KEY" ``` ```python import os import requests api_key = os.environ["FREDDY_API_KEY"] org_id = "org_abc123" response = requests.get( f"https://api.aitronos.com/v1/analytics/{org_id}/api-keys/top/11/2025", params={"limit": 5}, headers={"X-API-Key": api_key} ) ``` ```javascript const response = await fetch( "https://api.aitronos.com/v1/analytics/org_abc123/api-keys/top/11/2025?limit=5", { headers: { "X-API-Key": process.env.FREDDY_API_KEY } } ); ``` ### Response ```json { "organization_id": "org_abc123", "period": { "type": "monthly", "month": 11, "year": 2025, "start_date": "2025-11-01", "end_date": "2025-11-30" }, "top_keys": [ { "api_key_id": "ak_xyz789", "key_name": "Production API Key", "total_requests": 15420, "total_cost": 245.67, "total_synapses": 1250000.0, "total_neurons": 850000.0 }, { "api_key_id": "ak_abc456", "key_name": "Development Key", "total_requests": 8930, "total_cost": 142.35, "total_synapses": 720000.0, "total_neurons": 490000.0 }, { "api_key_id": "ak_def123", "key_name": "Testing Key", "total_requests": 3210, "total_cost": 48.92, "total_synapses": 280000.0, "total_neurons": 195000.0 } ], "total_keys": 3, "limit": 5 } ```