{
  "openapi": "3.1.0",
  "info": {
    "title": "Motor Atlas — Indian New-Car Data API",
    "version": "1.0.0",
    "description": "All money outputs use integer paise. Budget filters use whole rupees. Cities default to Delhi. Quotes are estimates with source metadata; missing rules never imply zero tax. Token quotas are per account; day/month windows use UTC. API data may be demo or unreviewed: check source.redistribution_status before commercial use."
  },
  "servers": [
    {
      "url": "/api/v1"
    }
  ],
  "paths": {
    "/account/quota": {
      "get": {
        "operationId": "getAccountQuota",
        "summary": "Read current account quota counters",
        "description": "Requires read:catalog. Account-wide snapshot across all API keys; no account ID parameter. This request consumes normal quota and is included in the returned counters. A fully exhausted account receives 429; the signed-in customer dashboard remains available. Snapshots are approximate under concurrent traffic, are private/no-store, and are not billing totals. Calendar periods use UTC; minute windows start with the first admitted request. near_limit means at least 80% used.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "meta",
                    "data",
                    "errors"
                  ],
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "data": {
                      "$ref": "#/components/schemas/QuotaSnapshot"
                    },
                    "errors": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, or revoked bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient token abilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Account quota exceeded",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retry",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Quota snapshot unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brands": {
      "get": {
        "operationId": "listBrands",
        "summary": "List active manufacturers",
        "description": "Requires read:catalog. Active vehicles only.",
        "tags": [
          "Directory"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "country_of_origin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "meta",
                    "data",
                    "errors"
                  ],
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Brand"
                      }
                    },
                    "errors": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, or revoked bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient token abilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Account quota exceeded",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retry",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/cities": {
      "get": {
        "operationId": "listCities",
        "summary": "List enabled cities in enabled states",
        "description": "Requires read:catalog. Active vehicles only.",
        "tags": [
          "Directory"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": ""
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": ""
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "Town name search"
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "State code, e.g. DL"
          },
          {
            "name": "is_metro",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ]
            },
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "meta",
                    "data",
                    "errors"
                  ],
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/City"
                      }
                    },
                    "errors": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, or revoked bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient token abilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Account quota exceeded",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retry",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/models": {
      "get": {
        "operationId": "listModels",
        "summary": "Filter active models",
        "description": "Requires read:catalog and read:pricing. Active vehicles only.",
        "tags": [
          "Catalog & pricing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": ""
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": ""
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "delhi"
            },
            "description": "City slug. Unknown cities return 422."
          },
          {
            "name": "brand",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Brand slug"
          },
          {
            "name": "body_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "transmission",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact transmission value, e.g. manual or automatic"
          },
          {
            "name": "fuel_type",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "petrol",
                "diesel",
                "cng",
                "electric",
                "hybrid"
              ]
            },
            "description": ""
          },
          {
            "name": "min_price",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Minimum ex-showroom price in whole INR"
          },
          {
            "name": "max_price",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Maximum ex-showroom price in whole INR"
          },
          {
            "name": "min_airbags",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 20
            },
            "description": ""
          },
          {
            "name": "min_ncap_stars",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 5
            },
            "description": ""
          },
          {
            "name": "features[]",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Repeat parameter for required feature slugs; all filters must match one variant"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "meta",
                    "data",
                    "errors"
                  ],
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ModelSummary"
                      }
                    },
                    "errors": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, or revoked bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient token abilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Account quota exceeded",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retry",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/models/{slug}": {
      "get": {
        "operationId": "showModel",
        "summary": "Model overview with active variants",
        "description": "Requires read:catalog and read:pricing. Active vehicles only.",
        "tags": [
          "Catalog & pricing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "delhi"
            },
            "description": "City slug. Unknown cities return 422."
          },
          {
            "name": "registration_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "individual",
                "corporate"
              ],
              "default": "individual"
            },
            "description": ""
          },
          {
            "name": "financed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            },
            "description": ""
          },
          {
            "name": "colour",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            },
            "description": "Optional model-scoped colour slug. Applied to every returned trim; unavailable colours or missing override prices give pricing.available=false. Active colour city price overrides active colour state price. base mode explicitly uses normal trim pricing. Omit to use the standard trim price. Budget filters and stored batch price snapshots remain standard trim prices."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "meta",
                    "data",
                    "errors"
                  ],
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "body_type": {
                          "type": "string"
                        },
                        "brand": {
                          "$ref": "#/components/schemas/Brand"
                        },
                        "variants": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Variant"
                          }
                        }
                      }
                    },
                    "errors": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, or revoked bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient token abilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Account quota exceeded",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retry",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/variants": {
      "get": {
        "operationId": "listVariants",
        "summary": "Search active variant summaries",
        "description": "Requires read:catalog. Active vehicles only.",
        "tags": [
          "Directory"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "description": ""
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": ""
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "Up to 8 words; every word matches the same variant, its model or brand. Percent and underscore are literal characters."
          },
          {
            "name": "brand",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Brand slug"
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Model slug"
          },
          {
            "name": "fuel_type",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "petrol",
                "diesel",
                "cng",
                "electric",
                "hybrid"
              ]
            },
            "description": ""
          },
          {
            "name": "transmission",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Exact transmission value"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "meta",
                    "data",
                    "errors"
                  ],
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/VariantSummary"
                      }
                    },
                    "errors": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, or revoked bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient token abilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Account quota exceeded",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retry",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/variants/compare": {
      "get": {
        "operationId": "compareVariants",
        "summary": "Compare 2 to 4 distinct active variants",
        "description": "Requires read:catalog and read:pricing. Active vehicles only.",
        "tags": [
          "Catalog & pricing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*(,[1-9][0-9]*){1,3}$"
            },
            "example": "1,2"
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "delhi"
            },
            "description": "City slug. Unknown cities return 422."
          },
          {
            "name": "registration_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "individual",
                "corporate"
              ],
              "default": "individual"
            },
            "description": ""
          },
          {
            "name": "financed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            },
            "description": ""
          },
          {
            "name": "colour",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            },
            "description": "Optional model-scoped colour slug. Applied to every returned trim; unavailable colours or missing override prices give pricing.available=false. Active colour city price overrides active colour state price. base mode explicitly uses normal trim pricing. Omit to use the standard trim price. Budget filters and stored batch price snapshots remain standard trim prices."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "meta",
                    "data",
                    "errors"
                  ],
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "variants": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Variant"
                          }
                        },
                        "feature_matrix": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "values": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "variant_id": {
                                      "type": "integer"
                                    },
                                    "available": {
                                      "type": [
                                        "boolean",
                                        "null"
                                      ],
                                      "description": "Null means unknown"
                                    },
                                    "value": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "specification_matrix": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              },
                              "data_type": {
                                "type": "string"
                              },
                              "unit": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "values": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "variant_id": {
                                      "type": "integer"
                                    },
                                    "value": {
                                      "type": [
                                        "string",
                                        "null"
                                      ],
                                      "description": "Null means unverified or unrecorded."
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "errors": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, or revoked bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient token abilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Account quota exceeded",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retry",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/variants/{slug}": {
      "get": {
        "operationId": "showVariant",
        "summary": "Full technical specifications and price breakup",
        "description": "Requires read:catalog and read:pricing. Active vehicles only.",
        "tags": [
          "Catalog & pricing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "delhi"
            },
            "description": "City slug. Unknown cities return 422."
          },
          {
            "name": "registration_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "individual",
                "corporate"
              ],
              "default": "individual"
            },
            "description": ""
          },
          {
            "name": "financed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            },
            "description": ""
          },
          {
            "name": "colour",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            },
            "description": "Optional model-scoped colour slug. Applied to every returned trim; unavailable colours or missing override prices give pricing.available=false. Active colour city price overrides active colour state price. base mode explicitly uses normal trim pricing. Omit to use the standard trim price. Budget filters and stored batch price snapshots remain standard trim prices."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "meta",
                    "data",
                    "errors"
                  ],
                  "properties": {
                    "status": {
                      "const": "success"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Variant"
                    },
                    "errors": {
                      "type": "array",
                      "maxItems": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, or revoked bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient token abilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Account quota exceeded",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retry",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Sanctum personal access token"
      }
    },
    "schemas": {
      "Colour": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "paint_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "primary_hex": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "secondary_hex": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^#[0-9a-fA-F]{6}$"
          },
          "dual_tone": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "pricing_mode": {
            "enum": [
              "base",
              "override"
            ]
          },
          "source": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "last_verified_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "availability_source": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              },
              "last_verified_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Media"
            }
          }
        }
      },
      "Brand": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "country_of_origin": {
            "type": "string"
          }
        }
      },
      "City": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "is_metro": {
            "type": "boolean"
          },
          "state": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "source": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "census_town_code": {
                    "type": "string"
                  },
                  "year": {
                    "type": "integer"
                  },
                  "url": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "Historical town identity; the source year does not certify current boundaries or price coverage."
          }
        }
      },
      "ModelSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "body_type": {
            "type": "string"
          },
          "brand": {
            "$ref": "#/components/schemas/Brand"
          },
          "active_variant_count": {
            "type": "integer"
          }
        }
      },
      "VariantSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "fuel_type": {
            "type": "string"
          },
          "transmission": {
            "type": "string"
          },
          "is_demo": {
            "type": "boolean"
          },
          "model": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            }
          },
          "brand": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            }
          }
        }
      },
      "Feature": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "value": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Media": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "alt": {
            "type": "string"
          },
          "rights": {
            "type": "string",
            "enum": [
              "oem_press",
              "original",
              "licensed"
            ]
          }
        }
      },
      "Pricing": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "available",
              "currency",
              "unit",
              "components",
              "total_paise"
            ],
            "properties": {
              "available": {
                "const": true
              },
              "currency": {
                "const": "INR"
              },
              "unit": {
                "const": "paise"
              },
              "is_estimate": {
                "const": true
              },
              "is_demo": {
                "type": "boolean"
              },
              "city": {
                "type": "string"
              },
              "registration_type": {
                "type": "string"
              },
              "financed": {
                "type": "boolean"
              },
              "components": {
                "type": "object",
                "properties": {
                  "ex_showroom": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "road_tax": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "tcs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "insurance_estimate": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "fastag": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "registration": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "hypothecation": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "total_paise": {
                "type": "integer",
                "minimum": 0
              },
              "price_source": {
                "type": "object",
                "properties": {
                  "level": {
                    "enum": [
                      "city",
                      "state"
                    ]
                  },
                  "url": {
                    "type": "string"
                  },
                  "last_verified_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "tax_source": {
                "type": "object",
                "properties": {
                  "revision_id": {
                    "type": "integer"
                  },
                  "url": {
                    "type": "string"
                  },
                  "effective_from": {
                    "type": "string",
                    "format": "date"
                  },
                  "effective_until": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date"
                  },
                  "last_verified_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "colour": {
                "type": "string"
              },
              "colour_pricing": {
                "enum": [
                  "base",
                  "override"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "available",
              "reason",
              "city"
            ],
            "properties": {
              "available": {
                "const": false
              },
              "reason": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "partial_components": {
                "type": "object",
                "properties": {
                  "ex_showroom": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "road_tax": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "registration": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "hypothecation": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "road_safety_cess": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "description": "Optional independently known components. Their sum is not a complete on-road price. Omitted fees are unknown, not zero."
              },
              "coverage_note": {
                "type": "string"
              },
              "pending_charges": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "charge_sources": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "last_verified_at": {
                      "type": "string",
                      "description": "Date or timestamp when this fee source was checked."
                    },
                    "note": {
                      "type": "string"
                    },
                    "basis": {
                      "enum": [
                        "fixed",
                        "road_tax"
                      ]
                    },
                    "applies": {
                      "type": "boolean",
                      "description": "False for hypothecation when the vehicle is not financed; its component is then zero."
                    }
                  }
                }
              },
              "price_source": {
                "type": "object",
                "properties": {
                  "level": {
                    "enum": [
                      "city",
                      "state"
                    ]
                  },
                  "url": {
                    "type": "string"
                  },
                  "last_verified_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "tax_source": {
                "type": "object",
                "properties": {
                  "revision_id": {
                    "type": "integer"
                  },
                  "url": {
                    "type": "string"
                  },
                  "effective_from": {
                    "type": "string",
                    "format": "date"
                  },
                  "effective_until": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date"
                  },
                  "last_verified_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "colour": {
                "type": "string"
              }
            }
          }
        ]
      },
      "Variant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            }
          },
          "brand": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              }
            }
          },
          "fuel_type": {
            "type": "string",
            "enum": [
              "petrol",
              "diesel",
              "cng",
              "electric",
              "hybrid"
            ]
          },
          "transmission": {
            "type": "string"
          },
          "specifications": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "engine_cc": {
                    "description": "Null means unverified or not applicable.",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "power_bhp": {
                    "description": "Null means unverified or not applicable.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "torque_nm": {
                    "description": "Null means unverified or not applicable.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "arai_mileage": {
                    "description": "Null means unverified or not applicable.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "mileage_unit": {
                    "description": "Null means unverified or not applicable.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "airbags": {
                    "description": "Null means unverified or not applicable.",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "ncap_stars": {
                    "description": "Null means unverified or not applicable.",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "ncap_program": {
                    "description": "Null means unverified or not applicable.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ncap_year": {
                    "description": "Null means unverified or not applicable.",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Feature"
            }
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Media"
            }
          },
          "source": {
            "type": "object",
            "properties": {
              "brochure_date": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date",
                "description": "Null when the source does not provide a known publication date."
              },
              "last_verified_at": {
                "type": "string",
                "format": "date-time"
              },
              "url": {
                "type": "string"
              },
              "redistribution_status": {
                "enum": [
                  "unreviewed",
                  "approved",
                  "demo"
                ],
                "description": "Approved only when the latest recorded source review matches current catalog data."
              },
              "review": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "unreviewed",
                      "approved",
                      "demo",
                      null
                    ]
                  },
                  "current": {
                    "type": "boolean"
                  },
                  "reviewed_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  }
                }
              }
            }
          },
          "pricing": {
            "$ref": "#/components/schemas/Pricing"
          },
          "additional_specifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdditionalSpecification"
            }
          },
          "colours": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Colour"
            },
            "description": "Assigned active model colours for this trim. available=false is explicit; unlisted colours are unknown. Images follow the token audience and licence rules."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "status",
          "meta",
          "data",
          "errors"
        ],
        "properties": {
          "status": {
            "const": "error"
          },
          "meta": {
            "type": "object"
          },
          "data": {
            "type": "null"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "integer"
                },
                "message": {
                  "type": "string"
                },
                "details": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "AdditionalSpecification": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "data_type": {
            "type": "string",
            "enum": [
              "integer",
              "decimal",
              "text"
            ]
          },
          "unit": {
            "type": [
              "string",
              "null"
            ]
          },
          "value": {
            "type": "string",
            "description": "Exact recorded value. Numeric values are strings to preserve precision; see data_type and unit."
          }
        }
      },
      "QuotaWindow": {
        "type": "object",
        "required": [
          "period",
          "limit",
          "used",
          "remaining",
          "resets_at",
          "state"
        ],
        "properties": {
          "period": {
            "enum": [
              "minute",
              "day",
              "month"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 0
          },
          "used": {
            "type": "integer",
            "minimum": 0
          },
          "remaining": {
            "type": "integer",
            "minimum": 0
          },
          "resets_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "UTC. Null for a minute window with no active timer; it starts on the next admitted API request."
          },
          "state": {
            "enum": [
              "normal",
              "near_limit",
              "exhausted"
            ]
          }
        }
      },
      "QuotaSnapshot": {
        "type": "object",
        "required": [
          "available",
          "plan",
          "observed_at",
          "windows"
        ],
        "properties": {
          "available": {
            "const": true
          },
          "plan": {
            "enum": [
              "sandbox",
              "pro",
              "internal"
            ]
          },
          "observed_at": {
            "type": "string",
            "format": "date-time"
          },
          "windows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuotaWindow"
            }
          }
        }
      }
    }
  }
}
