REST API v1

API Reference

Build and deploy websites programmatically with the ChilledSites REST API. Complete documentation with examples in cURL, JavaScript, and Python.

RESTful Design
API Key Auth
JSON Responses

Base URL

https://api.chilledsites.com/v1

All API requests should be made to this base URL with the appropriate endpoint path.

Authentication

All API requests require authentication using API keys. Include these headers with every request:

X-API-Key: cs_live_your_api_key_here X-API-Secret: cs_secret_your_secret_here

Getting Your API Keys

  1. Go to chilledsites.com and sign in to your account
  2. Click your profile avatar (bottom-left circular button)
  3. Click "Settings" in the dropdown menu
  4. Click the "API Keys" tab
  5. Click "Generate New API Key"
  6. Enter a name and select permissions (Read, Write, Deploy)
  7. Click "Create API Key"
  8. Copy and save both credentials (shown only once!)

Need detailed help? Check the step-by-step setup guide with screenshots.

Security Best Practices

  • Never commit API keys to version control
  • Use environment variables to store credentials
  • Rotate keys regularly for security
  • Use different keys for development and production

Response Format

All endpoints return standardized JSON responses with consistent structure.

Success Response

{ "success": true, "data": { // Response data specific to endpoint }, "meta": { "timestamp": "2026-04-21T12:00:00Z", "version": "v1" } }

Error Response

{ "success": false, "error": { "code": "ERROR_CODE", "message": "Human-readable error message", "details": {} }, "meta": { "timestamp": "2026-04-21T12:00:00Z", "version": "v1" } }
POST /v1/generate

Generate Website

Create a new website from a text prompt using AI. This is the core endpoint for generating websites.

Request Body

{ "prompt": "Create a landing page for my coffee shop", "agentType": "website", "creativeBrief": "Modern, warm, inviting atmosphere", "designSelections": { "colors": ["#8B4513", "#FFFFFF"], "fonts": ["Playfair Display", "Open Sans"] } }

Parameters

Field Type Required Description
prompt string Yes Description of website to generate
agentType string No Type: website, landing, pwa, react, dashboard, portfolio
creativeBrief string No Brand guidelines, tone, messaging
designSelections object No Colors, fonts, layout preferences

Response

{ "success": true, "data": { "websiteId": "abc-123-def-456", "name": "Coffee Shop Landing", "previewUrl": "https://coffee-shop.chilledsites.com", "tokensUsed": 500, "generatedAt": "2026-04-21T12:00:00Z" } }

Token Cost & Rate Limits

  • Token Cost: 500-1,000 tokens per generation
  • Free Tier: 10 generations/hour
  • Pro Tier: 100 generations/hour
GET /v1/websites

List Websites

Retrieve all websites for the authenticated user.

Response

{ "success": true, "data": { "websites": [ { "id": "abc-123", "name": "My Landing Page", "description": "Product landing page", "deployedUrl": "https://mysite.chilledsites.com", "createdAt": "2026-04-21T10:00:00Z", "updatedAt": "2026-04-21T11:30:00Z", "metadata": { "tags": ["landing", "saas"], "pageCount": 1 } } ] } }
GET /v1/websites/{website_id}

Get Website

Retrieve a specific website with full HTML, CSS, and JavaScript code.

Path Parameters

website_id (string, required) - UUID of the website

Response

{ "success": true, "data": { "website": { "id": "abc-123", "name": "My Website", "description": "Description", "html_code": "...", "css_code": "body { margin: 0; }...", "js_code": "console.log('Hello');...", "metadata": {}, "deployedUrl": "https://mysite.chilledsites.com", "createdAt": "2026-04-21T10:00:00Z", "updatedAt": "2026-04-21T11:30:00Z" } } }
PUT /v1/websites/{website_id}

Update Website

Update website code or metadata. All fields are optional - only include the fields you want to change.

Request Body

{ "name": "Updated Name", "description": "Updated description", "html_code": "...", "css_code": "body { ... }", "js_code": "console.log(...)", "metadata": { "tags": ["portfolio", "personal"] } }

All parameters are optional. Include only the fields you want to update.

DELETE /v1/websites/{website_id}

Delete Website

Permanently delete a website. This action cannot be undone.

Warning: Permanent Action

Deleting a website is permanent and cannot be undone. All code, deployments, and data will be lost.

Response

{ "success": true, "data": { "message": "Website deleted successfully" } }
POST /v1/websites/{website_id}/deploy

Deploy Website

Deploy a website to ChilledSites hosting. Your site will be live at a .chilledsites.com subdomain.

Request Body

{ "subdomain": "myawesomesite" }

The subdomain parameter is optional. If not provided, it defaults to your website name.

Response

{ "success": true, "data": { "websiteId": "abc-123", "deployedUrl": "https://myawesomesite.chilledsites.com", "subdomain": "myawesomesite", "deployedAt": "2026-04-21T14:00:00Z" } }

Your Website is Live!

After deployment, your website is immediately accessible at the returned URL. SSL certificates are automatically provisioned.

GET /v1/user/tokens

Get Token Balance

Check your current token balance and usage statistics.

Response

{ "success": true, "data": { "balance": 5000, "totalPurchased": 10000, "totalUsed": 5000 } }

Rate Limits

API usage is limited based on your subscription tier to ensure fair usage and platform stability.

Operation Free Tier Pro Tier Enterprise
Website Generation 10/hour 100/hour Unlimited
Read Operations 1,000/hour 10,000/hour Unlimited
Write Operations 500/hour 5,000/hour Unlimited
Deploy 50/hour 500/hour Unlimited

Rate Limit Headers

Every API response includes rate limit information in the headers:

X-RateLimit-Limit: 100 X-RateLimit-Remaining: 95 X-RateLimit-Reset: 1635174000

Rate Limit Exceeded Response

{ "success": false, "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "Rate limit exceeded. Try again in 3600 seconds.", "details": { "limit": 100, "remaining": 0, "resetAt": "2026-04-21T15:00:00Z" } } }

Common Error Codes

Code HTTP Status Description
UNAUTHORIZED 401 Invalid or missing API credentials
FORBIDDEN 403 API key lacks required permissions
NOT_FOUND 404 Resource doesn't exist
INVALID_REQUEST 400 Missing or invalid parameters
INSUFFICIENT_TOKENS 402 Not enough tokens for operation
RATE_LIMIT_EXCEEDED 429 Too many requests
INTERNAL_ERROR 500 Server error

Code Examples

cURL

Generate a Website

curl -X POST https://api.chilledsites.com/v1/generate \ -H "X-API-Key: cs_live_..." \ -H "X-API-Secret: cs_secret_..." \ -H "Content-Type: application/json" \ -d '{ "prompt": "Create a portfolio website", "agentType": "portfolio" }'

Get a Website

curl -X GET https://api.chilledsites.com/v1/websites/abc-123 \ -H "X-API-Key: cs_live_..." \ -H "X-API-Secret: cs_secret_..."

Deploy a Website

curl -X POST https://api.chilledsites.com/v1/websites/abc-123/deploy \ -H "X-API-Key: cs_live_..." \ -H "X-API-Secret: cs_secret_..." \ -H "Content-Type: application/json" \ -d '{"subdomain": "mysite"}'

JavaScript / Node.js

const API_BASE = 'https://api.chilledsites.com/v1'; const API_KEY = 'cs_live_...'; const API_SECRET = 'cs_secret_...'; async function generateWebsite(prompt) { const response = await fetch(`${API_BASE}/generate`, { method: 'POST', headers: { 'X-API-Key': API_KEY, 'X-API-Secret': API_SECRET, 'Content-Type': 'application/json', }, body: JSON.stringify({ prompt }), }); const data = await response.json(); if (!data.success) { throw new Error(data.error.message); } return data.data; } // Usage const result = await generateWebsite('Create a landing page for my app'); console.log(`Website created: ${result.previewUrl}`);

Python

import requests API_BASE = 'https://api.chilledsites.com/v1' API_KEY = 'cs_live_...' API_SECRET = 'cs_secret_...' def generate_website(prompt): response = requests.post( f'{API_BASE}/generate', headers={ 'X-API-Key': API_KEY, 'X-API-Secret': API_SECRET, 'Content-Type': 'application/json', }, json={'prompt': prompt} ) data = response.json() if not data['success']: raise Exception(data['error']['message']) return data['data'] # Usage result = generate_website('Create a portfolio website') print(f"Website created: {result['previewUrl']}")

Need Help Getting Started?

Our team is here to help you integrate the ChilledSites API into your workflow.