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 withpdk_.
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:200 with an ID:
/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
SetSPEC_ID to the actual ID from your response:
3. Read the result
Whenstatus 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.
