export type DeleteApiAgentManagementAgentModelPricesModelPrefixArgs = {modelPrefix: string, tenantId?: string | undefined}; export type DeleteApiAgentManagementAgentModelPricesModelPrefixOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete an agent model price * * DELETE /agent-management/agent-model-prices/{modelPrefix} */ export const deleteApiAgentManagementAgentModelPricesModelPrefix = async (args: DeleteApiAgentManagementAgentModelPricesModelPrefixArgs, options?: DeleteApiAgentManagementAgentModelPricesModelPrefixOptions) => { const {baseUrl = "http://localhost:8090/agent-api", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.tenantId != null) query.append("tenantId", String(args.tenantId)) if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/agent-management/agent-model-prices/${encodeURIComponent(String(args.modelPrefix))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };