{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/narrador-io/json-schema/narrador-io-public-api-me-schema.json",
  "title": "PublicApiMe",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/narrador-io-openapi.json#/components/schemas/PublicApiMe",
  "type": "object",
  "required": [
    "user",
    "credits",
    "products"
  ],
  "properties": {
    "user": {
      "type": "object",
      "required": [
        "id",
        "email",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "email": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "app": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "files",
        "x"
      ],
      "description": "Product for user API keys; `null` for OAuth tokens (see `products`)."
    },
    "products": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "files",
          "x"
        ]
      },
      "description": "Products this credential can access (`[app]` for API keys; OAuth may list both)."
    },
    "credits": {
      "type": "object",
      "required": [
        "totalAvailable",
        "balances"
      ],
      "properties": {
        "totalAvailable": {
          "type": "number"
        },
        "balances": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "balance",
              "expiresAt"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "balance": {
                "type": "number"
              },
              "expiresAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          }
        }
      }
    }
  }
}