{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tradingpal-io/json-schema/tradingpal-io-me-schema.json",
  "title": "Me",
  "description": "The calling key, the plan, the account's limits and how many tickers it tracks.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tradingpal-io-openapi.json#/components/schemas/Me",
  "type": "object",
  "properties": {
    "api_version": {
      "type": "string",
      "const": "v1",
      "description": "The contract version, always v1. Field names in v1 do not change, and v1 stays available at least 12 months after a v2 ships."
    },
    "as_of_session": {
      "type": [
        "string",
        "null"
      ],
      "description": "The last trading session the data describes, as an ISO date. Setups change nightly, so say it when presenting data and do not cache setups across days. Null on routes that do not read a dated artifact (account, tickers, history, families, universe and the demo index).",
      "format": "date"
    },
    "data_version": {
      "type": [
        "string",
        "null"
      ],
      "description": "Identifier of the stored artifact the answer came from: the candidate-book generation for patterns, the sealed manifest for family records. Null when the route reads no versioned artifact."
    },
    "source": {
      "type": "object",
      "description": "Who produced the data. Constant on every response.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Always \"TradingPal\"."
        },
        "url": {
          "type": "string",
          "description": "Always https://tradingpal.io.",
          "format": "uri"
        }
      }
    },
    "disclaimer": {
      "type": "string",
      "const": "Educational breakout-pattern analysis from TradingPal, not investment advice. Past results do not guarantee future outcomes.",
      "description": "The educational-use disclaimer, constant on every response. Repeat it when presenting a setup as something the user might act on."
    },
    "key": {
      "type": "object",
      "description": "The key that made the call, without its secret.",
      "properties": {
        "prefix": {
          "type": "string",
          "description": "The first 16 characters of the key (tp_live_ plus eight)."
        },
        "name": {
          "type": "string",
          "description": "The label given when the key was created."
        },
        "created_at": {
          "type": "string",
          "description": "When the key was created, ISO 8601 date-time.",
          "format": "date-time"
        }
      }
    },
    "plan": {
      "type": "string",
      "description": "The account's plan: api (Premium+, which includes Premium) or staff. No other account passes the gate.",
      "enum": [
        "api",
        "staff"
      ]
    },
    "limits": {
      "type": "object",
      "description": "The account's limits. Every value is an integer.",
      "properties": {
        "tracked_tickers": {
          "type": "integer",
          "description": "How many tickers the account may track: the cap PUT /tickers enforces."
        },
        "requests_per_minute": {
          "type": "integer",
          "description": "Per-key burst limit, requests per minute (60)."
        },
        "requests_per_day": {
          "type": "integer",
          "description": "Per-key daily limit, requests per day (10,000)."
        }
      },
      "additionalProperties": {
        "type": "integer",
        "description": "Any further limit, as an integer."
      }
    },
    "tracked_ticker_count": {
      "type": "integer",
      "description": "How many tickers the account tracks now."
    },
    "docs_url": {
      "type": "string",
      "description": "The developer docs, where keys are managed.",
      "format": "uri"
    },
    "mcp_url": {
      "type": "string",
      "description": "The MCP server endpoint (Streamable HTTP), which takes the same key.",
      "format": "uri"
    }
  },
  "required": [
    "api_version",
    "as_of_session",
    "source",
    "disclaimer"
  ]
}