─── API OVERVIEW ───

The Bare Minimum REST API lets you programmatically generate ASCII wireframes and analyze UI screenshots.

Base URL: https://api.bareminimum.design/api

─── RESPONSE FORMAT ───

Success Response

{
  "ascii": "
      ┌─────────────────┐
      │   Login Form    │
      └─────────────────┘
    "
}

Error Response

{
  "error": "rate_limit_exceeded",
  "message": "Rate limit exceeded. Retry after 60 seconds.",
  "status": 429,
  "request_id": "req_abc123",
  "details": { "retry_after": 60 }
}

Error Codes

CodeStatusDescription
rate_limit_exceeded429Too many requests
content_policy_violation400Input blocked by content filter
validation_error422Invalid request parameters

Response Headers

HeaderDescription
X-Request-IdUnique request ID for debugging
X-RateLimit-LimitRequests allowed per minute
X-RateLimit-RemainingRequests remaining
X-RateLimit-ResetUnix timestamp when limit resets
Retry-AfterSeconds to wait (on 429 responses)

─── ENDPOINTS ───

Generate Wireframe

Generate an ASCII wireframe from a text description.

POST /agents/chat
ParameterTypeRequiredDescription
messagestringYesDescription of the UI to generate (max 10,000 chars)
aspect_presetstringNo"desktop" (default) or "mobile"
image_datastringNoBase64-encoded reference image (max 2MB)
image_media_typestringNoMIME type (required with image_data)
reference_asciistringNoExisting ASCII to refine/modify
# Request Body
{
  "message": "A login form with email and password fields",
  "aspect_preset": "desktop",
  "image_data": null,
  "image_media_type": null,
  "reference_ascii": null
}
# Response
{
  "ascii": "
      ┌──────────────────────────────────────┐
      │           LOGIN                      │
      ├──────────────────────────────────────┤
      │                                      │
      │  Email:    [____________________]    │
      │                                      │
      │  Password: [____________________]    │
      │                                      │
      │           [ Sign In ]                │
      │                                      │
      └──────────────────────────────────────┘
    ",
  "spec": null,
  "clarification_needed": false,
  "clarification_options": null,
  "resolved_target": null
}

Generate Variants

Generate multiple wireframe variants with different styles.

POST /agents/variants
ParameterTypeRequiredDescription
messagestringYesDescription of the UI
countintegerNoNumber of variants (1-5, default 3)
aspect_presetstringNo"desktop" or "mobile"
image_datastringNoBase64-encoded reference image
image_media_typestringNoMIME type (required with image_data)
# Request Body
{
  "message": "A dashboard with analytics charts",
  "count": 3,
  "aspect_preset": "desktop"
}
# Response
{
  "variants": [
    { "ascii": "
      ┌─── DASHBOARD ───┐
      │ ...
    ", "spec": null },
    { "ascii": "
      ╔═══ DASHBOARD ═══╗
      ║ ...
    ", "spec": null },
    { "ascii": "
      ┏━━━ DASHBOARD ━━━┓
      ┃ ...
    ", "spec": null }
  ],
  "failures": []
}

Analyze UI

Analyze a UI screenshot for layout and visual hierarchy improvements.

POST /agents/analyze
ParameterTypeRequiredDescription
image_datastringYesBase64-encoded image
image_media_typestringYesMIME type (e.g. "image/png")
# Request Body
{
  "image_data": "base64...",
  "image_media_type": "image/png"
}
# Response
{
  "analysis": {
    "summary": "The layout has good structure but could improve visual hierarchy.",
    "issues": [
      {
        "id": "issue_1",
        "category": "visual_hierarchy",
        "severity": "medium",
        "title": "Weak call-to-action",
        "description": "The primary button doesn't stand out enough.",
        "ascii_before": "[ Get Started ]",
        "ascii_after": "[ ▶ GET STARTED ]"
      }
    ],
    "strengths": ["Good use of whitespace", "Consistent typography"]
  }
}

Generate Component Spec

Convert an ASCII wireframe into a structured ComponentSpec used for live preview rendering.

POST /agents/spec
ParameterTypeRequiredDescription
asciistringYesASCII wireframe to convert (max 50,000 chars)
# Request Body
{
  "ascii": "
      ┌─────────┐
      │ [Save]  │
      └─────────┘
    "
}
# Response
{
  "spec": { "...": "ComponentSpec tree" }
}

─── RATE LIMITS ───

When rate limits are exceeded, you'll receive a 429 response with a Retry-After header.

EndpointFree TierPro Tier
/agents/chat30/min120/min
/agents/variants15/min60/min
/agents/analyze15/min60/min
/agents/spec30/min120/min

Idempotency-Key

The Idempotency-Key header is optional. It is allowed through CORS preflight so browser clients that send it defensively will not be blocked, but the server does not currently deduplicate or replay responses — duplicate POSTs execute independently. Do not rely on server-side idempotency at this time.

─── CODE EXAMPLES ───

import requests

BASE_URL = "https://api.bareminimum.design/api"

def generate_wireframe(message: str, aspect: str = "desktop") -> str:
    response = requests.post(
        f"{BASE_URL}/agents/chat",
        json={"message": message, "aspect_preset": aspect},
    )
    response.raise_for_status()
    return response.json()["ascii"]

# Usage
ascii_art = generate_wireframe("A settings page with toggles")
print(ascii_art)