Actions8
- AI Gateway Actions
- Analytics Actions
Analytics → Cost by Model
AI-generatedSummary
Retrieve cost analytics aggregated by AI model for a specified time period from Alephant's analytics API.
Inputs
- Parameter Mode (required) — Choose whether analytics parameters are fixed or dynamically set by AI expressions. Options are 'Fixed' or 'AI Dynamic'.
- Period (required) — Time period over which to aggregate cost data. Available when Parameter Mode is 'Fixed'. Options: '24 Hours', '7 Days' (default), '30 Days', '90 Days'.
- AI Period — Time period key for AI dynamic mode. Valid values: '24h', '7d', '30d', '90d'.
- AI Operation (required) — In AI dynamic mode, select the analytics operation key; must be 'costByModel' for this operation.
Output shape
a JSON object containing cost data grouped by AI model for the specified period.
The output is a single JSON object per input item, reflecting the costs aggregated by model for the selected period. Parameter values can be fixed at design time or dynamically provided by AI expressions depending on Parameter Mode.
Examples
Example 1: Fixed parameter mode example
Set Parameter Mode to 'Fixed', Operation to 'Cost by Model', and Period to desired timeframe (e.g., '7 Days'). Upon execution, the node queries Alephant's analytics API and returns cost data aggregated by AI model for that period.
Example 2: AI dynamic parameter mode example
Set Parameter Mode to 'AI Dynamic' and provide an AI expression for 'AI Operation' that returns 'costByModel'. Provide an AI expression for 'AI Period' returning one of the valid period keys e.g., '7d'. The node dynamically determines operation and period at runtime and returns corresponding cost by model analytics.