Skip to main content
Use this page when implementing a pre.dev integration or choosing a pre.dev tool for a user’s task.

Read the contract

The documentation site’s Ask AI / MCP features search documentation. To execute product tools, connect to https://api.pre.dev/mcp using the product MCP setup.

Select an interface

Both official SDKs are named predev-api. Python imports use from predev_api import PredevAPI; Node imports use import { PredevAPI } from 'predev-api'. The Python SDK uses blocking HTTP calls, including its server-side async submission methods.

Keep names distinct

Pass existing context as text describing the codebase. It is not an ID that automatically loads another project.

Handle work that takes time

  1. For REST specifications, submit with async: true, save specId, and poll the status endpoint at a bounded interval, such as every five seconds.
  2. Stop polling specifications on completed or failed. On success, consume codingAgentSpecMarkdown or codingAgentSpecJson; use the human variants for review and estimates.
  3. For browser work, always send a tasks array. Save the returned id, then poll or stream the existing run.
  4. Browser batch status is lowercase (processing, completed, failed). Individual task statuses are uppercase. A completed batch can contain failed tasks; inspect each task’s status and error.
  5. Use batch status to detect completion. Results may contain PENDING/RUNNING entries or null slots. Do not infer completion from array length or the completed count alone.
  6. Request includeEvents=true when you need evidence or debugging. Timelines can contain large screenshots; omit them for routine polling.

Submit deliberately

  • Browser tasks can interact with external sites. State the action and success condition clearly, and use the task’s output JSON Schema when your code depends on a specific data shape.
  • Check queue capacity before submitting a large batch. The default 1,000-task request ceiling and your account’s in-flight limit are different limits.
  • REST browser submissions accept Idempotency-Key for retries within 24 hours. Use one key per logical submission. This is a lookup, not an atomic guarantee for simultaneous first submissions. This option is not exposed by the current MCP tool or SDK method signatures.
  • A timeout or disconnected stream does not prove the task stopped. Retrieve the existing run before submitting work again. Stream EOF is not a success signal.
  • Handle HTTP errors and stream error frames. Errors and retries explains billing, queue, and rate-limit responses.
  • Some MCP tools return text without structuredContent, and some specification failures return text without isError. Read the tool result and confirm specification status with get_spec.

Current integration boundaries

The public REST API has no general coding-session, deployment, cancellation, webhook-registration, or recurring-schedule endpoint. Build with the Coding Agent or CLI, and schedule API calls in your own application when needed. Browser tasks do not expose a reusable login-session or cookie-profile API.