─── API OVERVIEW ───
The Bare Minimum REST API lets you programmatically generate ASCII wireframes and analyze UI screenshots.
─── 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
| Code | Status | Description |
|---|---|---|
rate_limit_exceeded | 429 | Too many requests |
content_policy_violation | 400 | Input blocked by content filter |
validation_error | 422 | Invalid request parameters |
Response Headers
| Header | Description |
|---|---|
X-Request-Id | Unique request ID for debugging |
X-RateLimit-Limit | Requests allowed per minute |
X-RateLimit-Remaining | Requests remaining |
X-RateLimit-Reset | Unix timestamp when limit resets |
Retry-After | Seconds to wait (on 429 responses) |
─── ENDPOINTS ───
Generate Wireframe
Generate an ASCII wireframe from a text description.
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | Description of the UI to generate (max 10,000 chars) |
| aspect_preset | string | No | "desktop" (default) or "mobile" |
| image_data | string | No | Base64-encoded reference image (max 2MB) |
| image_media_type | string | No | MIME type (required with image_data) |
| reference_ascii | string | No | Existing ASCII to refine/modify |
{
"message": "A login form with email and password fields",
"aspect_preset": "desktop",
"image_data": null,
"image_media_type": null,
"reference_ascii": null
}{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | Description of the UI |
| count | integer | No | Number of variants (1-5, default 3) |
| aspect_preset | string | No | "desktop" or "mobile" |
| image_data | string | No | Base64-encoded reference image |
| image_media_type | string | No | MIME type (required with image_data) |
{
"message": "A dashboard with analytics charts",
"count": 3,
"aspect_preset": "desktop"
}{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| image_data | string | Yes | Base64-encoded image |
| image_media_type | string | Yes | MIME type (e.g. "image/png") |
{
"image_data": "base64...",
"image_media_type": "image/png"
}{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| ascii | string | Yes | ASCII wireframe to convert (max 50,000 chars) |
{
"ascii": "
┌─────────┐
│ [Save] │
└─────────┘
"
}{
"spec": { "...": "ComponentSpec tree" }
}─── RATE LIMITS ───
When rate limits are exceeded, you'll receive a 429 response with a Retry-After header.
| Endpoint | Free Tier | Pro Tier |
|---|---|---|
/agents/chat | 30/min | 120/min |
/agents/variants | 15/min | 60/min |
/agents/analyze | 15/min | 60/min |
/agents/spec | 30/min | 120/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)