> ## Documentation Index
> Fetch the complete documentation index at: https://docs.steerai.autos/llms.txt
> Use this file to discover all available pages before exploring further.

# Visual Inspection API

> AI-powered visual damage detection and condition assessment

## POST /v1/inspections/visual

Submit vehicle images for comprehensive visual inspection using advanced computer vision AI. Detects scratches, dents, paint damage, glass damage, and more with 94% accuracy.

### Request

```bash theme={null}
curl -X POST "https://api.steerai.autos/v1/inspections/visual" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "vehicle_id": "veh_1234567890abcdef",
    "images": [
      {
        "url": "https://storage.example.com/front.jpg",
        "angle": "front",
        "type": "exterior"
      },
      {
        "url": "https://storage.example.com/rear.jpg",
        "angle": "rear",
        "type": "exterior"
      },
      {
        "url": "https://storage.example.com/left-side.jpg",
        "angle": "left_side",
        "type": "exterior"
      },
      {
        "url": "https://storage.example.com/right-side.jpg",
        "angle": "right_side",
        "type": "exterior"
      }
    ],
    "options": {
      "detailed_analysis": true,
      "generate_report": true,
      "detect_hidden_damage": false
    }
  }'
```

### Request Body

| Field                          | Type    | Required | Description                                                                                                                                                            |
| ------------------------------ | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `vehicle_id`                   | string  | Yes      | Vehicle identifier                                                                                                                                                     |
| `images`                       | array   | Yes      | Array of image objects (min 4, max 50)                                                                                                                                 |
| `images[].url`                 | string  | Yes      | Public URL to the image                                                                                                                                                |
| `images[].angle`               | string  | Yes      | `front`, `rear`, `left_side`, `right_side`, `front_left`, `front_right`, `rear_left`, `rear_right`, `top`, `interior`, `dashboard`, `engine`, `trunk`, `undercarriage` |
| `images[].type`                | string  | Yes      | `exterior`, `interior`, `mechanical`                                                                                                                                   |
| `options.detailed_analysis`    | boolean | No       | Include detailed damage measurements (default: false)                                                                                                                  |
| `options.generate_report`      | boolean | No       | Generate PDF report (default: true)                                                                                                                                    |
| `options.detect_hidden_damage` | boolean | No       | Advanced analysis for hidden damage (default: false)                                                                                                                   |

### Response

```json theme={null}
{
  "status": "success",
  "data": {
    "inspection_id": "vis_1234567890abcdef",
    "vehicle_id": "veh_1234567890abcdef",
    "status": "completed",
    "created_at": "2024-01-15T10:30:00Z",
    "completed_at": "2024-01-15T10:30:45Z",
    "processing_time": 45.2,
    "results": {
      "overall_condition": "fair",
      "condition_score": 7.2,
      "confidence": 0.94,
      "damages": [
        {
          "damage_id": "dmg_front_bumper_001",
          "type": "scratch",
          "severity": "minor",
          "location": {
            "part": "front_bumper",
            "side": "front",
            "coordinates": {
              "x": 245,
              "y": 180,
              "width": 85,
              "height": 12
            }
          },
          "measurements": {
            "length": 8.5,
            "width": 1.2,
            "depth": 0.3,
            "unit": "cm"
          },
          "confidence": 0.96,
          "image_url": "https://storage.example.com/front.jpg",
          "annotated_url": "https://results.steerai.autos/dmg_front_bumper_001_annotated.jpg",
          "estimated_repair": {
            "min": 150,
            "max": 300,
            "currency": "USD",
            "repair_type": "paint_touch_up"
          }
        },
        {
          "damage_id": "dmg_rear_door_left_002",
          "type": "dent",
          "severity": "moderate",
          "location": {
            "part": "rear_door_left",
            "side": "left",
            "coordinates": {
              "x": 320,
              "y": 240,
              "width": 120,
              "height": 95
            }
          },
          "measurements": {
            "diameter": 11.5,
            "depth": 2.8,
            "unit": "cm"
          },
          "confidence": 0.89,
          "image_url": "https://storage.example.com/left-side.jpg",
          "annotated_url": "https://results.steerai.autos/dmg_rear_door_left_002_annotated.jpg",
          "estimated_repair": {
            "min": 500,
            "max": 850,
            "currency": "USD",
            "repair_type": "pdr_and_paint"
          }
        }
      ],
      "damage_summary": {
        "total_damages": 2,
        "by_severity": {
          "minor": 1,
          "moderate": 1,
          "severe": 0,
          "critical": 0
        },
        "by_type": {
          "scratch": 1,
          "dent": 1,
          "rust": 0,
          "crack": 0,
          "paint_damage": 0
        },
        "total_estimated_repair": {
          "min": 650,
          "max": 1150,
          "currency": "USD"
        }
      },
      "parts_affected": [
        {
          "part": "front_bumper",
          "condition": "good",
          "damage_count": 1
        },
        {
          "part": "rear_door_left",
          "condition": "fair",
          "damage_count": 1
        }
      ]
    },
    "reports": {
      "pdf_url": "https://reports.steerai.autos/vis_1234567890abcdef.pdf",
      "json_url": "https://api.steerai.autos/v1/inspections/visual/vis_1234567890abcdef/report"
    }
  },
  "meta": {
    "request_id": "req_visual_abc123",
    "processing_time": 45.234,
    "images_processed": 4,
    "ai_model_version": "v3.2.1"
  }
}
```

### Response Fields

| Field                       | Type   | Description                                                                        |
| --------------------------- | ------ | ---------------------------------------------------------------------------------- |
| `inspection_id`             | string | Unique visual inspection identifier                                                |
| `status`                    | string | `processing`, `completed`, `failed`                                                |
| `results.overall_condition` | string | `excellent`, `good`, `fair`, `poor`, `critical`                                    |
| `results.condition_score`   | float  | Score from 0-10 (10 = perfect condition)                                           |
| `results.confidence`        | float  | AI confidence score (0-1)                                                          |
| `damages[].type`            | string | `scratch`, `dent`, `rust`, `crack`, `paint_damage`, `glass_damage`, `panel_damage` |
| `damages[].severity`        | string | `minor`, `moderate`, `severe`, `critical`                                          |
| `damages[].measurements`    | object | Physical dimensions of damage                                                      |
| `damages[].annotated_url`   | string | Image with damage highlighted                                                      |

### Damage Types

<AccordionGroup>
  <Accordion icon="brush" title="Paint & Surface Damage">
    • **Scratch:** Surface-level paint damage
    • **Paint Damage:** Chipped, peeling, or faded paint
    • **Rust:** Corrosion on metal surfaces
    • **Oxidation:** Surface oxidation and weathering
  </Accordion>

  <Accordion icon="car-burst" title="Structural Damage">
    • **Dent:** Impact damage causing depression
    • **Panel Damage:** Bent or misaligned body panels
    • **Crack:** Fractures in body panels
    • **Frame Damage:** Structural frame issues
  </Accordion>

  <Accordion icon="window-restore" title="Glass & Trim">
    • **Glass Damage:** Cracks or chips in windows
    • **Headlight Damage:** Foggy, cracked, or broken lights
    • **Trim Damage:** Missing or damaged trim pieces
    • **Mirror Damage:** Broken or cracked mirrors
  </Accordion>
</AccordionGroup>

### Error Responses

#### 400 Bad Request

```json theme={null}
{
  "status": "error",
  "error": {
    "code": "INSUFFICIENT_IMAGES",
    "message": "Minimum 4 images required for visual inspection",
    "type": "validation_error",
    "field": "images"
  }
}
```

#### 422 Unprocessable Entity

```json theme={null}
{
  "status": "error",
  "error": {
    "code": "IMAGE_QUALITY_TOO_LOW",
    "message": "Image quality insufficient for analysis. Please provide higher resolution images (min 1280x720)",
    "type": "validation_error",
    "field": "images[2].url",
    "details": {
      "image_index": 2,
      "current_resolution": "640x480",
      "minimum_resolution": "1280x720"
    }
  }
}
```

### Image Requirements

<Warning>
  **Image Quality Standards**

  * **Minimum Resolution:** 1280x720 pixels
  * **Recommended Resolution:** 1920x1080 pixels or higher
  * **File Format:** JPG, PNG, HEIC
  * **Maximum File Size:** 10MB per image
  * **Lighting:** Good natural or artificial lighting
  * **Focus:** Sharp, clear images without motion blur
</Warning>

### Best Practices

<CardGroup cols={2}>
  <Card title="Image Capture" icon="camera">
    **Optimal Photo Guidelines**

    • Capture all required angles
    • Use good lighting (avoid shadows)
    • Keep camera 2-3 meters from vehicle
    • Ensure entire panel visible in frame
    • Avoid reflections and glare
  </Card>

  <Card title="Damage Detection" icon="magnifying-glass">
    **Maximize Accuracy**

    • Clean vehicle before photos
    • Take close-up shots of damage
    • Multiple angles for each damage
    • Include reference objects for scale
    • Consistent lighting across images
  </Card>
</CardGroup>

### Webhooks

Configure webhooks to receive real-time updates when inspection completes:

```json theme={null}
{
  "event": "visual_inspection.completed",
  "timestamp": "2024-01-15T10:30:45Z",
  "data": {
    "inspection_id": "vis_1234567890abcdef",
    "vehicle_id": "veh_1234567890abcdef",
    "status": "completed",
    "damages_detected": 2,
    "overall_condition": "fair",
    "condition_score": 7.2,
    "report_url": "https://reports.steerai.autos/vis_1234567890abcdef.pdf"
  }
}
```

### Example: Get Visual Inspection Results

```bash theme={null}
curl -X GET "https://api.steerai.autos/v1/inspections/visual/vis_1234567890abcdef" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Example: List Vehicle Inspections

```bash theme={null}
curl -X GET "https://api.steerai.autos/v1/inspections/visual?vehicle_id=veh_1234567890abcdef&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Query Parameters:

* `vehicle_id` (string): Filter by vehicle
* `status` (string): Filter by status (`processing`, `completed`, `failed`)
* `created_after` (string): ISO 8601 date filter
* `created_before` (string): ISO 8601 date filter
* `limit` (integer): Results per page (default: 20, max: 100)
* `offset` (integer): Pagination offset

<Tip>
  **Performance Tip:** For faster processing, resize images to recommended resolution (1920x1080) before uploading. Larger images don't improve accuracy and increase processing time.
</Tip>
