export type DeleteApiAgentsAgentIdArgs = {'Cartesia-Version': '2026-03-01', agent_id: string}; export type DeleteApiAgentsAgentIdOptions = {baseUrl?: string | undefined, APIKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Agent * * DELETE /agents/{agent_id} */ export const deleteApiAgentsAgentId = async (args: DeleteApiAgentsAgentIdArgs, options?: DeleteApiAgentsAgentIdOptions) => { const {baseUrl = "https://api.cartesia.ai", fetch: fetchFn = fetch, APIKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Cartesia-Version'] != null) headers.set("Cartesia-Version", String(args['Cartesia-Version'])) if (APIKeyAuth !== undefined) headers.set('authorization', `Bearer ${APIKeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/agents/${encodeURIComponent(String(args.agent_id))}${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 };