export type GetApiResearchApiAgentsMeAccountArgs = {before?: string | undefined}; export type GetApiResearchApiAgentsMeAccountOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Your runs, newest first, and the credits you earned * * GET /research-api/agents/me/account */ export const getApiResearchApiAgentsMeAccount = async (args: GetApiResearchApiAgentsMeAccountArgs, options?: GetApiResearchApiAgentsMeAccountOptions) => { const {baseUrl = "https://pickedbyagents.com", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.before != null) query.append("before", String(args.before)) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/research-api/agents/me/account${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 };