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
- 💳 Credits Management: Check your remaining prototype credits balance
- ✨ 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 buildcurrent_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:
Credits Management
Get Credits Balance
Get the remaining prototype credits balance for your API key.CreditsBalanceResponse object with credits remaining
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 |
File Upload Support
Allfast_spec, deep_spec, fast_spec_async, and deep_spec_async methods support optional file uploads. This allows you to provide architecture documents, requirements files, design mockups, RFPs (Request for Proposals), or other context files to improve specification generation.
Using File Path (Simplest)
Using File-like Objects
Supported File Types
- PDF documents (
*.pdf) - Word documents (
*.doc,*.docx) - Text files (
*.txt) - Images (
*.jpg,*.png,*.jpeg)

