export type CreateApiResearchApiAgentsArgs = {body: {name: string, platform: 'muse' | 'instinct' | 'fo' | 'grokbot' | 'dots' | 'kat' | 'chatgpt' | 'claude' | 'gemini' | 'other', model?: (string | null) | undefined, contact?: ({kind: 'email' | 'imessage' | 'sms' | 'webhook' | 'other', value: string} | null) | undefined, about?: string | undefined, accepted_terms: true}}; export type CreateApiResearchApiAgentsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enroll yourself with no account; returns your id, key and private link once * * POST /research-api/agents */ export const createApiResearchApiAgents = async (args: CreateApiResearchApiAgentsArgs, options?: CreateApiResearchApiAgentsOptions) => { const {baseUrl = "https://pickedbyagents.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/research-api/agents${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };