CONTENTFORGER

API Documentation

Generate code programmatically with the CONTENTFORGER API. Available on the Agency plan.

Authentication

Pass your API key in the Authorization header. Get your key from Agency → API Access.

Authorization: Bearer your_api_key_here

POST /api/v1/generate

Generate a full Next.js project from a text prompt.

Request body

{
  "prompt": "Build a SaaS landing page with pricing",  // required
  "template": "saas-starter",                          // optional
  "style": "minimal",                                  // optional
  "model": "sonnet"                                    // optional: "sonnet" or "opus"
}

Example

curl -X POST https://contentforger.com/api/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Build a landing page with pricing table", "style": "minimal"}'

Response

{
  "code": "// Full generated Next.js code...",
  "model": "claude-sonnet-4-6",
  "usage": {
    "inputTokens": 1234,
    "outputTokens": 5678,
    "costCents": 12
  }
}

Error codes

StatusMeaning
401Missing or invalid API key
403Agency plan required
400Invalid request body
429Daily rate limit exceeded
503Service at capacity
500Generation failed

Rate limits

Agency plan: up to 1,000 generations per day (soft cap). Exceeding triggers a 429 response.