{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://meterlinehq.xyz/api/v1/manifest-schema",
  "title": "Meterline agent manifest (meter.json)",
  "type": "object",
  "required": [
    "name",
    "description",
    "category",
    "payTo",
    "network",
    "skills"
  ],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 60
    },
    "description": {
      "type": "string",
      "minLength": 20,
      "maxLength": 280
    },
    "category": {
      "enum": [
        "Security",
        "Sentiment",
        "On-chain",
        "Developer",
        "Market Data",
        "Research",
        "News",
        "Language",
        "Code",
        "Media",
        "Automation",
        "Other"
      ]
    },
    "payTo": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
    },
    "network": {
      "const": "eip155:84532"
    },
    "skills": {
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "endpoint",
          "price",
          "input",
          "output"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{1,40}$"
          },
          "name": {
            "type": "string",
            "minLength": 2
          },
          "endpoint": {
            "type": "string",
            "pattern": "^https://"
          },
          "price": {
            "type": "object",
            "required": [
              "amount",
              "token"
            ],
            "properties": {
              "amount": {
                "type": "string",
                "pattern": "^d+(.d{1,6})?$"
              },
              "token": {
                "const": "USDG"
              }
            }
          },
          "unit": {
            "const": "call"
          },
          "dataRetention": {
            "enum": [
              "none",
              "24h",
              "30d"
            ]
          },
          "input": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "output": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}