> ## Documentation Index
> Fetch the complete documentation index at: https://predev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Agents: start with https://docs.pre.dev/agents.md, which has complete recipes, plan access, polling rules, errors and limits.
> Authenticate with the workspace API key (pdk_…) from Integrations → Built-in, sent as Authorization: Bearer <key>.
> REST API: https://api.pre.dev (OpenAPI: https://docs.pre.dev/api-reference/openapi.json). AI Gateway: https://api.pre.dev/v1, OpenAI-compatible (OpenAPI: https://docs.pre.dev/api-reference/ai-gateway.openapi.json).
> pre.dev MCP server: npx -y @predotdev/mcp setup adds it to every local coding agent with every pre.dev tool plus the user's own Chrome; the hosted server is https://api.pre.dev/mcp. Search these docs over MCP at https://docs.pre.dev/mcp.

# SDKs

> The official Node.js and Python SDKs for specifications and browser tasks.

Both SDKs use the package name **`predev-api`** and cover specification generation and Browser Agents.

```bash Node.js theme={null}
npm install predev-api
```

```bash Python theme={null}
pip install predev-api
```

| | Node.js / TypeScript | Python |
| - | - | - |
| Import | `import { PredevAPI } from 'predev-api'` | `from predev_api import PredevAPI` |
| Runtime | Node.js 18+ | Python 3.8+ |
| HTTP behavior | Promises; async generator for browser streams | Blocking requests; iterator for browser streams |
| Specification and browser results | JavaScript objects | Dictionaries |
| Credit balance | JavaScript object | `CreditsBalanceResponse` object |

| Operation | Node | Python |
| - | - | - |
| Generate a spec | `fastSpec`, `deepSpec` | `fast_spec`, `deep_spec` |
| Submit a spec and poll | `fastSpecAsync`, `getSpecStatus` | `fast_spec_async`, `get_spec_status` |
| List or search specs | `listSpecs`, `findSpecs` | `list_specs`, `find_specs` |
| Read the credit balance | `getCreditsBalance()` | `get_credits_balance()` |
| Run browser tasks | `browserAgent(tasks, options)` | `browser_agent(tasks, ...)` |
| Submit browser tasks asynchronously | `{ async: true }` | `run_async=True` |
| Stream a new browser submission | `{ stream: true }` → async generator | `stream=True` → iterator |
| Retrieve a browser run | `getBrowserAgent(id, options)` | `get_browser_agent(id, include_events=False)` |
| List browser runs | `listBrowserAgents(params)` | `list_browser_agents(...)` |
| Read your browser queue | `browserAgentStatus()` | `browser_agent_status()` |

Both clients accept an API key and optional base URL. Neither exposes a client-wide timeout, retry, or arbitrary-header option. Use direct REST for live browser URLs, existing-run SSE, capacity statistics, and idempotency keys.

> **[Node SDK](https://predev.mintlify.site/architect-agent/sdks/node.md)**
>
> Specifications, uploads, browser runs, streams, and errors.

> **[Python SDK](https://predev.mintlify.site/architect-agent/sdks/python.md)**
>
> Dictionary results, blocking calls, browser runs, and streaming iterators.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.