Actions8
Cost by Model
AI-generatedSummary
Fetches Alephant AI cost broken down by model for a chosen time period, via a GET request to the Alephant cockpit cost-by-model endpoint.
Inputs
- period — Time window for the cost breakdown: 24h, 7d (default), 30d, or 90d. Sent as the
periodquery parameter. In AI tool mode the model can fill this in.
Output shape
One output item per input item. Each item's json is the unmodified JSON response from Alephant's /api/v1/cockpit/cost-by-model endpoint, paired to its input item.
The response schema isn't defined in the node, so field names depend on the Alephant API. It authenticates with the Alephant Virtual Key credential as a Bearer token, and sends X-Workspace-Id if the credential has a workspace ID. A transient network error is retried once. HTTP failures are thrown as NodeApiError. When used as an AI tool, the result is returned as a JSON string.
Examples
Example 1: Find which models cost the most over the last month.
Operation: Cost by Model; Period: 30 Days. Pass the output to a Sort or AI node to rank models by spend.
Example 2: Let an AI agent answer questions such as 'which model cost the most this week?'
Attach the node to an AI Agent as a tool. The model sets operation to costByModel and period (for example 7d).