# Get API key usage summary Monthly summary of API key usage (programmatic access only). #### Path Parameters **`org_id`** string required The organization ID. #### Query Parameters **`year`** integer optional Year (2020-2030). Defaults to current year. **`month`** integer optional Month (1-12). Defaults to current month. ## Returns Returns monthly API key usage summary with total requests, costs, synapses, and neurons. ```bash curl "https://api.aitronos.com/v1/analytics/api-keys/summary/org_abc123?year=2025&month=11" \ -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/api-keys/summary/{org_id}", params={"year": 2025, "month": 11}, headers={"X-API-Key": api_key} ) data = response.json() print(f"Total API requests: {data['totalApiKeyRequests']}") print(f"Total cost: {data['totalApiKeyCost']} CHF") ``` ```javascript const response = await fetch( "https://api.aitronos.com/v1/analytics/api-keys/summary/org_abc123?year=2025&month=11", { headers: { "X-API-Key": process.env.FREDDY_API_KEY } } ); const data = await response.json(); console.log(`Total API requests: ${data.totalApiKeyRequests}`); console.log(`Total cost: ${data.totalApiKeyCost} CHF`); ``` **Response:** 200 OK ```json { "organization_id": "org_abc123", "month": 11, "year": 2025, "totalApiKeyRequests": 25000, "totalApiKeyCost": 6250.0, "averageCostPerRequest": 0.25, "total_synapses": 12500000.0, "totalNeurons": 250000.0, "generatedAt": "2025-11-15T10:30:00Z" } ``` 401 Unauthorized ```json { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication required", "system_message": "No API key provided", "type": "client_error", "status": 401, "trace_id": "abc-123-def", "timestamp": "2025-11-15T10:30:00Z" } } ``` 403 Forbidden ```json { "success": false, "error": { "code": "ORGANIZATION_ACCESS_DENIED", "message": "Access denied to organization", "system_message": "API key doesn't belong to organization", "type": "authorization_error", "status": 403, "trace_id": "def-456-ghi", "timestamp": "2025-11-15T10:30:00Z" } } ``` 400 Bad Request ```json { "success": false, "error": { "code": "INVALID_REQUEST", "message": "Invalid query parameters", "system_message": "year and month are required", "type": "validation_error", "status": 400, "trace_id": "ghi-789-jkl", "timestamp": "2025-11-15T10:30:00Z" } } ``` 500 Server Error ```json { "success": false, "error": { "code": "INTERNAL_ERROR", "message": "An unexpected error occurred", "system_message": "Database query failed", "type": "server_error", "status": 500, "trace_id": "jkl-012-mno", "timestamp": "2025-11-15T10:30:00Z" } } ```