Essentials
Authentication
One pre.dev API key for REST, the AI Gateway, the SDKs, and MCP: where to find it, how to send it, and which accounts each interface accepts.
Every pre.dev interface uses the same workspace key: specifications and browser tasks over REST, the AI Gateway, the SDKs, the MCP server, and plain-words actions in Browser Agents Local.
| Interface | Base URL |
|---|---|
| REST: specifications, browser tasks, and credits | https://api.pre.dev |
| AI Gateway | https://api.pre.dev/v1 |
| Hosted MCP server | https://api.pre.dev/mcp |
Get your key
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_.
Each workspace, your personal account or a team, has one key. The Built-in tab shows it in full with its last-used time. Keep it in your application’s secret configuration and call pre.dev from a server, a script, or local development. Never ship the key in browser or mobile code.
Apps you build on pre.dev already have the key in their environment as PREDEV_API_KEY; see built into every app.
Keys issued before workspace keys existed keep working. Use the pdk_ key for new integrations.
Send the key
| Interface | Send the key as |
|---|---|
| REST and AI Gateway | Authorization: Bearer <key> (recommended) or x-api-key: <key> |
| MCP server | Browser sign-in (OAuth) in interactive clients, or Authorization: Bearer <key>, x-api-key, or predev-api-key |
curl --fail-with-body https://api.pre.dev/browser-agent-status \
-H "Authorization: Bearer $PREDEV_API_KEY"The OpenAI SDKs send Authorization: Bearer and the Anthropic SDK sends x-api-key. The AI Gateway accepts both, so those SDKs need only a base URL and the key.
Rotate the key
Choose Rotate on the key’s card. The old key keeps working for 15 minutes, so running apps can switch without a gap. Update your secret store, then confirm a request with the new key succeeds before the window closes.
Which accounts each interface accepts
Authentication and feature access are separate checks.
| Interface | Accepts |
|---|---|
| Browser Agents REST | Every account, including Free. Task submission then applies its own trial, credit, and queue checks. |
| AI Gateway | Every account, including Free. Free workspaces have a small lifetime allowance for gateway calls. |
| Architect REST and the MCP server | Personal accounts on a paid plan, and team workspaces. The MCP server also accepts Free accounts, for the memory tools |
A Free account can call Browser Agents, the AI Gateway, and the MCP memory tools, while an Architect REST call returns 401 and the other MCP tools return an error result with a link to subscribe. Which plans can generate specifications is covered in plans, credits, and pricing. Read the response message for the required action.
Account and team context
A personal key acts in your personal account. A team key selects the team’s context for specifications and credit usage. Browser history is scoped to the authenticated caller. Submit and retrieve work with the same key.
SDK setup
import { PredevAPI } from 'predev-api';
const client = new PredevAPI({ apiKey: process.env.PREDEV_API_KEY! });import os
from predev_api import PredevAPI
client = PredevAPI(api_key=os.environ["PREDEV_API_KEY"])MCP sign-in
npx -y @predotdev/mcp setup signs you in to pre.dev in the browser and saves the workspace key in ~/.predev/mcp/credentials.json, readable only by you, for every local coding agent. See Connect the MCP server.
The hosted pre.dev MCP server is https://api.pre.dev/mcp, over Streamable HTTP. It runs pre.dev’s specification, browser, and memory tools. Searching this documentation is a separate MCP server, https://docs.pre.dev/mcp, which needs no key.
To connect the hosted server instead, add it to your client’s remote HTTP servers, then use the client’s authentication flow. The browser asks you to sign in and choose the personal account or team to connect. MCP setup covers client configuration and troubleshooting.