# Get hourly usage Retrieve hour-by-hour usage patterns for real-time monitoring. #### Path Parameters **`org_id`** string required The organization ID. #### Returns Returns hourly usage analytics with time-based patterns. ```bash curl "https://api.aitronos.com/v1/analytics/usage/hourly/org_abc123?date=2025-11-15" \ -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/usage/hourly/{org_id}", params={"date": "2025-11-15"}, headers={"X-API-Key": api_key} ) data = response.json() print(f"Peak hour: {data['summary']['peak_hour']}:00") ``` ```javascript const response = await fetch( "https://api.aitronos.com/v1/analytics/usage/hourly/org_abc123?date=2025-11-15", { headers: { "X-API-Key": process.env.FREDDY_API_KEY } } ); const data = await response.json(); console.log(`Peak hour: ${data.summary.peak_hour}:00`); ``` **Response:** 200 OK ```json { "organization_id": "org_abc123", "period": "hourly", "data": [ { "hour": 9, "hour_display": "09:00", "total_requests": 150, "total_cost_chf": 37.50, "total_synapses": 75000.0, "total_neurons": 1500.0, "has_data": true }, { "hour": 10, "hour_display": "10:00", "total_requests": 200, "total_cost_chf": 50.00, "total_synapses": 100000.0, "total_neurons": 2000.0, "has_data": true } ], "totalRequests": 350, "totalCost": 87.50, "summary": { "date": "2025-11-15", "avg_requests_per_hour": 175.0, "hours_with_activity": 12, "peak_hour": 14, "currency": "CHF" } } ``` 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" } } ``` 400 Bad Request ```json { "success": false, "error": { "code": "INVALID_REQUEST", "message": "Invalid query parameters", "system_message": "date must be in YYYY-MM-DD format", "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" } } ```