ENTERPRISE API GUIDE

Enterprise Integration.
Build. Integrate. Scale.

Send fault codes and vehicle evidence from your shop management system, fleet platform or scan tool to the Diagnostic Engine over one REST endpoint.

Authentication

Every request carries a partner key in the x-api-key header. There is one credential type: keys begin lp_live_ and are issued by Lane Pilot — email service@lanepilot.io. No Lane Pilot plan unlocks self-serve keys.

Keys are stored server-side only as SHA-256 hashes. A key can be restricted to an IP allowlist, and it carries its own per-minute and monthly session limits.

x-api-key: lp_live_xxxxxxxxxxxxxxxx

POST /diagnose

POSThttps://fuuxaiwngfdvypfexpyv.supabase.co/functions/v1/api-gateway/diagnose

The one live partner endpoint. Send vehicle details, fault codes and any evidence you have; the response is a JSON envelope whose diagnosis.text is Markdown written for a technician. Each call is a full engine run, not a lookup, so give your HTTP client a generous timeout.

Request fields

FieldTypeRequiredDescription
makestringRequiredVehicle make, e.g. "Ford", "Land Rover".
fault_codesstring[]RequiredDTCs as an array, e.g. ["P0016", "P0299"].
modelstringOptionalVehicle model.
yearnumberOptionalModel year.
vinstringOptional17-character VIN.
symptomstringOptionalCustomer concern or tech notes, in plain text.
obd_telemetryobjectOptionalFLAT map of reading → value (numbers or strings). Each pair reaches the engine as a "key: value" line; nested objects are not read.
freeze_frameobject | object[]OptionalOne frame or an array: { "dtc": "P0016", "pids": { reading: value } }.
mode6_resultsobject[]OptionalMode 06 tests: { "test_name" (or "test_id"), "value", "unit", "status": "PASS" | "FAIL" }.

Request body

JSON
{
  "make": "Ford",
  "model": "F-150",
  "year": 2013,
  "vin": "1FTFW1ET5DFC10312",
  "fault_codes": [
    "P0016",
    "P0299"
  ],
  "symptom": "Rattle on cold start, loss of boost under load",
  "obd_telemetry": {
    "engine_rpm": 780,
    "short_fuel_trim_b1": 18.5,
    "long_fuel_trim_b1": 12.3,
    "coolant_temp_c": 88
  },
  "freeze_frame": [
    {
      "dtc": "P0016",
      "pids": {
        "engine_rpm": 2450,
        "calc_load_pct": 88.4
      }
    }
  ],
  "mode6_results": [
    {
      "test_name": "Catalyst monitor B1",
      "value": 0.42,
      "unit": "ratio",
      "status": "PASS"
    }
  ]
}

Response (200 OK)

JSON
{
  "diagnosis": {
    "text": "### Likely cause\n\nCam/crank correlation fault on bank 1...\n\n### Next check\n\nCompare cam and crank signals at idle...",
    "vehicle": {
      "vin": "1FTFW1ET5DFC10312",
      "make": "Ford",
      "model": "F-150",
      "year": 2013
    },
    "fault_codes": [
      "P0016",
      "P0299"
    ]
  },
  "meta": {
    "response_time_ms": 41280,
    "partner": "Your Company",
    "tier": "starter_integration",
    "usage": {
      "sessions_used": 42,
      "monthly_limit": 10000,
      "price_cents": null
    }
  }
}

meta.usage.price_cents is your key’s agreed per-session rate, in cents. diagnosis.text is Markdown; render it rather than parsing its headings, which are not a stable contract.

Limits & Usage Headers

  • 60 requests per minute per client IP, across the gateway.
  • A per-minute request limit and a monthly session limit set on your key, agreed when it is issued.
  • Each successful POST /diagnose is metered as one session.

Headers on every successful response

X-RateLimit-RemainingRequests left in the current minute under your key's per-minute limit.
X-Sessions-UsedSessions metered to your key this period, including this one.
X-Sessions-LimitYour key's monthly session limit, or "unlimited" when it has none.
X-Response-Time-MsTime the gateway spent on the request, in milliseconds.

Errors

Error bodies are JSON with an error message.

HTTPWhen
400make or fault_codes is missing, or the body is not valid JSON.
401No x-api-key header, or the key is not recognised.
403The key is revoked, the client IP is not on the key's allowlist, or the credential is not a partner key (lp_live_…).
404Unknown path. POST /diagnose is the only live route.
429Over a limit: 60 requests per minute per client IP; your key's per-minute limit (with Retry-After: 60); or your key's monthly session limit (the body carries used and limit).
501The suspended fleet GET endpoints. They stay off until per-partner data scoping ships; POST /diagnose is unaffected.
502The Diagnostic Engine returned an error; the body carries its status. Not metered.

Code Examples

cURL
curl -X POST \
  https://fuuxaiwngfdvypfexpyv.supabase.co/functions/v1/api-gateway/diagnose \
  -H "Content-Type: application/json" \
  -H "x-api-key: lp_live_your_key_here" \
  -d '{
    "make": "Ford",
    "model": "F-150",
    "year": 2013,
    "vin": "1FTFW1ET5DFC10312",
    "fault_codes": [
      "P0016",
      "P0299"
    ],
    "symptom": "Rattle on cold start, loss of boost under load",
    "obd_telemetry": {
      "engine_rpm": 780,
      "short_fuel_trim_b1": 18.5,
      "long_fuel_trim_b1": 12.3,
      "coolant_temp_c": 88
    },
    "freeze_frame": [
      {
        "dtc": "P0016",
        "pids": {
          "engine_rpm": 2450,
          "calc_load_pct": 88.4
        }
      }
    ],
    "mode6_results": [
      {
        "test_name": "Catalyst monitor B1",
        "value": 0.42,
        "unit": "ratio",
        "status": "PASS"
      }
    ]
  }'
JavaScript (fetch)
const response = await fetch(
  'https://fuuxaiwngfdvypfexpyv.supabase.co/functions/v1/api-gateway/diagnose',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': process.env.LANE_PILOT_API_KEY,
    },
    body: JSON.stringify({
      "make": "Ford",
      "model": "F-150",
      "year": 2013,
      "vin": "1FTFW1ET5DFC10312",
      "fault_codes": [
        "P0016",
        "P0299"
      ],
      "symptom": "Rattle on cold start, loss of boost under load",
      "obd_telemetry": {
        "engine_rpm": 780,
        "short_fuel_trim_b1": 18.5,
        "long_fuel_trim_b1": 12.3,
        "coolant_temp_c": 88
      },
      "freeze_frame": [
        {
          "dtc": "P0016",
          "pids": {
            "engine_rpm": 2450,
            "calc_load_pct": 88.4
          }
        }
      ],
      "mode6_results": [
        {
          "test_name": "Catalyst monitor B1",
          "value": 0.42,
          "unit": "ratio",
          "status": "PASS"
        }
      ]
    }),
  }
);

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`Lane Pilot ${response.status}: ${error}`);
}

const { diagnosis, meta } = await response.json();
console.log('Diagnosis:', diagnosis.text);
console.log('Usage:', meta.usage.sessions_used, '/', meta.usage.monthly_limit ?? 'unlimited');

FAQ