/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { usageCosts } from "../../funcs/usageCosts.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetCostsRequest$inboundSchema, }; export const tool$usageCosts: ToolDefinition = { name: "usage-costs", description: `Aggregate cost by dimension Sums stored per-entry cost over [start_time, end_time), grouped by any of service, task_type, model, api_key_id, team_id, user_id, external_user_id, org_id. Point-in-time correct for chargeback/showback.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await usageCosts( 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); }, };