KLIQ|Developers

Vehicle Inspection (VehicleScan)

This recipe walks through a complete classic car inspection using the VehicleScan vertical: from browsing the catalog for a 1965 Ford Mustang to delivering a final Hagerty condition grade.

What you will build

A vehicle inspection workflow that locates the car in the catalog, creates an inspection with the Hagerty schema, uploads photos from five angles, triggers AI grading across each Hagerty attribute, and produces a human-reviewed condition report.

1. Set up the client

import { KliqClient } from '@kliq-ai/sdk';

const kliq = new KliqClient({ apiKey: process.env.KLIQ_API_KEY! });
const tenant = kliq.forTenant('t_abc123');

2. Browse the catalog for classic cars

// Browse classic car types in the VehicleScan catalog
const types = await kliq.catalog.types.list({ verticalSlug: 'vehicle-scan' });

console.log(types.map(t => t.slug));
// ["us-muscle-cars", "european-classics", "japanese-domestics", "us-trucks"]

// Look up the specific car by catalog slug
const car = await kliq.catalog.items.get('ford-mustang-fastback-1965');

console.log(car.name);
// "1965 Ford Mustang Fastback"

console.log(car.attributes);
// { make: 'Ford', model: 'Mustang', body: 'Fastback', year: 1965, engine: '289ci V8' }

console.log(car.type.gradingSchemaSlug);
// "hagerty-1-4"

3. Create the inspection

const inspection = await tenant.inspections.create({
  catalogItemSlug: car.slug,
  gradingSchemaSlug: car.type.gradingSchemaSlug,
  notes: 'Numbers matching. Original Wimbledon White. Owner: Robert Hill.',
  metadata: { owner: 'robert.hill', lotRef: 'LOT-2026-042' },
});

console.log(inspection.id); // "insp_veh001"

4. Upload photos

Hagerty requires front, rear, interior, engine bay, and undercarriage photos. Additional close-ups of panel gaps and chrome improve AI accuracy.

const photoAngles = [
  { file: frontImage,        angle: 'front'        },
  { file: rearImage,         angle: 'rear'         },
  { file: interiorImage,     angle: 'interior'     },
  { file: engineImage,       angle: 'engine'       },
  { file: undercarriageImage, angle: 'undercarriage' },
];

const observations = await Promise.all(
  photoAngles.map(async ({ file, angle }) => {
    const { uploadUrl, imageUrl } = await tenant.observations.getUploadUrl({
      filename: `mustang-1965-${angle}.jpg`,
      contentType: 'image/jpeg',
    });

    await fetch(uploadUrl, {
      method: 'PUT',
      body: file,
      headers: { 'Content-Type': 'image/jpeg' },
    });

    return tenant.observations.create({
      locationId: 'loc_collector_garage',
      imageUrl,
      metadata: { inspectionId: inspection.id, angle },
    });
  })
);

console.log(`Uploaded ${observations.length} photos`);

5. Trigger AI grading

await tenant.inspections.grade(inspection.id);

The platform loads Hagerty's condition descriptor guides for us-muscle-cars and passes them alongside the photos to the vision model.

6. Poll for results

let result = await tenant.inspections.get(inspection.id);

while (result.status === 'grading') {
  await new Promise(r => setTimeout(r, 3000));
  result = await tenant.inspections.get(inspection.id);
}

console.log('AI grades:', result.aiGrades);
// {
//   body_paint:   2,  // Good — minor stone chips on hood leading edge
//   chrome_trim:  2,  // Good — minor surface oxidation on bumpers
//   interior:     2,  // Good — original upholstery with light wear
//   engine_bay:   3,  // Fair — surface rust on valve covers
//   undercarriage: 3, // Fair — surface rust on frame rails
//   overall:      2   // Good (Hagerty #2)
// }

Hagerty Condition Grades

GradeLabelDescription
1ConcoursFlawless, show-quality restoration
2ExcellentExtremely well-maintained or quality restoration
3GoodCompletely operable original or older restoration
4FairDriver-quality car with some mechanical issues

7. Human review and override

// Inspector examines the car under proper lighting and confirms or adjusts
const finalized = await tenant.inspections.submitHumanGrades(inspection.id, {
  grades: {
    body_paint:    2,  // confirmed
    chrome_trim:   2,  // confirmed
    interior:      2,  // confirmed
    engine_bay:    2,  // upgraded — valve covers freshly painted, AI read old photo
    undercarriage: 3,  // confirmed
  },
  notes: 'Engine bay recently detailed. Valve cover patina is cosmetic only. Overall Hagerty #2.',
});

console.log('Final grade:', finalized.finalGrades.overall); // 2
console.log('Status:', finalized.status); // "completed"

8. Read the final report

const report = await tenant.inspections.get(inspection.id);

console.log(`Car: ${report.catalogItem.name}`);
console.log(`Schema: ${report.gradingSchema.name}`);
console.log(`Overall: Hagerty #${report.finalGrades.overall}`);
console.log(`Human reviewed: ${report.humanReviewed}`);
console.log(`Completed: ${report.completedAt}`);

// Car: 1965 Ford Mustang Fastback
// Schema: Hagerty Vehicle Grading Scale
// Overall: Hagerty #2
// Human reviewed: true
// Completed: 2026-04-28T16:00:00Z

Next steps