{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ohmyfin-ai/json-schema/ohmyfin-ai-fx-rate-schema.json",
  "title": "FxRate",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ohmyfin-ai-openapi.json#/components/schemas/FxRate",
  "type": "object",
  "properties": {
    "base": {
      "type": "string",
      "description": "Base currency (ISO 4217)."
    },
    "target": {
      "type": "string",
      "description": "Target currency (ISO 4217)."
    },
    "rate": {
      "type": "number",
      "description": "Exchange rate (1 unit of base = rate units of target). Precision up to 6 decimal places."
    },
    "inverse": {
      "type": "number",
      "description": "Inverse rate (1 unit of target = inverse units of base)."
    },
    "rate_date": {
      "type": "string",
      "format": "date",
      "description": "ECB reference date for this rate."
    },
    "source": {
      "type": "string",
      "description": "Data source (always `ecb`).",
      "enum": [
        "ecb"
      ]
    },
    "cross_rate": {
      "type": "boolean",
      "description": "`true` if the rate was computed via EUR triangulation (e.g. USD/GBP = EUR/GBP ÷ EUR/USD).\n`false` for direct EUR/X pairs.\n"
    },
    "disclaimer": {
      "type": "string",
      "description": "Legal disclaimer about rate usage."
    },
    "limits": {
      "$ref": "#/$defs/Limits"
    }
  },
  "$defs": {
    "Limits": {
      "type": "object",
      "description": "Remaining API usage quota.",
      "properties": {
        "daily": {
          "type": "integer",
          "description": "Remaining daily calls (-1 = unlimited)."
        },
        "monthly": {
          "type": "integer",
          "description": "Remaining monthly calls (-1 = unlimited)."
        },
        "annual": {
          "type": "integer",
          "description": "Remaining annual calls (-1 = unlimited)."
        }
      }
    }
  }
}