# Get API key daily usage Daily breakdown of API key usage patterns. #### 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 daily API key usage breakdown with period information, daily usage data, and monthly summary. ```bash curl "https://api.aitronos.com/v1/analytics/api-keys/daily/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/daily/{org_id}", params={"year": 2025, "month": 11}, headers={"X-API-Key": api_key} ) data = response.json() print(f"Days with API usage: {data['period']['daysWithApiUsage']}") ``` ```javascript const response = await fetch( "https://api.aitronos.com/v1/analytics/api-keys/daily/org_abc123?year=2025&month=11", { headers: { "X-API-Key": process.env.FREDDY_API_KEY } } ); const data = await response.json(); console.log(`Days with API usage: ${data.period.daysWithApiUsage}`); ``` **Response:** 200 OK ```json { "organization_id": "org_abc123", "period": { "year": 2025, "month": 11, "startDate": "2025-11-01", "endDate": "2025-11-30", "daysInMonth": 30, "daysWithApiUsage": 28 }, "dailyUsage": [ { "date": "2025-11-15", "requests": 850, "cost": 212.5, "synapses": 425000.0, "neurons": 8500.0 }, { "date": "2025-11-14", "requests": 820, "cost": 205.0, "synapses": 410000.0, "neurons": 8200.0 } ], "summary": { "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" } } ```