curl --fail-with-body https://api.pre.dev/fast-spec \
-H "Authorization: Bearer $PREDEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Build a team task manager with projects, assignees, and due dates.",
"async": true
}'import requests
url = "https://api.pre.dev/fast-spec"
payload = { "input": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<string>'})
};
fetch('https://api.pre.dev/fast-spec', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pre.dev/fast-spec",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pre.dev/fast-spec"
payload := strings.NewReader("{\n \"input\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pre.dev/fast-spec")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pre.dev/fast-spec")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"specId": "507f1f77bcf86cd799439011",
"status": "pending"
}Generate a Fast Spec
Generate a specification with architecture, milestones, user stories, and acceptance criteria.
curl --fail-with-body https://api.pre.dev/fast-spec \
-H "Authorization: Bearer $PREDEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Build a team task manager with projects, assignees, and due dates.",
"async": true
}'import requests
url = "https://api.pre.dev/fast-spec"
payload = { "input": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<string>'})
};
fetch('https://api.pre.dev/fast-spec', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pre.dev/fast-spec",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pre.dev/fast-spec"
payload := strings.NewReader("{\n \"input\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pre.dev/fast-spec")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pre.dev/fast-spec")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"specId": "507f1f77bcf86cd799439011",
"status": "pending"
}Example
curl --fail-with-body https://api.pre.dev/fast-spec \
-H "Authorization: Bearer $PREDEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Add CSV exports to the reporting dashboard.",
"currentContext": "Existing TypeScript app with a reports API and organization-scoped access.",
"async": true
}'
async: true, HTTP 200 returns { "specId": "…", "status": "pending" }. Poll spec status using the returned ID. With async omitted or false, the connection waits for the completed specification; long requests can exceed your client’s timeout.
Access and failures
An accepted API key is required. Eligible accounts can use a limited specification trial; paid generation requires available credits. Trial exhaustion returns403, insufficient credits 402, and invalid inputs 400. See authentication and errors.
Generation cost varies with the request. The completed result includes creditsUsed when available. A network timeout does not prove generation stopped; check history before creating another spec.Authorizations
Use a pre.dev API key from https://pre.dev/projects/key.
Body
Project requirements. Include goals, users, constraints, and acceptance criteria.
1Existing system or specification as text; this is not a spec ID.
Public documentation URLs; retrieval and downloadable archives are best effort.
Return {specId, status: pending} immediately. Poll GET /spec-status/{specId}.
Response
Full result for synchronous requests; specId and pending status for asynchronous requests.
- Option 1
- Option 2
Full specification/status record. Fields may be absent or null until available. Terminal status is completed or failed. executionTime is milliseconds.
completed 24-character record ID.
^[a-fA-F0-9]{24}$Which endpoint was used
fast_spec, deep_spec Original input text provided
Whether the request succeeded
Short URL for uploaded file (if file was uploaded)
Name of uploaded file (if file was uploaded)
URL where the human-readable spec is hosted (only when completed)
Estimated total hours for a human to implement the spec (only when completed)
URL to a visual architecture infographic/diagram for the specification (only when completed)
URL where the coding agent spec format is hosted (only when completed)
Structured JSON spec optimized for AI coding assistants (only when completed)
Show child attributes
Show child attributes
Markdown spec optimized for AI coding assistants (only when completed)
Full structured JSON spec with hours, personas, and roles (only when completed)
Show child attributes
Show child attributes
Full markdown spec with all details for human review (only when completed)
Processing time in milliseconds (only when completed or failed)
pre.dev project URL (only when completed)
Array of scraped documentation archives (only when completed). Empty array if no docURLs provided or scraping fails
Show child attributes
Show child attributes
Error description (only when failed)
Completion percentage (0-100) while processing
Measured credit usage; estimates are not fixed charges.
User flow graph with nodes representing user stories/flows and edges showing navigation paths (only when completed)
Show child attributes
Show child attributes
System architecture graph with C1/C2 level nodes and their relationships (only when completed)
Show child attributes
Show child attributes
Enriched tech stack with detailed reasons, descriptions, and alternatives for each technology (only when completed)
Show child attributes
Show child attributes
Human-readable progress description (e.g. 'Generating architecture...')
Existing context supplied with generation.
Origin of the request, such as api or mcp.
Was this page helpful?

