PrompteryxBeta
    ⌘K
    PlatformSupport
    Menu
    IntroductionInstall Desktop & extensionQuick StartPlatform Overview
    OverviewWhat you can makeAI Browser Agent in the chatModels and AutoConnectorsSchedulesProjectsExplore and publishingShare linksMemory and SkillsPersonal agent (beta)Welcome, settings and skinsPlans, credits and top-upsPrompteryx DesktopGroups (pilot)Phone app (early access)
    OverviewCreating WorkflowsTesting & DebuggingScheduling
    OverviewGetting StartedCommandsRecordingSettingsStructured OutputParallel AgentsTips & Best Practices
    OverviewInstallationSidebar AgentUsing Attached FilesExecute on Current TabExporting to Visual Studio
    Overview
    OverviewOpen PageClickClick CoordinatesFillExtract TextScreenshotWaitPress KeyFocus ElementBlur ElementSelect TextHighlight ElementSet ViewportGet Bounding BoxScrollHoverSelect OptionAssertionsCookiesEvaluate JavaScriptExample Workflows
    OverviewPrompteryx Browser AgentOpenAI
    OverviewSchedule TriggerWebhook Trigger
    OverviewGoogle SheetsGoogle CalendarConnect Hub (3,000+ apps)Example Workflows
    AI Vision SettingsChrome Automation ProfilesCloud BrowserBrowser Profiles & Persistent ContextVideo RecordingExecution LogsSharing & CollaborationEdit History
    Selectors GuideVariables
    Start hereGet an API keyRun the AI browser agentDrive a cloud browserRun workflows from anywhereUse connected apps (Connect Hub)SDK (TypeScript)CLIMCP for AI assistants
    REST APIWebhooksMCP toolsCloud Browser APICloud Browser quickstartMigrate from Browserbasen8nZapierMake.com

    Need help? Contact Support

    1. Documentation
    2. Developers
    3. Agent

    Run the AI browser agent

    Describe a goal. Prompteryx opens a browser, looks at the screen, clicks and types until the goal is met, and reports what it found and what it cost.

    What it does

    You write the goal in plain English. The agent runs in a stealth cloud browser (or, with the desktop app, in your own logged-in Chrome), takes up to a step limit you set, and returns a final answer, the steps it took, and a usage line with AI credits and cost.

    With saveAsWorkflow the successful path is saved as a workflow in your account, so the next run costs no AI credits at all. Run it later with the workflow endpoints.

    Three ways to run it

    SDK
    import { Prompteryx } from '@prompteryx/sdk'
    const px = new Prompteryx({ apiKey: process.env.PROMPTERYX_API_KEY })
    
    const result = await px.autopilot.run({
      goal: 'Find the cheapest direct flight from London to Lisbon next Tuesday and screenshot the booking page',
      startUrl: 'https://www.skyscanner.net',   // optional
      model: 'gemini-3.5-flash',                // optional; ids in AUTOPILOT_MODELS
      maxSteps: 30,                             // default 30
      maxCredits: 50,                           // optional cost cap
      saveAsWorkflow: true,                     // save the successful path for reuse
    })
    
    console.log(result.success, result.finalAnswer)
    console.log(result.usage)          // { aiCredits, tokensIn, tokensOut, costUSD, turns }
    console.log(result.savedWorkflowId) // run it again with px.workflows.run(id)
    CLI
    npx prompteryx agent "Find the cheapest direct flight from London to Lisbon next Tuesday" --save-as-workflow
    # add --local to use your own Chrome through the Prompteryx desktop app (no cloud minutes)
    HTTP
    # Start the job (returns jobId + sessionId immediately)
    curl -X POST https://www.prompteryx.ai/api/v1/ai-browser/execute \
      -H "Authorization: Bearer px_live_YOUR_KEY" -H "Content-Type: application/json" \
      -d '{"instruction":"Go to https://www.skyscanner.net. Find the cheapest direct flight from London to Lisbon next Tuesday","maxSteps":30,"saveAsWorkflow":true,"mode":"start"}'
    
    # Then advance it until status is terminal (each call runs up to ~230s server-side)
    curl -X POST https://www.prompteryx.ai/api/v1/ai-browser/execute \
      -H "Authorization: Bearer px_live_YOUR_KEY" -H "Content-Type: application/json" \
      -d '{"jobId":"JOB_ID","mode":"run"}'
    From an AI assistant (MCP)
    "Use Prompteryx to find the cheapest direct flight from London to Lisbon next Tuesday."
    # The assistant calls the browser_ai_action tool. Setup: /docs/developers/mcp
    What comes back
    The same shape from every door.
    {
      "success": true,
      "finalAnswer": "Cheapest direct flight: LHR–LIS Tue 22 Sep, 07:05, £48 (Ryanair).",
      "steps": [ { "action": "navigate", "url": "https://…" }, { "action": "click", "target": "Search" } ],
      "savedWorkflowId": "wf_9c2…",
      "usage": { "aiCredits": 12, "tokensIn": 48210, "tokensOut": 1930, "costUSD": 0.11, "turns": 9 }
    }
    Limits and cost

    Each run spends AI credits (per model turn) and cloud browser minutes. Set maxSteps and maxCredits to cap a run.

    Over HTTP, say where to start inside the instruction (as above). The SDK and CLI do this for you with startUrl / --start-url.

    Models: omit model for gemini-3.5-flash, or pass any id from the SDK's AUTOPILOT_MODELS. An unknown id is refused with 400 UNSUPPORTED_MODEL and the list of valid ones. claude-sonnet-5-vision is now claude-sonnet-5-5-vision (renamed 30 Sep 2026; the old id still runs as Sonnet 5.5).

    Out of AI credits: 402 QUOTA_EXHAUSTED. Out of cloud minutes: 429. Both messages say what to top up.

    Access follows your balance, whatever plan you are on: if the account has credits and minutes, the agent runs. When either is exhausted the response says which one to top up.

    Long tasks: the SDK and CLI poll for you. Over HTTP, use mode: "start" then repeat mode: "run" as shown above.