# Get Credit Usage Get credit usage for a tenant within a specified date range. ## Overview This endpoint retrieves credit usage information for a tenant within a specified date range. It supports optional filtering by workflow ID, workflow run ID, and custom key-value pairs. ## Query Parameters - start_date: Start date for the calculation period (required) - end_date: End date for the calculation period (required) - workflow_id: Optional workflow ID for filtering results - workflow_run_id: Optional workflow run ID for filtering results - custom_key: Optional custom key for filtering results - custom_value: Optional custom value for filtering results ## Response Fields - success: Boolean indicating request success - tenant_id: The tenant ID - start_date: Echo of the start date - end_date: Echo of the end date - credits_used: Total credits used in the specified period ## Authentication This endpoint requires authentication via Bearer token. The tenant ID is automatically extracted from the authenticated user's token. ## Example Request GET /v1/credits/usage?start_date=2024-01-01T00:00:00Z&end_date=2024-12-31T23:59:59Z&workflow_id=workflow-123 ## Example Response json { "success": true, "tenant_id": 123, "start_date": "2024-01-01T00:00:00Z", "end_date": "2024-12-31T23:59:59Z", "credits_used": 1250.5 } Endpoint: GET /v1/credits/usage Version: 1.4.1 Security: BearerAuth ## Query parameters: - `start_date` (string, required) Start date for credit calculation - `end_date` (string, required) End date for credit calculation - `workflow_id` (any) Optional workflow ID for filtering - `workflow_run_id` (any) Optional workflow run ID for filtering - `custom_key` (any) Optional custom key for filtering - `custom_value` (any) Optional custom value for filtering ## Response 200 fields (application/json): - `success` (boolean, required) Boolean indicating request success - `tenant_id` (integer, required) Tenant ID - `start_date` (string, required) Start date for credit calculation - `end_date` (string, required) End date for credit calculation - `credits_used` (number, required) Total credits used in the period ## Response 400 fields (application/json): - `success` (boolean) Boolean indicating request success - `error` (string, required) Error message - `details` (any) Additional error details ## Response 401 fields (application/json): - `success` (boolean) Boolean indicating request success - `error` (string, required) Error message - `details` (any) Additional error details ## Response 422 fields (application/json): - `detail` (array) - `detail.loc` (array, required) - `detail.msg` (string, required) - `detail.type` (string, required) ## Response 429 fields (application/json): - `success` (boolean) Boolean indicating request success - `error` (string, required) Error message - `details` (any) Additional error details ## Response 500 fields (application/json): - `success` (boolean) Boolean indicating request success - `error` (string, required) Error message - `details` (any) Additional error details