export type GetApiBasetenV1ModelsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns the current list of available models with metadata including pricing, context window sizes, and supported features. Use this to discover valid model slugs for the chat completions endpoint. * * GET /baseten/v1/models */ export const getApiBasetenV1Models = async (options?: GetApiBasetenV1ModelsOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/baseten/v1/models${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };