Overview
The SpecSculpt API lets you programmatically generate business specification documents from source code. Integrate spec generation directly into your CI/CD pipeline, IDE plugin, or internal tooling.
https://api.specsculpt.com/v1
HTTPS only
JSON (UTF-8)
API access is a Pro feature. The API is available on the Pro and Enterprise plans. Free-tier users can use the web interface at /generate.
Authentication
All API requests must include your secret API key in the Authorization header using Bearer token format.
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxKeep your API key secret. Never expose it in client-side code, public repositories, or browser environments. Rotate compromised keys immediately from your dashboard.
Obtaining an API key
- Log in to your SpecSculpt account
- Navigate to Dashboard → Settings → API Keys
- Click Generate new key
- Copy and store the key securely — it will only be shown once
Endpoints
/v1/specs/generate/v1/specs/v1/specs/:id/v1/specs/:id/v1/specs/generateGenerate a business specification from source code
Request body
codestringrequiredSource code to analyze (max 50,000 chars on Free; unlimited on Pro)languagestringoptionalLanguage hint (e.g. "TypeScript"). Auto-detected if omitted.project_namestringoptionalHuman-readable project name for the spec header.formatstringoptional"json" (default) or "markdown" — response format.Example request
curl -X POST https://api.specsculpt.com/v1/specs/generate \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"code": "async function processOrder(order) { ... }",
"language": "JavaScript",
"project_name": "Order Service",
"format": "json"
}'Example response
{
"success": true,
"spec": {
"id": "spec_01j9xk2m3n4p5q6r7s8t",
"project_name": "Order Service",
"language": "JavaScript",
"generated_at": "2026-06-17T21:00:00.000Z",
"sections": [
{
"title": "Project Overview",
"content": "..."
},
{
"title": "Functional Components",
"content": "..."
}
],
"raw_markdown": "# Business Specification: Order Service\n..."
}
}Error Handling
All errors return a JSON body with a success: false flag and a human-readable error message.
{
"success": false,
"error": "Code exceeds 50,000 character limit.",
"code": "PAYLOAD_TOO_LARGE"
}INVALID_REQUESTMissing or malformed request bodyUNAUTHORIZEDMissing or invalid API keyFORBIDDENAPI access not available on your planPAYLOAD_TOO_LARGECode exceeds 50,000 character limit (Free plan)RATE_LIMITEDToo many requests — see rate limitsINTERNAL_ERRORUnexpected server error — retry with backoffRate Limits
Rate limits are applied per API key. Limits reset on a rolling 60-second window. When exceeded, the API returns a 429 response with a Retry-After header.
Rate limit headers
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 42
X-RateLimit-Reset: 1750200060
Retry-After: 18SDKs & Examples
Official SDKs are in development and will ship alongside the public API launch. In the meantime, use the REST API directly with the examples below.
import SpecSculpt from '@specsculpt/sdk';
const client = new SpecSculpt({
apiKey: process.env.SPECSCULPT_API_KEY, // set in your environment
});
const spec = await client.specs.generate({
code: fs.readFileSync('./src/orders.ts', 'utf8'),
language: 'TypeScript',
projectName: 'Order Service',
});
console.log(spec.rawMarkdown);Node.js SDK
npm install @specsculpt/sdkPython SDK
pip install specsculptReady to integrate?
Get API access with a Pro plan and start generating specs programmatically.