export type CreateApiAgentphoneV0AgentVerifyArgs = {body: {verification_id: string, otp_code: string}}; export type CreateApiAgentphoneV0AgentVerifyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Verify OTP code. Atomically creates account, provisions phone number, creates starter agent, returns API key. No auth required. * * POST /agentphone/v0/agent/verify */ export const createApiAgentphoneV0AgentVerify = async (args: CreateApiAgentphoneV0AgentVerifyArgs, options?: CreateApiAgentphoneV0AgentVerifyOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/agentphone/v0/agent/verify${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 };