Specs (Architect)
Generate a Deep Spec
Generate a detailed implementation specification with milestones, stories, and granular subtasks.
Deep Spec adds implementation detail to the planning pass. It accepts the same JSON and multipart fields as Fast Spec.
Example
curl --fail-with-body https://api.pre.dev/deep-spec \
-H "Authorization: Bearer $PREDEV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Build an organization-scoped reporting platform with scheduled exports, audit logs, and role-based access.",
"async": true
}'Save specId from the HTTP 200 response, then poll its status. Async submission is useful for detailed specifications because generation can outlast client and network timeouts.
Inputs and outputs explains file uploads, existing context, JSON, Markdown, and graphs. Credit use is variable; inspect creditsUsed rather than assuming a fixed per-request price. Access and trial rules match Fast Spec.
Errors
| Status | When |
|---|---|
400 | No input or file, or docURLs is not an array of strings |
401 | Missing or invalid key, or a personal key without a paid plan |
402 | Not enough credits to start |
403 | The specification trial is used up (Plus, or a team workspace without a plan), or the call came from a browser origin that is not allowed |
500 | Generation failed. Check history before retrying |
Each status has an example body in the response examples. See errors and retries.
curl --fail-with-body https://api.pre.dev/deep-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}'const body = JSON.stringify({ "input": "Build a team task manager with projects, assignees, and due dates.", "async": true})fetch("https://api.pre.dev/deep-spec", { method: "POST", headers: { "Content-Type": "application/json" }, body})package mainimport ( "fmt" "net/http" "io/ioutil" "strings")func main() { url := "https://api.pre.dev/deep-spec" body := strings.NewReader(`{ "input": "Build a team task manager with projects, assignees, and due dates.", "async": true }`) req, _ := http.NewRequest("POST", url, body) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}import requestsurl = "https://api.pre.dev/deep-spec"body = """{ "input": "Build a team task manager with projects, assignees, and due dates.", "async": true}"""response = requests.request("POST", url, data = body, headers = { "Content-Type": "application/json"})print(response.text)import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.net.http.HttpResponse.BodyHandlers;import java.time.Duration;import java.net.http.HttpRequest.BodyPublishers;var body = BodyPublishers.ofString("""{ "input": "Build a team task manager with projects, assignees, and due dates.", "async": true}""");HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build();HttpRequest.Builder requestBuilder = HttpRequest.newBuilder() .uri(URI.create("https://api.pre.dev/deep-spec")) .header("Content-Type", "application/json") .POST(body) .build();try { HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString()); System.out.println("Status code: " + response.statusCode()); System.out.println("Response body: " + response.body());} catch (Exception e) { e.printStackTrace();}using System;using System.Net.Http;using System.Text;var body = new StringContent("""{ "input": "Build a team task manager with projects, assignees, and due dates.", "async": true}""", Encoding.UTF8, "application/json");var client = new HttpClient();var response = await client.PostAsync("https://api.pre.dev/deep-spec", body);var responseBody = await response.Content.ReadAsStringAsync();use reqwest::{Result, Client};async fn main() -> Result<()> { let client = Client::new(); let url = "https://api.pre.dev/deep-spec"; let body = r#"{ "input": "Build a team task manager with projects, assignees, and due dates.", "async": true }"#; let res = client .post(url) .header("Content-Type", "application/json") .body(body) .send() .await? .text() .await?; println!("{}", res); Ok(())}{ "specId": "507f1f77bcf86cd799439011", "status": "pending"}{ "_id": "507f1f77bcf86cd799439011", "endpoint": "deep_spec", "status": "completed", "success": true, "progress": 100, "codingAgentSpecMarkdown": "# Task manager\n\nProjects, assignments, and due dates."}Your pre.dev workspace API key (pdk_...) from Integrations, Built-in tab: https://pre.dev/projects/integrations?tab=built-in
In: header
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
Full result for synchronous requests; specId and pending status for asynchronous requests.
TypeScript Definitions
Use the response body type in TypeScript.
Full specification/status record. Fields may be absent or null until available. Terminal status is completed or failed. executionTime is milliseconds.
application/json
Invalid request.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Missing, invalid, or ineligible authentication.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Insufficient balance or a billing gate.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Access or trial eligibility denied.
TypeScript Definitions
Use the response body type in TypeScript.
application/json
Request failed.
TypeScript Definitions
Use the response body type in TypeScript.