API Documentation

Everything you need to integrate construction image classification into your application.

Getting Started

Three steps to classify your first construction image:

  1. 1

    Create an account

    Sign up for a free account to access the dashboard.

  2. 2

    Generate an API key

    Go to API Keys in the dashboard and create a new key. Copy it — the full key is only shown once.

  3. 3

    Make your first request

    Send a construction site photo to the classification endpoint using the code examples below.

Authentication

All API requests require an API key sent via the x-api-key header. Keys start with sk_live_ and can be managed in the dashboard.

bashcurl -X POST YOUR_API_URL/v1/classify \
  -H "x-api-key: sk_live_your_key_here" \
  -F "file=@photo.jpg"

POST /v1/classify

Upload an image and receive construction classification results.

Request

Response

Returns classification results with category, types, and metadata:

json{
  "category": {
    "prediction": "Structural",
    "confidence": 0.9234,
    "confident": true
  },
  "types": [
    {
      "prediction": "Concrete Work",
      "confidence": 0.8567,
      "items": ["Foundation", "Column", "Beam"]
    }
  ],
  "metadata": {
    "image_path": "upload",
    "inference_time_seconds": 1.23,
    "model": "manifold-v1"
  }
}

Response Fields

FieldTypeDescription
category.predictionstringMain category (e.g. "Structural")
category.confidencefloatConfidence score (0-1)
category.confidentbooleanWhether confidence exceeds threshold
typesarrayDetailed type predictions with items
metadata.modelstringModel used for inference

Code Examples

Replace YOUR_API_URL with your deployment URL.

pythonimport requests

response = requests.post(
    "YOUR_API_URL/v1/classify",
    headers={"x-api-key": "sk_live_..."},
    files={"file": open("site_photo.jpg", "rb")}
)
print(response.json())

Rate Limits & Quotas

Each plan has per-minute rate limits and monthly request quotas. Exceeding either returns a 429 response.

PlanRate LimitMonthly Quota
Starter ($49/mo)10 req/min1,000 req/mo
Pro ($199/mo)60 req/min10,000 req/mo
Enterprise (custom)300 req/minUnlimited

Error Responses

All errors follow a consistent format with a human-readable message and the HTTP status code in the body:

json{
  "detail": "Image too large (12345678 bytes). Maximum is 10485760 bytes.",
  "status_code": 413
}

Validation errors (422) return a semicolon-separated string of field errors instead of an array, making them easy to display in a UI toast or alert.

Error Codes

StatusDescription
400Invalid image format or content-type mismatch
401Invalid or missing API key
413Image too large (max 10 MB)
422Validation error (missing or invalid fields)
429Rate limit or monthly quota exceeded
502Classification service unavailable