Features
- 🚀 Fast Spec: Generate comprehensive specifications quickly - perfect for MVPs and prototypes
- 🔍 Deep Spec: Generate ultra-detailed specifications for complex systems with enterprise-grade depth
- ⚡ Async Spec: Non-blocking async methods for long-running requests
- 📊 Status Tracking: Check the status of async specification generation requests
- 🔎 List & Search: Discover, filter, and search through your specification history
- ✨ Type Hints: Full type annotations for better IDE support
- 🛡️ Error Handling: Custom exceptions for different error scenarios
Installation
Install the pre.dev Python SDK using pip:Quick Start
Authentication
The pre.dev API uses API key authentication. Get your API key from the pre.dev dashboard under Settings → API Keys:API Methods
Synchronous Methods
Fast Spec Generation
Generate a fast specification (30-40 seconds, 10 credits).input_text
(required):str
- Description of what you want to buildoutput_format
(optional):"url" | "markdown"
- Output format (default:"url"
)current_context
(optional):str
- Existing project contextdoc_urls
(optional):List[str]
- Documentation URLs to reference
SpecResponse
object with complete specification data
Example:
Deep Spec Generation
Generate a deep specification (2-3 minutes, 50 credits).fast_spec
Returns: SpecResponse
object with comprehensive specification data
Example:
Asynchronous Methods
Fast Spec Async
Generate a fast specification asynchronously (returns immediately).fast_spec
Returns: AsyncResponse
object with specId
for polling
Deep Spec Async
Generate a deep specification asynchronously (returns immediately).fast_spec
Returns: AsyncResponse
object with specId
for polling
Status Checking
Get Spec Status
Check the status of an async specification generation request.spec_id
(required):str
- The specification ID from async methods
SpecResponse
object with current status and data (when completed)
Example:
Listing and Searching Specs
List Specifications
List all specs with optional filtering and pagination.limit
(optional):int
- Results per page (1-100, default: 20)skip
(optional):int
- Offset for pagination (default: 0)endpoint
(optional):"fast_spec" | "deep_spec"
- Filter by endpoint typestatus
(optional):"pending" | "processing" | "completed" | "failed"
- Filter by status
ListSpecsResponse
object with specs array and pagination metadata
Search Specifications
Search for specs using regex patterns (case-insensitive).query
(required):str
- Regex pattern (case-insensitive)limit
(optional):int
- Results per page (1-100, default: 20)skip
(optional):int
- Offset for pagination (default: 0)endpoint
(optional):"fast_spec" | "deep_spec"
- Filter by endpoint typestatus
(optional):"pending" | "processing" | "completed" | "failed"
- Filter by status
ListSpecsResponse
object with matching specs and pagination metadata
Regex Pattern Examples:
Pattern | Matches |
---|---|
payment | ”payment”, “Payment”, “make payment” |
^Build | Specs starting with “Build” |
platform$ | Specs ending with “platform” |
(API|REST) | Either “API” or “REST” |
auth.*system | ”auth” then anything then “system” |
\\d{3,} | 3+ digits (budgets, quantities) |
saas|sass | SaaS or SASS |