{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pepbank-io/json-schema/pepbank-io-record-response-schema.json",
  "title": "RecordResponse",
  "description": "One record at the current data_seq or at as_of_seq.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pepbank-io-records-api-openapi.yml#/components/schemas/RecordResponse",
  "type": "object",
  "properties": {
    "credit": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "enum": [
            "Data from PepBank"
          ]
        },
        "line": {
          "type": "string",
          "description": "Credit sentence. Copy it as written."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "PepBank page for this result. The home page applies when no single page fits."
        },
        "license_url": {
          "type": "string",
          "enum": [
            "https://creativecommons.org/licenses/by/4.0/"
          ]
        }
      },
      "required": [
        "text",
        "url",
        "license_url"
      ]
    },
    "record_type": {
      "type": "string",
      "enum": [
        "record_response"
      ]
    },
    "entity_type": {
      "type": "string",
      "enum": [
        "peptide",
        "publication",
        "finding",
        "trial"
      ]
    },
    "id": {
      "type": "string"
    },
    "data_seq": {
      "type": "integer"
    },
    "as_of_seq": {
      "type": [
        "integer",
        "null"
      ]
    },
    "record": {
      "type": "object",
      "properties": {
        "record_type": {
          "type": "string"
        }
      },
      "required": [
        "record_type"
      ],
      "additionalProperties": {}
    },
    "usage": {
      "type": "object",
      "properties": {
        "units_charged": {
          "type": "number",
          "minimum": 0,
          "description": "Units that this request used."
        },
        "meter": {
          "type": "string",
          "enum": [
            "query",
            "live_lookups",
            "chat_messages",
            "exports"
          ],
          "description": "Meter that counted this request."
        },
        "remaining": {
          "type": [
            "number",
            "null"
          ],
          "description": "Units left in the current window. Null means no limit."
        },
        "window_resets_at": {
          "type": [
            "string",
            "null"
          ],
          "description": "When the current window ends (ISO 8601)."
        }
      },
      "required": [
        "units_charged",
        "meter",
        "remaining",
        "window_resets_at"
      ],
      "description": "Usage of this request. REST also sends these values in RateLimit headers."
    }
  },
  "required": [
    "credit",
    "record_type",
    "entity_type",
    "id",
    "data_seq",
    "as_of_seq",
    "record",
    "usage"
  ]
}