API Documentation

Integrate roofing claim predictions into your application with a single API call. This guide covers authentication, request/response formats, and usage limits.

#Authentication

All API requests require a valid API key sent in the Authorization header using the Bearer scheme.

Header format
Authorization: Bearer tp_your_api_key_here

How to get your API key: Sign in to your dashboard, navigate to Settings → API Keys, and generate a new key. Keys are prefixed with tp_ and can be revoked at any time.

#Endpoint

POST/api/v1/predict

Submit claim details and receive an instant prediction with confidence scoring and risk analysis.

#Request Body

Send a JSON object with the following fields. All fields are required.

FieldTypeDescription
carrierstringInsurance carrier name (e.g. "Erie", "State Farm", "USAA")
statestringTwo-letter state code (e.g. "PA", "VA")
zipstring5-digit ZIP code (e.g. "17011")
materialstring"Architectural", "3 tab", "Metal", "Slate", etc.
pitchstringRoof pitch: "Flat-2", "3-4", "5-7", "8-10", "11-13", "14+"
roofAgestring"0-5 Years", "6-10 Years", "11-15 Years", "16-20 Years", "Over 30 Years"
roofSizestring"0-15 Squares", "16-20 Squares", "21-25 Squares", "25+ Squares"
storiesstringStories above ground: "1", "1.5", "2", "2.5", "3+"
deductiblenumberPolicy deductible in USD (e.g. 1500)
lossDatestringDate of loss event (YYYY-MM-DD)
descriptionstringDescription of damage (e.g. "Hail and wind damage to roof and siding")
publicAdjusterstringPublic adjuster name or "Unknown"
salesRepstringSales representative name or "Unknown"
teamLeadstringTeam lead name or "Unknown"
Example request bodyJSON
{
  "carrier": "Erie",
  "state": "PA",
  "zip": "17011",
  "material": "Architectural",
  "pitch": "5-7",
  "roofAge": "11-15 Years",
  "roofSize": "16-20 Squares",
  "stories": "2",
  "deductible": 1500,
  "lossDate": "2025-06-15",
  "description": "Hail and wind damage to roof and siding",
  "publicAdjuster": "Unknown",
  "salesRep": "Unknown",
  "teamLead": "Unknown"
}

#Response

A successful prediction returns a JSON object with the prediction result, confidence score, and contributing factors.

Example responseJSON
{
  "prediction": "Approved",
  "confidence": 0.8742,
  "confidenceTier": "high",
  "rareCarrier": false
}
FieldTypeDescription
predictionstring"Approved" or "Denied"
confidencenumberConfidence score between 0 and 1
confidenceTierstring"high", "moderate", or "insufficient_data"
rareCarrierbooleanWhether the carrier has limited training data

#Confidence Tiers

Every prediction includes a confidence tier based on the model's certainty. Use these tiers to decide how much weight to give each prediction.

High

0.75 - 1.00

91% accuracy. Reliable for decision-making.

Moderate

0.60 - 0.74

72% accuracy. Consider additional review.

Insufficient Data

0.50 - 0.59

Low confidence. Manual review recommended.

#Code Examples

cURL

Terminalbash
curl -X POST https://api.turbopredict.com/api/v1/predict \
  -H "Authorization: Bearer tp_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "carrier": "Erie",
    "state": "PA",
    "zip": "17011",
    "material": "Architectural",
    "pitch": "5-7",
    "roofAge": "11-15 Years",
    "roofSize": "16-20 Squares",
    "stories": "2",
    "deductible": 1500,
    "lossDate": "2025-06-15",
    "description": "Hail and wind damage to roof and siding",
    "publicAdjuster": "Unknown",
    "salesRep": "Unknown",
    "teamLead": "Unknown"
  }'

Python

predict.pypython
import requests

response = requests.post(
    "https://api.turbopredict.com/api/v1/predict",
    headers={
        "Authorization": "Bearer tp_your_api_key_here",
        "Content-Type": "application/json",
    },
    json={
        "carrier": "Erie",
        "state": "PA",
        "zip": "17011",
        "material": "Architectural",
        "pitch": "5-7",
        "roofAge": "11-15 Years",
        "roofSize": "16-20 Squares",
        "stories": "2",
        "deductible": 1500,
        "lossDate": "2025-06-15",
        "description": "Hail and wind damage to roof and siding",
        "publicAdjuster": "Unknown",
        "salesRep": "Unknown",
        "teamLead": "Unknown",
    },
)

data = response.json()
print(f"Prediction: {data['prediction']} ({data['confidenceTier']} confidence)")

JavaScript / TypeScript

predict.tsjavascript
const response = await fetch("https://api.turbopredict.com/api/v1/predict", {
  method: "POST",
  headers: {
    "Authorization": "Bearer tp_your_api_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    carrier: "Erie",
    state: "PA",
    zip: "17011",
    material: "Architectural",
    pitch: "5-7",
    roofAge: "11-15 Years",
    roofSize: "16-20 Squares",
    stories: "2",
    deductible: 1500,
    lossDate: "2025-06-15",
    description: "Hail and wind damage to roof and siding",
    publicAdjuster: "Unknown",
    salesRep: "Unknown",
    teamLead: "Unknown",
  }),
});

const data = await response.json();
console.log(`Prediction: ${data.prediction} (${data.confidenceTier} confidence)`);

#Pricing

Each prediction is priced based on the confidence tier of the result. Abstained predictions are always free.

Confidence TierCost
High$60
Moderate$40
Low$20
Abstained$0

Error Responses

  • 401 — Missing or invalid API key. Ensure your Authorization header is set to Bearer tp_xxx.
  • 403 — API key has been deactivated. Generate a new key from your API Keys page.
  • 404 — User profile not found. Contact support@turbopredict.com.
  • 502 — Prediction engine error or unreachable. Try again shortly.
  • 504 — Prediction engine timed out. Try again later.

Need help? Sign in to get started or reach out to support.