{
  "openapi": "3.1.0",
  "info": {
    "title": "Tapetide API",
    "version": "1.0.0",
    "summary": "Indian stock-market data: quotes, financials, price history, shareholding, forecasts, deals, options analytics, indices and market flows.",
    "description": "REST access to the same datasets as the Tapetide MCP server, with the same token and the same quota. Authenticate with `Authorization: Bearer <token>`; personal tokens are created at https://tapetide.com/settings. Every successful data request costs one unit from your plan's daily and monthly quota (free tier: 50/day, no monthly cap). Failed requests are refunded. Responses are complete documents: nothing is truncated to fit, and routes that page say so in `meta`. Data is for information only and is not investment advice.",
    "contact": {
      "email": "support@tapetide.com",
      "url": "https://tapetide.com"
    },
    "termsOfService": "https://tapetide.com/terms"
  },
  "servers": [
    {
      "url": "https://api.tapetide.com"
    }
  ],
  "tags": [
    {
      "name": "stocks",
      "description": "Per-stock data"
    },
    {
      "name": "market",
      "description": "Market-wide flows and gauges"
    },
    {
      "name": "indices",
      "description": "NSE index levels and rankings"
    },
    {
      "name": "options",
      "description": "Derivatives analytics"
    },
    {
      "name": "account",
      "description": "Your account"
    }
  ],
  "paths": {
    "/v1/stocks": {
      "get": {
        "operationId": "searchStocks",
        "summary": "Search stocks",
        "description": "Search ~8,200 Indian stocks by name, symbol, BSE code or ISIN. Results are ranked exact-symbol > prefix > contains. Use this to find a symbol before calling the per-stock routes.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search text: a company name, symbol, BSE code or ISIN.",
            "schema": {
              "type": "string"
            },
            "example": "reliance"
          },
          {
            "name": "sector",
            "in": "query",
            "required": false,
            "description": "Filter by sector, e.g. 'Information Technology'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "description": "Filter by industry, e.g. 'Private Bank'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max results (default 10, max 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "example": "10"
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}": {
      "get": {
        "operationId": "getStockProfile",
        "summary": "Company profile",
        "description": "Company overview: sector, about, pros/cons, fundamentals (PE, PB, market cap, ROE, ROCE, debt/equity), growth metrics and the current quote. Add `include` for technicals, analyst ratings or the peer table.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "description": "Comma-separated extra sections: technicals, ratings, peers.",
            "schema": {
              "type": "string",
              "description": "Comma-separated list.",
              "x-max-items": 3
            },
            "example": "technicals,ratings"
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/quote": {
      "get": {
        "operationId": "getStockQuote",
        "summary": "Latest quote",
        "description": "Latest price quote: LTP, change, change %, volume, market cap, PE, PB, 52-week high/low.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/financials": {
      "get": {
        "operationId": "getFinancials",
        "summary": "Financial statements",
        "description": "Financial statements. `section` is one of quarterly (quarterly P&L), profit_loss, balance_sheet, cash_flow, ratios (all annual). Omit it for every section. Each section carries `periods` (oldest first), `data` {row: {period: value}}, `pct_changes`, `row_order` and an `availability` array with the point-in-time `available_from` date per period. Unlike the MCP tool, this route returns the FULL document: `periods` defaults to every period held, and nothing is trimmed to fit a context window. ETFs, index funds and bonds have no statements and return 404.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "section",
            "in": "query",
            "required": false,
            "description": "quarterly | profit_loss | balance_sheet | cash_flow | ratios. Accepted spellings include quarters, quarterly_results, income_statement, pnl, bs, cf.",
            "schema": {
              "type": "string"
            },
            "example": "quarterly"
          },
          {
            "name": "periods",
            "in": "query",
            "required": false,
            "description": "Latest N periods per section (max 40). Default: all periods held. Also accepted as: quarters.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 40
            },
            "example": "12"
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/price": {
      "get": {
        "operationId": "getPriceHistory",
        "summary": "Price history (OHLCV)",
        "description": "Row-per-day OHLCV with delivery %. `days` sets the lookback window (default 365, max 2000); `interval` is the bar size (daily or weekly). `meta.window` states the window actually served and `next_cursor` gives the `end_date` for the preceding page, so a multi-year series is paged with `end_date` until `has_more` is false.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Lookback window in calendar days (default 365, max 2000).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000
            },
            "example": "365"
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "description": "Bar size: daily (default) or weekly. Intraday bars are not served here.",
            "schema": {
              "type": "string",
              "enum": [
                "daily",
                "weekly"
              ]
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "description": "Inclusive YYYY-MM-DD upper bound; the paging cursor. Pass `meta.window.next_cursor` from the previous page.",
            "schema": {
              "type": "string"
            },
            "example": "2025-12-31"
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/shareholding": {
      "get": {
        "operationId": "getShareholding",
        "summary": "Shareholding pattern",
        "description": "Promoter, FII, DII, government and public holdings over time. Every period held is returned; there is no period-type filter (the handler serves the same document to MCP).",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/forecasts": {
      "get": {
        "operationId": "getForecasts",
        "summary": "Analyst forecasts",
        "description": "Analyst estimates vs actuals: EPS, revenue, EBITDA, net income, ROA, ROE and price targets, quarterly and annual.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/events": {
      "get": {
        "operationId": "getStockEvents",
        "summary": "News, corporate actions or filings",
        "description": "Stock events. `type` selects sentiment-tagged news (default), corporate actions (dividends, splits, bonuses, AGMs) or company filings (results, presentations, concall transcripts, annual reports, credit ratings, announcements).",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Event type (default news).",
            "schema": {
              "type": "string",
              "enum": [
                "news",
                "corporate_actions",
                "filings"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max results (default 20, max 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/deals": {
      "get": {
        "operationId": "getStockDeals",
        "summary": "Bulk, block, insider and SAST deals",
        "description": "Large-trade history with counterparty, side, quantity, price and value. Optionally filter to one deal type.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Deal type. Omit for all.",
            "schema": {
              "type": "string",
              "enum": [
                "bulk",
                "block",
                "insider",
                "sast"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max deals (default 25, max 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/pledge": {
      "get": {
        "operationId": "getPromoterPledge",
        "summary": "Promoter share pledge",
        "description": "Percentage of promoter holding pledged over recent quarters plus recent pledge creation/release events.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/ratings": {
      "get": {
        "operationId": "getCreditRatings",
        "summary": "Credit ratings",
        "description": "Credit-rating actions: agency, rating, action (upgrade/downgrade/reaffirm) and outlook over time.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/options": {
      "get": {
        "operationId": "getOptionsAnalytics",
        "summary": "Options analytics per expiry",
        "description": "Derivatives analytics for one underlying: ATM IV, IV rank/percentile, realised vol, put-call ratios, max pain, 25-delta skew and OI, per expiry.",
        "tags": [
          "options"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/earnings-calls": {
      "get": {
        "operationId": "getEarningsCallSummary",
        "summary": "Earnings call summaries",
        "description": "AI-generated digests of recent earnings-call transcripts and investor presentations: summary, highlights, risks, guidance and headline metrics.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Number of recent summaries (default 2, max 5).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/documents": {
      "get": {
        "operationId": "listCompanyDocuments",
        "summary": "List parsed filings",
        "description": "Index of a company's filings parsed to text — concall transcripts, annual reports, investor presentations, IPO documents — with doc_id, type, period, date, page count, availability flags and public links to the PDF, full Markdown and summary. No prose. Newest first.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "doc_types",
            "in": "query",
            "required": false,
            "description": "Comma-separated document types to include (default: all).",
            "schema": {
              "type": "string",
              "description": "Comma-separated list; each item one of: concall, annual_report, presentation, drhp, rhp.",
              "x-max-items": 5,
              "x-item-enum": [
                "concall",
                "annual_report",
                "presentation",
                "drhp",
                "rhp"
              ]
            },
            "example": "annual_report,concall"
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Only filings dated on/after this date, YYYY-MM-DD.",
            "schema": {
              "type": "string"
            },
            "example": "2025-04-01"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max documents (default 20, max 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/documents/summary": {
      "get": {
        "operationId": "getDocumentSummary",
        "summary": "Document investor digest",
        "description": "Investor digest of one parsed filing: summary (capped at 6,000 chars with a truncated flag), highlights, risks, guidance, key metrics, plus links to the PDF and full Markdown. Pass doc_id, or doc_type for the newest of that type.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "doc_id",
            "in": "query",
            "required": false,
            "description": "A doc_id from the documents index.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "doc_type",
            "in": "query",
            "required": false,
            "description": "Newest document of this type when doc_id is omitted.",
            "schema": {
              "type": "string",
              "enum": [
                "concall",
                "annual_report",
                "presentation",
                "drhp",
                "rhp"
              ]
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stocks/{symbol}/documents/read": {
      "get": {
        "operationId": "readDocument",
        "summary": "Read filing text by page range",
        "description": "Markdown text of a parsed filing by doc_id and page range, with <!-- page N --> markers. At most 12 pages / 24,000 chars per call (max_chars up to 60,000); the response states pages_returned and next_pages and carries links to the full Markdown and PDF for local search.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "doc_id",
            "in": "query",
            "required": true,
            "description": "A doc_id from the documents index.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "pages",
            "in": "query",
            "required": false,
            "description": "Inclusive 1-based range: \"1-8\", \"12\", \"40-\". Default \"1-12\".",
            "schema": {
              "type": "string"
            },
            "example": "1-8"
          },
          {
            "name": "max_chars",
            "in": "query",
            "required": false,
            "description": "Character cap for this call (default 24,000).",
            "schema": {
              "type": "integer",
              "minimum": 2000,
              "maximum": 60000
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quotes": {
      "get": {
        "operationId": "getBatchQuotes",
        "summary": "Batch quotes",
        "description": "Latest quotes for up to 20 symbols in one call. Over 20 is rejected with 400; nothing is dropped silently.",
        "tags": [
          "stocks"
        ],
        "parameters": [
          {
            "name": "symbols",
            "in": "query",
            "required": true,
            "description": "Comma-separated symbols, max 20.",
            "schema": {
              "type": "string",
              "description": "Comma-separated list.",
              "x-max-items": 20
            },
            "example": "RELIANCE,TCS,HDFCBANK"
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/market/pulse": {
      "get": {
        "operationId": "getMarketPulse",
        "summary": "Market pulse",
        "description": "Today's snapshot: FII/DII net flows, Nifty 50 valuations (PE/PB/DY) and the India VIX.",
        "tags": [
          "market"
        ],
        "parameters": [],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/market/fii-dii": {
      "get": {
        "operationId": "getFiiDii",
        "summary": "FII/DII institutional flows",
        "description": "Daily cash-market flows for the last 30 sessions, F&O participant positioning, weekly/monthly/yearly aggregates, streaks and cumulative flows. Add `chart_interval` for the cumulative-flow series.",
        "tags": [
          "market"
        ],
        "parameters": [
          {
            "name": "chart_interval",
            "in": "query",
            "required": false,
            "description": "Include cumulative flow chart data for this interval.",
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "3m",
                "6m",
                "1y",
                "5y"
              ]
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/market/vix": {
      "get": {
        "operationId": "getIndiaVix",
        "summary": "India VIX",
        "description": "Latest India VIX, daily change and recent history.",
        "tags": [
          "market"
        ],
        "parameters": [],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/market/fpi-sectors": {
      "get": {
        "operationId": "getFpiSectors",
        "summary": "FPI sector flows",
        "description": "Foreign portfolio investor sector-wise AUM share, fortnight change and 1-year cumulative flow.",
        "tags": [
          "market"
        ],
        "parameters": [],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/market/news": {
      "get": {
        "operationId": "getMarketNews",
        "summary": "Market news",
        "description": "Latest sentiment-tagged market-wide news with category and related symbols.",
        "tags": [
          "market"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max results (default 20, max 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Category filter, e.g. global, markets, ipo, companies.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sentiment",
            "in": "query",
            "required": false,
            "description": "Sentiment filter.",
            "schema": {
              "type": "string",
              "enum": [
                "positive",
                "negative",
                "neutral"
              ]
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/market/valuations": {
      "get": {
        "operationId": "getMarketValuations",
        "summary": "Index valuations",
        "description": "Index PE, PB and dividend yield over time. Default Nifty 50, 5 years.",
        "tags": [
          "market"
        ],
        "parameters": [
          {
            "name": "index",
            "in": "query",
            "required": false,
            "description": "nifty-50 | nifty-500 | nifty-bank | nifty-midcap-50 | nifty-it | nifty-next-50 (default nifty-50).",
            "schema": {
              "type": "string"
            },
            "example": "nifty-50"
          },
          {
            "name": "years",
            "in": "query",
            "required": false,
            "description": "Years of history (default 5, max 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/indices": {
      "get": {
        "operationId": "getIndexPerformance",
        "summary": "Rank indices by return",
        "description": "Rank ~140 NSE indices by return over completed weeks or months using official closing levels. Use `category=sectoral` for sector rankings.",
        "tags": [
          "indices"
        ],
        "parameters": [
          {
            "name": "periods",
            "in": "query",
            "required": false,
            "description": "Completed periods to measure (default 3).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "Period length (default week).",
            "schema": {
              "type": "string",
              "enum": [
                "week",
                "month"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Index family: sectoral, broad, thematic, strategy, ...",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "names",
            "in": "query",
            "required": false,
            "description": "Explicit index names, comma-separated. Overrides category.",
            "schema": {
              "type": "string",
              "description": "Comma-separated list.",
              "x-max-items": 30
            },
            "example": "Nifty IT,Nifty Bank"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Indices to return after ranking (default 10).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort direction (default gainers).",
            "schema": {
              "type": "string",
              "enum": [
                "gainers",
                "losers"
              ]
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/indices/{name}/history": {
      "get": {
        "operationId": "getIndexHistory",
        "summary": "Index level history",
        "description": "OHLC plus PE/PB/dividend-yield series for one NSE index (Nifty 50, Nifty Bank, Nifty IT, India VIX, ...). `interval` is the lookback window: 1m, 3m, 6m, 1y (daily bars) or 2y, max (weekly bars).",
        "tags": [
          "indices"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Index display name, e.g. \"Nifty 50\", \"Nifty IT\", \"India VIX\". Matched case-insensitively.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "description": "Lookback window (default 3m).",
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "3m",
                "6m",
                "1y",
                "2y",
                "max"
              ]
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/options/{symbol}/chain": {
      "get": {
        "operationId": "getOptionChain",
        "summary": "Index option chain",
        "description": "End-of-day stamped option chain for an index underlying (NIFTY, BANKNIFTY, FINNIFTY, MIDCPNIFTY): IV, Greeks, bid/ask and OI by strike. Read `snapshot_ts`; IV fields are percents.",
        "tags": [
          "options"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "expiry",
            "in": "query",
            "required": false,
            "description": "Expiry as YYYY-MM-DD. Omit for the nearest expiry in the snapshot.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "strikes",
            "in": "query",
            "required": false,
            "description": "Strikes each side of ATM.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/options/{symbol}/iv-history": {
      "get": {
        "operationId": "getOptionIvHistory",
        "summary": "Option IV history",
        "description": "Daily ATM IV, IV rank/percentile, realised vol, PCR, max pain and skew series for ~556 underlyings including stocks. Ranges of 2y and longer are weekly bars; read `bar_interval`.",
        "tags": [
          "options"
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "description": "Stock or index symbol, e.g. \"RELIANCE\", \"TCS\", \"NIFTY\". Percent-encode symbols containing \"&\" (M%26M).",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Lookback window (default 1y).",
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "3m",
                "6m",
                "1y",
                "2y",
                "5y",
                "max"
              ]
            }
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 1,
        "responses": {
          "200": {
            "description": "OK. Costs one request unit.",
            "headers": {
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or out-of-range parameter. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The symbol, index or document does not exist. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Per-minute burst cap or plan quota reached.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the binding quota window resets (IST boundaries).",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "A data dependency was unavailable. Not charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/usage": {
      "get": {
        "operationId": "getMyUsage",
        "summary": "Your quota position",
        "description": "The caller's plan and current day/month usage against the counters every request is metered on. Free: this route never charges.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "x-cost": 0,
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "plan": {
                          "type": "string"
                        },
                        "day": {
                          "$ref": "#/components/schemas/QuotaWindow"
                        },
                        "month": {
                          "$ref": "#/components/schemas/QuotaWindow"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Tapetide personal token (tpt_rt_...) or access token (tpt....)."
      }
    },
    "schemas": {
      "Envelope": {
        "type": "object",
        "required": [
          "data",
          "meta"
        ],
        "properties": {
          "data": {
            "description": "The document. Shape is route-specific and never truncated."
          },
          "meta": {
            "type": "object",
            "properties": {
              "as_of": {
                "type": "string",
                "format": "date-time",
                "description": "When this response was assembled (UTC)."
              },
              "route": {
                "type": "string",
                "description": "The operationId that served it."
              }
            },
            "additionalProperties": true,
            "description": "Paging and window information where the route pages (e.g. `window.next_cursor` on price history)."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "authentication_required",
                  "invalid_token",
                  "invalid_request",
                  "route_not_found",
                  "not_found",
                  "method_not_allowed",
                  "rate_limited",
                  "quota_exhausted",
                  "upstream_unavailable",
                  "service_unavailable",
                  "tool_error",
                  "internal_error"
                ]
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      },
      "QuotaWindow": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "description": "IST day (YYYY-MM-DD) or month (YYYY-MM)."
          },
          "used": {
            "type": "integer"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "null means unlimited."
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ]
          },
          "resets_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}