/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { llmUsageCosts } from "../../funcs/llmUsageCosts.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetCostsUsageRequest$inboundSchema, }; export const tool$llmUsageCosts: ToolDefinition = { name: "llm-usage-costs", description: `Get cost by model Aggregates spend by model over a time range, priced in the cluster currency from the model price book. Org-scoped: org admins see their org; cluster admins may pass \`org_id\`. Includes billable work with no usage row of its own (store=false responses, agent tool calls), so totals cover all LLM spend. Platform-wide, cross-service cost reporting lives in the budgeting API (/api/v1/budgeting/usage/costs).`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await llmUsageCosts( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value; return formatResult(value, apiCall); }, };