{
  "openapi": "3.0.3",
  "info": {
    "title": "US Vehicle Tax & Fees API",
    "version": "1.0.0",
    "description": "Car sales tax, title, registration and DMV fees for all 50 states and DC in one call. Applies each state's own rules for trade-ins, rebates, doc fees, EV and hybrid fees, and returns a line-by-line breakdown with the out-the-door price. Every rate is checked against official state DMV and revenue department sources, which are returned with each answer. Built for car dealers, auto lenders, credit unions, marketplaces and fintech apps.",
    "contact": {
      "name": "US Vehicle Tax Calculator",
      "url": "https://usvehicletaxcalculator.com/contact/"
    }
  },
  "servers": [
    {
      "url": "https://api.usvehicletaxcalculator.com"
    }
  ],
  "paths": {
    "/v1/calculate": {
      "get": {
        "summary": "Calculate tax, title and registration",
        "operationId": "calculate",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "description": "Two-letter state code (50 states + DC).",
            "schema": {
              "type": "string",
              "enum": [
                "AL",
                "AK",
                "AZ",
                "AR",
                "CA",
                "CO",
                "CT",
                "DE",
                "DC",
                "FL",
                "GA",
                "HI",
                "ID",
                "IL",
                "IN",
                "IA",
                "KS",
                "KY",
                "LA",
                "ME",
                "MD",
                "MA",
                "MI",
                "MN",
                "MS",
                "MO",
                "MT",
                "NE",
                "NV",
                "NH",
                "NJ",
                "NM",
                "NY",
                "NC",
                "ND",
                "OH",
                "OK",
                "OR",
                "PA",
                "RI",
                "SC",
                "SD",
                "TN",
                "TX",
                "UT",
                "VT",
                "VA",
                "WA",
                "WV",
                "WI",
                "WY"
              ]
            },
            "example": "TX"
          },
          {
            "name": "price",
            "in": "query",
            "required": true,
            "description": "Purchase price in USD.",
            "schema": {
              "type": "number",
              "minimum": 0
            },
            "example": 30000
          },
          {
            "name": "trade_in",
            "in": "query",
            "required": false,
            "description": "Trade-in value in USD. Each state decides whether it lowers the tax.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "rebate",
            "in": "query",
            "required": false,
            "description": "Manufacturer rebate in USD.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "doc_fee",
            "in": "query",
            "required": false,
            "description": "Dealer documentation fee in USD.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "seller",
            "in": "query",
            "required": false,
            "description": "Who sells the vehicle.",
            "schema": {
              "type": "string",
              "enum": [
                "dealer",
                "private"
              ],
              "default": "dealer"
            }
          },
          {
            "name": "condition",
            "in": "query",
            "required": false,
            "description": "New or used.",
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "used"
              ],
              "default": "new"
            }
          },
          {
            "name": "fuel",
            "in": "query",
            "required": false,
            "description": "Fuel type (EV and hybrid fees differ by state).",
            "schema": {
              "type": "string",
              "enum": [
                "gas",
                "hybrid",
                "phev",
                "ev"
              ],
              "default": "gas"
            }
          },
          {
            "name": "local_rate",
            "in": "query",
            "required": false,
            "description": "City/county tax rate in percent, e.g. 1.25. Only used in states listed with local_rate in inputs_used.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 20,
              "default": 0
            }
          },
          {
            "name": "msrp",
            "in": "query",
            "required": false,
            "description": "Original MSRP in USD (value-based registration fees).",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "model_year",
            "in": "query",
            "required": false,
            "description": "Model year (age-based fees). Leave empty for the current year.",
            "schema": {
              "type": "integer",
              "minimum": 1950
            },
            "example": 2026
          },
          {
            "name": "weight_lb",
            "in": "query",
            "required": false,
            "description": "Vehicle weight in pounds (weight-based fees).",
            "schema": {
              "type": "number",
              "default": 3500
            }
          },
          {
            "name": "mpg",
            "in": "query",
            "required": false,
            "description": "City MPG (fuel-economy-based fees).",
            "schema": {
              "type": "number",
              "default": 28
            }
          },
          {
            "name": "standard_presumptive_value",
            "in": "query",
            "required": false,
            "description": "Texas private sales: standard presumptive value in USD.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "exempt",
            "in": "query",
            "required": false,
            "description": "Treat as a tax-exempt transfer (gift, inheritance).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Breakdown and totals",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Calculation"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/states": {
      "get": {
        "summary": "List states and the inputs each one uses",
        "operationId": "listStates",
        "responses": {
          "200": {
            "description": "All 51 jurisdictions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "data_verified_on": {
                      "type": "string"
                    },
                    "states": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/StateSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/states/{code}": {
      "get": {
        "summary": "State tax rates, fee schedule, exceptions and sources",
        "operationId": "getState",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "AL",
                "AK",
                "AZ",
                "AR",
                "CA",
                "CO",
                "CT",
                "DE",
                "DC",
                "FL",
                "GA",
                "HI",
                "ID",
                "IL",
                "IN",
                "IA",
                "KS",
                "KY",
                "LA",
                "ME",
                "MD",
                "MA",
                "MI",
                "MN",
                "MS",
                "MO",
                "MT",
                "NE",
                "NV",
                "NH",
                "NJ",
                "NM",
                "NY",
                "NC",
                "ND",
                "OH",
                "OK",
                "OR",
                "PA",
                "RI",
                "SC",
                "SD",
                "TN",
                "TX",
                "UT",
                "VT",
                "VA",
                "WA",
                "WV",
                "WI",
                "WY"
              ]
            },
            "example": "CA"
          }
        ],
        "responses": {
          "200": {
            "description": "State detail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "summary": "Service status and data date",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "StateSummary": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tax_type": {
            "type": "string"
          },
          "inputs_used": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "local_rate_label": {
            "type": "string"
          },
          "checked_on": {
            "type": "string"
          }
        }
      },
      "Calculation": {
        "type": "object",
        "properties": {
          "state": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "inputs": {
            "type": "object"
          },
          "taxes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "amount": {
                  "type": "number"
                },
                "detail": {
                  "type": "string"
                }
              }
            }
          },
          "fees": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "amount": {
                  "type": "number"
                },
                "detail": {
                  "type": "string"
                }
              }
            }
          },
          "totals": {
            "type": "object",
            "properties": {
              "taxes": {
                "type": "number"
              },
              "fees": {
                "type": "number"
              },
              "taxes_and_fees": {
                "type": "number"
              },
              "effective_tax_rate": {
                "type": "number"
              },
              "out_the_door": {
                "type": "number"
              },
              "due_after_trade_in": {
                "type": "number"
              }
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "type": "object",
            "properties": {
              "checked_on": {
                "type": "string"
              },
              "official_sources": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "disclaimer": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}