API Reference
Complete reference for the Sailop v1 REST API. Base URL: https://sailop.com
Authentication
All API calls require one of the following authentication methods:
- Session cookie — automatic when calling from the browser or dashboard
- API key header —
Authorization: Bearer sl_pro_xxxxxorAuthorization: Bearer sk_xxxxx
Authorization: Bearer sl_pro_a1b2c3d4e5f6sailop status in your terminal.Endpoints
/api/v1/scoreScore a piece of content for AI-generated visual patterns.
Request body:
{
"content": "string", // required — code or text to analyze
"fileType": "string" // optional — e.g. "tsx", "css", "html"
}Response:
{
"score": 67,
"grade": "D",
"findings": 15
}Free: 5 calls/day · Pro: 1,000 calls/month
/api/v1/transformProTransform content to remove AI-generated patterns and apply a unique design system.
Request body:
{
"content": "string", // required — code to transform
"fileType": "string", // optional — e.g. "tsx", "css"
"seed": 42 // optional — reproducible output
}Response:
{
"transformed": "string",
"beforeScore": 67,
"afterScore": 12,
"changes": []
}/api/v1/design-systemGenerate a unique design system with colors, fonts, spacing, and rules.
Request body:
{
"seed": 42, // optional — deterministic output
"mode": "light" | "dark", // optional — color scheme
"archetype": "string" // optional — e.g. "brutalist", "organic"
}Response:
{
"css": "string",
"fonts": "string",
"palette": {},
"rules": []
}/api/scanFull scan with dimension breakdown. Returns detailed findings and per-dimension scores.
Request body:
{
"content": "string", // required — code to scan
"language": "string" // optional — e.g. "tsx", "vue", "svelte"
}Response:
{
"score": 67,
"grade": "D",
"findings": [],
"dimensions": {}
}/api/cleanClean AI patterns from content. Supports an aggressive mode for deeper rewrites.
Request body:
{
"content": "string", // required — code to clean
"language": "string", // optional — file language
"aggressive": false // optional — deeper pattern removal
}Response:
{
"cleaned": "string",
"changes": []
}/api/generateGenerate a complete design system object with CSS variables, font stacks, and rules.
Request body:
{
"seed": 42, // optional — deterministic output
"format": "css" | "json", // optional — output format
"mode": "light" | "dark" // optional — color scheme
}Response:
Design system object (format depends on format parameter).
/api/templates/[name]?format=tsx|htmlPurchase requiredDownload a purchased template file. Requires ownership of the specific template or the all-templates bundle.
Query parameters:
name— template identifier (path param)format—tsxorhtml
Returns the template file as a download attachment.
/api/healthHealth check endpoint. No authentication required.
Response:
{
"status": "ok",
"version": "1.0.0"
}Rate limits
| Plan | Limit | Price |
|---|---|---|
| Free | 5 calls/day | $0 |
| Pro | 1,000 calls/month | $39 one-time |
| API Starter | 10,000 calls/month | 49€/mo |
| API Growth | 100,000 calls/month | 299€/mo |
X-RateLimit-Remaining and X-RateLimit-Reset.Code examples
Score content
curl -X POST https://sailop.com/api/v1/score \
-H "Authorization: Bearer sl_pro_a1b2c3d4e5f6" \
-H "Content-Type: application/json" \
-d '{"content": "<div class=\"rounded-lg bg-blue-500 p-4\">...</div>"}'const res = await fetch("https://sailop.com/api/v1/score", {
method: "POST",
headers: {
"Authorization": "Bearer sl_pro_a1b2c3d4e5f6",
"Content-Type": "application/json",
},
body: JSON.stringify({
content: '<div class="rounded-lg bg-blue-500 p-4">...</div>',
fileType: "tsx",
}),
});
const { score, grade, findings } = await res.json();
console.log(`Score: ${score}/100 (Grade ${grade}), ${findings} findings`);Transform content
curl -X POST https://sailop.com/api/v1/transform \
-H "Authorization: Bearer sl_pro_a1b2c3d4e5f6" \
-H "Content-Type: application/json" \
-d '{"content": "<div class=\"rounded-lg bg-blue-500 p-4\">...</div>", "seed": 42}'const res = await fetch("https://sailop.com/api/v1/transform", {
method: "POST",
headers: {
"Authorization": "Bearer sl_pro_a1b2c3d4e5f6",
"Content-Type": "application/json",
},
body: JSON.stringify({
content: '<div class="rounded-lg bg-blue-500 p-4">...</div>',
seed: 42,
}),
});
const { transformed, beforeScore, afterScore, changes } = await res.json();
console.log(`Before: ${beforeScore} -> After: ${afterScore}`);
console.log(`Applied ${changes.length} changes`);Generate a design system
curl -X POST https://sailop.com/api/v1/design-system \
-H "Authorization: Bearer sl_pro_a1b2c3d4e5f6" \
-H "Content-Type: application/json" \
-d '{"seed": 42, "mode": "dark", "archetype": "brutalist"}'const res = await fetch("https://sailop.com/api/v1/design-system", {
method: "POST",
headers: {
"Authorization": "Bearer sl_pro_a1b2c3d4e5f6",
"Content-Type": "application/json",
},
body: JSON.stringify({
seed: 42,
mode: "dark",
archetype: "brutalist",
}),
});
const { css, fonts, palette, rules } = await res.json();
// Inject generated CSS into your project
console.log(`Generated ${rules.length} design rules`);Error handling
The API returns standard HTTP status codes. Error responses include a JSON body with a machine-readable code and a human-readable message.
{
"error": {
"code": "rate_limit_exceeded",
"message": "You have exceeded your daily API limit. Upgrade at sailop.com/pricing."
}
}| Status | Meaning |
|---|---|
400 | Bad request — missing or invalid parameters |
401 | Unauthorized — missing or invalid API key |
403 | Forbidden — endpoint requires a higher plan |
429 | Rate limit exceeded — wait or upgrade |
500 | Internal server error — retry or contact support |