{
  "openapi": "3.1.0",
  "info": {
    "title": "Wrenchit AI Agent API",
    "version": "1.0.0",
    "description": "Public vehicle-reference API for AI assistants: vehicle questions from symptoms or OBD-II codes, VIN recall lookup, maintenance schedules, and code/symptom references. Treat possible causes as guidance, link to returned canonical URLs, and preserve returned safety and cost disclaimers.",
    "contact": {
      "name": "Wrenchit",
      "url": "https://wrenchit.ai/ai-integrations",
      "email": "hello@wrenchit.ai"
    }
  },
  "servers": [
    {
      "url": "https://uhecmcsvwchshsxjevhb.supabase.co/functions/v1/agent-api"
    }
  ],
  "paths": {
    "/v1/diagnose": {
      "get": {
        "summary": "Ask Wrenchit AI about a vehicle problem (URL-fetchable)",
        "description": "Returns possible causes, useful checks, safety guidance, a citable URL, and a disclaimer. Add format=md for markdown.",
        "parameters": [
          {
            "name": "symptom",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "grinding noise when braking"
          },
          {
            "name": "code",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "example": "P0420"
          },
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "make",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "model",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mileage",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "md"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Diagnosis"
          },
          "429": {
            "description": "Daily quota reached"
          }
        }
      },
      "post": {
        "summary": "Ask Wrenchit AI about a vehicle problem (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symptom": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "year": {
                    "type": "string"
                  },
                  "make": {
                    "type": "string"
                  },
                  "model": {
                    "type": "string"
                  },
                  "mileage": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Diagnosis"
          },
          "429": {
            "description": "Daily quota reached"
          }
        }
      }
    },
    "/v1/answers/{shortId}": {
      "get": {
        "summary": "Re-read a generated diagnosis (append .md for markdown)",
        "parameters": [
          {
            "name": "shortId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stored answer"
          },
          "404": {
            "description": "Expired or not found"
          }
        }
      }
    },
    "/v1/vin/{vin}": {
      "get": {
        "summary": "Decode a VIN and list open US recalls (public NHTSA data)",
        "parameters": [
          {
            "name": "vin",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vehicle and recalls"
          }
        }
      }
    },
    "/v1/maintenance/{make}/{model}": {
      "get": {
        "summary": "Service schedule for a make and model (append .md for markdown)",
        "parameters": [
          {
            "name": "make",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Maintenance schedule"
          }
        }
      }
    },
    "/v1/codes/{code}": {
      "get": {
        "summary": "OBD-II trouble code reference (append .md for markdown)",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Code detail"
          }
        }
      }
    },
    "/v1/symptoms/{slug}": {
      "get": {
        "summary": "Symptom reference page (append .md for markdown)",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Symptom detail"
          }
        }
      }
    },
    "/v1/llms-full.txt": {
      "get": {
        "summary": "Concatenated markdown knowledge corpus",
        "responses": {
          "200": {
            "description": "text/plain"
          }
        }
      }
    }
  }
}
