{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flatmark-dev/json-schema/flatmark-dev-me-response-schema.json",
  "title": "MeResponse",
  "description": "The `GET /v1/me` payload: who the request is authenticated as, what is\nleft of your request and credit allowances, and which features your plan\nincludes.",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flatmark-dev-openapi.json#/components/schemas/MeResponse",
  "properties": {
    "tier": {
      "type": "string",
      "title": "Tier",
      "description": "The plan this request is served on."
    },
    "is_keyed": {
      "type": "boolean",
      "title": "Is Keyed",
      "description": "Whether the request carried a valid API key. Without an `X-API-Key`, the call runs anonymously at the rate limit for calls without a key."
    },
    "rate_limit": {
      "$ref": "#/$defs/RateLimitInfo"
    },
    "credits": {
      "anyOf": [
        {
          "$ref": "#/$defs/CreditsInfo"
        },
        {
          "type": "null"
        }
      ],
      "description": "Null on plans that are not priced in credits."
    },
    "features": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Features",
      "description": "The features your plan includes."
    }
  },
  "type": "object",
  "required": [
    "tier",
    "is_keyed",
    "rate_limit",
    "features"
  ],
  "$defs": {
    "CreditsInfo": {
      "properties": {
        "balance": {
          "type": "integer",
          "title": "Balance"
        },
        "granted": {
          "type": "integer",
          "title": "Granted"
        },
        "period_end": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Period End"
        }
      },
      "type": "object",
      "required": [
        "balance",
        "granted"
      ],
      "title": "CreditsInfo",
      "description": "Your credit balance for the current billing period. `granted` is what\nyour plan included, `balance` what is still unspent, and `period_end` the\ndate (ISO 8601) your allowance refills. Present only on plans that are\npriced in credits."
    },
    "RateLimitInfo": {
      "properties": {
        "limit": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Limit"
        },
        "remaining": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Remaining"
        },
        "reset": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reset"
        }
      },
      "type": "object",
      "title": "RateLimitInfo",
      "description": "How many requests you may still make in the current window. These are the\nsame numbers as the `X-RateLimit-*` response headers. `limit` is the size of the\nwindow, `remaining` what is left of it, and `reset` how many seconds until\nit refills (not a timestamp). All three are `null` in the rare case the\ncounter cannot be read; treat that as \"unknown\", not zero."
    }
  }
}