Skip to main content

API

API overview

The public REST API for specifications, browser automation, AI model calls, and credit balances.

InterfaceBase URL
REST: specifications, browser tasks, and creditshttps://api.pre.dev
AI Gatewayhttps://api.pre.dev/v1
Hosted MCP serverhttps://api.pre.dev/mcp

REST paths are mounted at the root: use /browser-agent, not /api/v1/browser-agents. The AI Gateway is the one API under a prefix, /v1.

Copy your pre.dev API key from Integrations → Built-in in the dashboard: pre.dev/projects/integrations for your personal workspace, or the Integrations page of a team workspace. Workspace keys start with pdk_.

InterfaceSend the key as
REST and AI GatewayAuthorization: Bearer <key> (recommended) or x-api-key: <key>
MCP serverBrowser sign-in (OAuth) in interactive clients, or Authorization: Bearer <key>, x-api-key, or predev-api-key

Read authentication and errors before building an integration.

Specifications

MethodPathReference
POST/fast-specGenerate a Fast Spec
POST/deep-specGenerate a Deep Spec
GET/spec-status/{specId}Status and full artifacts
GET/get-planA project’s verified plan
GET/list-specsList specifications
GET/find-specsSearch specifications
GET/credits-balanceCredit balance

Browser Agents

MethodPathReference
POST/browser-agentSubmit tasks
GET/browser-agent/{id}Status and results
GET/browser-agent/{id}/streamWatch an existing run with SSE
GET/browser-agent/{id}/wsGet a live browser WebSocket URL
GET/list-browser-agentsList runs
GET/browser-agent-statusYour queue and in-flight limit
GET/browser-agent-capacityService capacity

AI Gateway

The AI Gateway is an OpenAI-compatible API for hundreds of models from every major lab, with the same key and credits. It covers chat completions, the Anthropic Messages shape, embeddings, images, video, audio, files, and a model catalog with credit prices. Point the stock OpenAI, Vercel AI, or Anthropic SDK at that base URL; see the quickstart and pricing.

Long-running jobs

Specifications, browser runs, and video generation run as jobs. All three follow one pattern: submit the job, save the ID it returns, poll or stream that ID, and read the result once the status is terminal.

The async job pattern in four steps for specs, browser runs, and video jobs: submit the job, save the ID it returns, poll or stream it, and stop at a terminal status to read the result.
JobSubmitSavePoll or streamTerminal status
SpecificationPOST /fast-spec or /deep-spec with async: truespecIdGET /spec-status/{specId}completed returns the Markdown, JSON, and available graphs; failed returns errorMessage
Browser runPOST /browser-agent with async: trueidGET /browser-agent/{id}, or stream GET /browser-agent/{id}/streamcompleted or failed; read each task’s status before its data
VideoPOST /v1/videosidGET /v1/videos/{jobId}completed, then download GET /v1/videos/{jobId}/content; or failed

SDKs and MCP

The Node SDK and Python SDK wrap specification and browser operations. Use direct HTTP for endpoints or headers without a wrapper, including live browser URLs, existing-run SSE, and browser idempotency keys.

The MCP server exposes twelve primary tools, including the memory tools, and three deprecated browser aliases. MCP uses JSON-RPC over HTTP; its parameter names and result envelopes differ from REST. See the tool reference.

Two OpenAPI 3.1 files describe the public API, for code generation or agent ingestion: openapi.json covers specifications, browser tasks, and the credit balance, and ai-gateway.openapi.json covers every AI Gateway /v1 operation.

Was this page helpful?

On this page