Skip to main content
By the end of this guide, you will have a saved specification ID and a completed implementation plan in Markdown and JSON.

Before you start

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_. Make it available as PREDEV_API_KEY. Specification generation needs a plan that includes the Architect API; see API and MCP access.

1. Submit a specification

Use async mode so generation can continue without keeping your HTTP connection open:
The API returns HTTP 200 with an ID:
To request a deeper implementation breakdown, use /deep-spec with the same body. For feature work, include currentContext describing the existing stack and architecture. See inputs and outputs.

2. Poll the saved ID

Set SPEC_ID to the actual ID from your response:
Poll every few seconds with a deadline:

3. Read the result

When status is completed, use: If status is failed, read errorMessage. Do not treat an HTTP 200 status response as proof of successful generation. For a complete polling example, use the Python SDK guide or Node SDK guide.