# Credits ## Get Credit Usage - [GET /v1/credits/usage](https://developers.withlantern.com/openapi/credits/get_credit_usage_v1_credits_usage_get.md): 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 } ## Get Remaining Credits - [GET /v1/credits/remaining](https://developers.withlantern.com/openapi/credits/get_remaining_credits_v1_credits_remaining_get.md): Get the current remaining credits for a tenant. ## Overview This endpoint retrieves the current remaining credits available for the authenticated tenant. ## Response Fields - success: Boolean indicating request success - tenant_id: The tenant ID - remaining_credits: Current remaining credits for the tenant - total_credits: Total credits for the tenant ## Authentication This endpoint requires authentication via Bearer token. The tenant ID is automatically extracted from the authenticated user's token. ## Example Response json { "success": true, "tenant_id": 123, "remaining_credits": 4750.25 }