API Reference Overview
Research Preview - This API is currently in research preview. Features and pricing are subject to change.
Base URL
Endpoints Overview
Endpoint | Method | Purpose | Auth Required |
---|
/fast-spec | POST | Generate quick comprehensive spec | ✅ |
/deep-spec | POST | Generate ultra-detailed spec | ✅ |
/spec-status/:id | GET | Check async generation status | ✅ |
/list-specs | GET | List all specs with pagination & filters | ✅ |
/find-specs | GET | Search specs using regex patterns | ✅ |
Request Modes
Synchronous (Default)
Request waits for completion, returns spec immediately
Asynchronous
Request returns immediately with request ID, poll for status
Returns a hosted URL to the specification file
{
"outputFormat": "url"
}
Returns the raw markdown content in the response
{
"outputFormat": "markdown"
}
Generation Costs
Endpoint | Cost | What You Pay For |
---|
Fast Spec | 10 credits | Deducted immediately when request starts |
Deep Spec | 50 credits | Deducted immediately when request starts |
What is a “Credit”?
A credit = one AI model inference call. Specs require multiple LLM calls for:
- Architecture analysis
- Feature breakdown
- Milestone planning
- Story generation
- Risk assessment
Cost is per spec request, not per feature. Generate as many features in one spec as needed.
Credit Sources (Priority Order)
- Prototype Credits - Used first if available
- Daily Allocation - Based on subscription tier
- Rollover Credits - Unused daily credits (if applicable)
Check remaining credits:
Solo users: Visit https://pre.dev/project/playground
Enterprise users: Visit https://pre.dev/enterprise/dashboard?page=api
Rate Limits
Daily Limits by Tier
Tier | Fast Spec | Deep Spec | Notes |
---|
Solo Premium | Unlimited* | Unlimited* | *Subject to fair use |
Enterprise | Unlimited* | Unlimited* | *Subject to fair use |
Fair Use Policy
- Max 100 spec credits per day per user/org
- Max 10 concurrent async requests
- Rate: Max 1 request per 5 seconds
Exceeding limits returns 429 Too Many Requests
.
Error Handling
HTTP Status Codes
Code | Meaning | Action |
---|
200 | Success | Process response |
400 | Bad Request | Check request parameters |
401 | Unauthorized | Verify API key |
402 | Insufficient Credits | Visit dashboard to purchase more credits |
403 | Forbidden | Check subscription status |
429 | Rate Limited | Wait and retry |
500 | Server Error | Contact support |
Common Error Responses
Insufficient Credits:
{
"error": "Insufficient credits available",
"message": "Fast Spec requires 10 credits. You have 5 remaining. Visit your dashboard to purchase more credits.",
"creditsRequired": 10,
"creditsAvailable": 5
}
Invalid Input:
{
"error": "Invalid input",
"message": "Please provide a valid input string describing your spec"
}
Authentication Failed:
{
"error": "Invalid enterprise API key",
"message": "The provided enterprise API key is not valid"
}
Quick Start Examples
Fast Spec - New Project
curl -X POST https://api.pre.dev/fast-spec \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Build a SaaS project management tool",
"outputFormat": "url"
}'
Deep Spec - Complex System
curl -X POST https://api.pre.dev/deep-spec \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Build an enterprise healthcare platform",
"outputFormat": "url"
}'
Best Practices
- Be specific about core features and requirements
- Include business context and constraints
- Mention technical preferences if any
Error Handling
- Always check response status codes
- Implement retry logic for rate limits
- Handle insufficient credit errors gracefully
Cost Management
- Use Fast Spec for MVPs and prototypes
- Reserve Deep Spec for complex, mission-critical projects
- Monitor your credit usage via your dashboard regularly
Next: Fast Spec Endpoint
Complete documentation for generating quick specifications.