SpecSculpt
API Reference · v1

Developer Docs

Integrate SpecSculpt into your workflow. Generate business specifications programmatically from any source code.

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.

Base URL

https://api.specsculpt.com/v1

Protocol

HTTPS only

Format

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.

http
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Keep 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

  1. Log in to your SpecSculpt account
  2. Navigate to Dashboard → Settings → API Keys
  3. Click Generate new key
  4. Copy and store the key securely — it will only be shown once

Endpoints

POST/v1/specs/generate
GET/v1/specs
GET/v1/specs/:id
DELETE/v1/specs/:id
POST/v1/specs/generate

Generate a business specification from source code

Request body

ParameterTypeRequiredDescription
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

bash
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

json
{
  "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.

json
{
  "success": false,
  "error": "Code exceeds 50,000 character limit.",
  "code": "PAYLOAD_TOO_LARGE"
}
StatusCodeMeaning
400INVALID_REQUESTMissing or malformed request body
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENAPI access not available on your plan
413PAYLOAD_TOO_LARGECode exceeds 50,000 character limit (Free plan)
429RATE_LIMITEDToo many requests — see rate limits
500INTERNAL_ERRORUnexpected server error — retry with backoff

Rate 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.

PlanRequests / minRequests / month
Starter—5 (web only)
Pro601,000
EnterpriseCustomUnlimited

Rate limit headers

http
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 42
X-RateLimit-Reset: 1750200060
Retry-After: 18

SDKs & 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.

typescript
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/sdk
Coming soon

Python SDK

pip install specsculpt
Coming soon

Ready to integrate?

Get API access with a Pro plan and start generating specs programmatically.