pdk_….
Send the key
Authorization: Bearer; the Anthropic SDK sends x-api-key. Both are accepted, so no header configuration is needed beyond baseURL and the key.
The same key works for all other api.pre.dev endpoints: specification generation, browser agents, media, and MCP. See authentication for the account rules those interfaces apply.
Rotate
Rotate from the same Integrations → API Keys card. The old key stays valid for 15 minutes after rotation, so a deployed app can pick up the new value without a gap. Update the value in your secret store, then confirm a request with the new key succeeds before the window closes.Projects built on pre.dev
Every project built on pre.dev has the workspace key injected into its sandbox and deploy environment automatically:
Nothing to paste. Read from a pre.dev app for the build-agent workflow and the server-side rule.
Keep it server-side
The key spends the workspace’s credits. Call the gateway from a server, an edge function, or a local development environment, and never ship it to the browser or a mobile bundle. A single-page app should call its own backend route, which forwards to the gateway.Attribute usage to a project
Sendx-predev-project-id: <projectId> on any gateway call to attribute its usage to one of the workspace’s projects. Ids for projects the workspace does not own are ignored. The usage endpoint reports the result.
