{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/exchangerate-dev/json-schema/exchangerate-dev-account-response-schema.json",
  "title": "AccountResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/exchangerate-dev-account-api-openapi.yml#/components/schemas/AccountResponse",
  "properties": {
    "result": {
      "type": "string",
      "title": "Result",
      "default": "success"
    },
    "email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Email"
    },
    "org": {
      "anyOf": [
        {
          "$ref": "#/$defs/OrgSummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "key": {
      "anyOf": [
        {
          "$ref": "#/$defs/KeySummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "keys": {
      "items": {
        "$ref": "#/$defs/KeyInventorySummary"
      },
      "type": "array",
      "title": "Keys"
    },
    "usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/UsageSummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing": {
      "anyOf": [
        {
          "$ref": "#/$defs/BillingSummary"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "email",
    "org",
    "key",
    "usage"
  ],
  "$defs": {
    "BillingSummary": {
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "none",
            "pending",
            "active",
            "ending",
            "failed",
            "unpaid",
            "ended",
            "complimentary"
          ],
          "title": "State"
        },
        "interval": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "monthly",
                "yearly"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Interval"
        },
        "current_period_end": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Current Period End"
        },
        "ends_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ends At"
        }
      },
      "type": "object",
      "required": [
        "state"
      ],
      "title": "BillingSummary",
      "description": "The account's billing state (docs/BILLING-STATES.md); every screen reads this."
    },
    "KeyInventorySummary": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "prefix": {
          "type": "string",
          "title": "Prefix"
        },
        "created_at": {
          "type": "string",
          "title": "Created At"
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Used At"
        },
        "revoked_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Revoked At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "prefix",
        "created_at"
      ],
      "title": "KeyInventorySummary"
    },
    "KeySummary": {
      "properties": {
        "first_success_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "First Success At"
        },
        "prefix": {
          "type": "string",
          "title": "Prefix"
        },
        "plaintext": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Plaintext"
        },
        "created_at": {
          "type": "string",
          "title": "Created At"
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Used At"
        }
      },
      "type": "object",
      "required": [
        "prefix",
        "created_at"
      ],
      "title": "KeySummary"
    },
    "OrgSummary": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "tier": {
          "type": "string",
          "title": "Tier"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "stream_connections": {
          "type": "integer",
          "title": "Stream Connections",
          "default": 0
        },
        "stream_pairs_per_connection": {
          "type": "integer",
          "title": "Stream Pairs Per Connection",
          "default": 0
        }
      },
      "type": "object",
      "required": [
        "id",
        "tier",
        "status"
      ],
      "title": "OrgSummary"
    },
    "UsageSummary": {
      "properties": {
        "calls_this_month": {
          "type": "integer",
          "title": "Calls This Month"
        },
        "limit": {
          "type": "integer",
          "title": "Limit"
        },
        "resets_on": {
          "type": "string",
          "title": "Resets On"
        }
      },
      "type": "object",
      "required": [
        "calls_this_month",
        "limit",
        "resets_on"
      ],
      "title": "UsageSummary"
    }
  }
}