← Technical Knowledge
API Specification

LEVI'S FIT-AI API SPECIFICATION

REST/JSON API for the LEVI'S Fit-AI pipeline: endpoints, payloads, error codes, and response schemas.

System: LEVIS-FIT-AI-API v1.0  |  Base URL: https://api.bubblebuttmexicanboy.com/levis-fit-ai  |  Auth: Bearer token

POST /upload

Start a Fit-AI pipeline run from images + metadata.

{
  "userId": "string",
  "images": [
    {
      "angle": "rear|side|seated|motion",
      "data": "base64-encoded-image"
    }
  ],
  "denim": {
    "brand": "LEVIS",
    "cut": "512|541|511|501|null",
    "fabricType": "stretch|non_stretch|null",
    "wash": "string|null"
  }
}

Response:

{
  "jobId": "string",
  "status": "queued"
}

GET /jobs/{jobId}/status

Poll job state.

{
  "jobId": "string",
  "status": "queued|processing|completed|error"
}

GET /jobs/{jobId}/cnf-metrics

Retrieve CNF geometry metrics.

{
  "jobId": "string",
  "cnfMetrics": {
    "GPI": 4.8,
    "LRV": 4.6,
    "CCF": 4.7,
    "CD": 5.0,
    "DSD": 4.6,
    "classification": "Elite_CNf"
  }
}

GET /jobs/{jobId}/mesh/rear

Get rear-angle 3D mesh descriptor.

{
  "jobId": "string",
  "meshRear": {
    "apexDepth": 0.83,
    "underCurveDepth": 0.75,
    "lateralWidth": 0.81,
    "verticesCount": 5000,
    "confidence": 0.94
  }
}

POST /jobs/{jobId}/fit/levis

Trigger LEVI'S cut simulation.

{
  "cuts": ["512", "541", "511", "501"],
  "material": {
    "stretchPercent": 12,
    "weightOz": 12.5
  }
}

Response:

{
  "jobId": "string",
  "status": "fitsimulationstarted"
}

GET /jobs/{jobId}/fit/levis/result

Get ranked LEVI'S cuts + stress summaries.

{
  "jobId": "string",
  "results": [
    {
      "cut": "512",
      "fitGrade": "S-Tier",
      "score": 0.93,
      "bubbleDefinitionIndex": 0.95,
      "comfortIndex": 0.88,
      "stressSummary": {
        "apex": "high_balanced",
        "underCurve": "medium",
        "pockets": "high",
        "yoke": "medium"
      }
    }
  ]
}

GET /jobs/{jobId}/report

Single call for frontend: CNF + mesh + fit summary.

{
  "jobId": "string",
  "cnfMetrics": { ... },
  "meshRear": { ... },
  "bestCuts": ["512", "541"],
  "fitResults": [ ... ],
  "explanation": "512 and 541 best match this duel-sphere geometry due to high projection, strong lateral rounding, and balanced stress."
}