Skip to main content

API Reference Overview

Research Preview - This API is currently in research preview. Features and pricing are subject to change.

Base URL

https://api.pre.dev

Endpoints Overview

EndpointMethodPurposeAuth Required
/fast-specPOSTGenerate quick comprehensive spec
/deep-specPOSTGenerate ultra-detailed spec
/spec-status/:idGETCheck async generation status
/list-specsGETList all specs with pagination & filters
/find-specsGETSearch specs using regex patterns

Request Modes

Synchronous (Default)

Request waits for completion, returns spec immediately
{
  "async": false
}

Asynchronous

Request returns immediately with request ID, poll for status
{
  "async": true
}

Output Formats

URL Format (Default)

Returns a hosted URL to the specification file
{
  "outputFormat": "url"
}

Markdown Format

Returns the raw markdown content in the response
{
  "outputFormat": "markdown"
}

Generation Costs

EndpointCostWhat You Pay For
Fast Spec10 creditsDeducted immediately when request starts
Deep Spec50 creditsDeducted 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)

  1. Prototype Credits - Used first if available
  2. Daily Allocation - Based on subscription tier
  3. 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

TierFast SpecDeep SpecNotes
Solo PremiumUnlimited*Unlimited**Subject to fair use
EnterpriseUnlimited*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

CodeMeaningAction
200SuccessProcess response
400Bad RequestCheck request parameters
401UnauthorizedVerify API key
402Insufficient CreditsVisit dashboard to purchase more credits
403ForbiddenCheck subscription status
429Rate LimitedWait and retry
500Server ErrorContact 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

Input Quality

  • 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.
I