// Code generated by @openmeter/typespec-typescript. DO NOT EDIT. import { type Client } from '../core.js' import { unwrap, type RequestOptions } from '../lib/types.js' import { paginatePages } from '../lib/paginate.js' import { listLlmCostPrices, getLlmCostPrice, listLlmCostOverrides, createLlmCostOverride, deleteLlmCostOverride, } from '../funcs/llmCost.js' import type { ListLlmCostPricesRequest, ListLlmCostPricesResponse, GetLlmCostPriceRequest, GetLlmCostPriceResponse, ListLlmCostOverridesRequest, ListLlmCostOverridesResponse, CreateLlmCostOverrideRequest, CreateLlmCostOverrideResponse, DeleteLlmCostOverrideRequest, DeleteLlmCostOverrideResponse, } from '../models/operations/llmCost.js' import type { LlmCostPrice } from '../models/types.js' export class LLMCost { constructor(private readonly _client: Client) {} /** * List LLM cost prices * * List global LLM cost prices. Returns prices with overrides applied if any. * * GET /openmeter/llm-cost/prices */ async listPrices( request?: ListLlmCostPricesRequest, options?: RequestOptions, ): Promise { return unwrap(await listLlmCostPrices(this._client, request, options)) } /** * List LLM cost prices * * List global LLM cost prices. Returns prices with overrides applied if any. * * Iterates every item across all pages, fetching more as the returned iterable is consumed. * * GET /openmeter/llm-cost/prices */ listPricesAll( request?: ListLlmCostPricesRequest, options?: RequestOptions, ): AsyncIterable { return paginatePages( (req, opts) => listLlmCostPrices(this._client, req, opts), request ?? {}, options, ) } /** * Get LLM cost price * * Get a specific LLM cost price by ID. Returns the price with overrides applied if * any. * * GET /openmeter/llm-cost/prices/{priceId} */ async getPrice( request: GetLlmCostPriceRequest, options?: RequestOptions, ): Promise { return unwrap(await getLlmCostPrice(this._client, request, options)) } /** * List LLM cost overrides * * List per-namespace price overrides. * * GET /openmeter/llm-cost/overrides */ async listOverrides( request?: ListLlmCostOverridesRequest, options?: RequestOptions, ): Promise { return unwrap(await listLlmCostOverrides(this._client, request, options)) } /** * List LLM cost overrides * * List per-namespace price overrides. * * Iterates every item across all pages, fetching more as the returned iterable is consumed. * * GET /openmeter/llm-cost/overrides */ listOverridesAll( request?: ListLlmCostOverridesRequest, options?: RequestOptions, ): AsyncIterable { return paginatePages( (req, opts) => listLlmCostOverrides(this._client, req, opts), request ?? {}, options, ) } /** * Create LLM cost override * * Create a per-namespace price override. * * POST /openmeter/llm-cost/overrides */ async createOverride( request: CreateLlmCostOverrideRequest, options?: RequestOptions, ): Promise { return unwrap(await createLlmCostOverride(this._client, request, options)) } /** * Delete LLM cost override * * Delete a per-namespace price override. * * DELETE /openmeter/llm-cost/overrides/{priceId} */ async deleteOverride( request: DeleteLlmCostOverrideRequest, options?: RequestOptions, ): Promise { return unwrap(await deleteLlmCostOverride(this._client, request, options)) } }