{
  "openapi": "3.0.2",
  "paths": {
    "/api/v1/rates": {
      "get": {
        "summary": "List all currently published canonical asset-pair rates (scope: rates:read).",
        "tags": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The rates.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "assetPair": {
                            "type": "string"
                          },
                          "base": {
                            "type": "string"
                          },
                          "quote": {
                            "type": "string"
                          },
                          "mid": {
                            "type": "string"
                          },
                          "buyRate": {
                            "type": "string"
                          },
                          "sellRate": {
                            "type": "string"
                          },
                          "computedAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "assetPair",
                          "base",
                          "quote",
                          "mid",
                          "buyRate",
                          "sellRate",
                          "computedAt"
                        ]
                      }
                    }
                  },
                  "required": ["data"]
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, unknown, revoked or expired (code unauthorized).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": ["code", "message"]
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "description": "The scheme to use: Bearer realm=\"Hive public API\".",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have the rates:read access (code forbidden).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": ["code", "message"]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limited).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": ["code", "message"]
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "The number of seconds to wait before a retry.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "Bearer": []
          }
        ]
      }
    },
    "/api/v1/rates/{pair}": {
      "get": {
        "summary": "Get the current canonical rate for an asset pair (scope: rates:read).",
        "tags": [],
        "parameters": [
          {
            "name": "pair",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The current rate for the pair.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assetPair": {
                      "type": "string"
                    },
                    "base": {
                      "type": "string"
                    },
                    "quote": {
                      "type": "string"
                    },
                    "mid": {
                      "type": "string"
                    },
                    "buyRate": {
                      "type": "string"
                    },
                    "sellRate": {
                      "type": "string"
                    },
                    "computedAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "assetPair",
                    "base",
                    "quote",
                    "mid",
                    "buyRate",
                    "sellRate",
                    "computedAt"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid (code bad_request).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": ["code", "message"]
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, unknown, revoked or expired (code unauthorized).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": ["code", "message"]
                }
              }
            },
            "headers": {
              "WWW-Authenticate": {
                "description": "The scheme to use: Bearer realm=\"Hive public API\".",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have the rates:read access (code forbidden).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": ["code", "message"]
                }
              }
            }
          },
          "404": {
            "description": "The pair is not published, or its rate is paused or out of date (code not_found).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": ["code", "message"]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limited).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": ["code", "message"]
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "The number of seconds to wait before a retry.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "No buy or sell price for the pair (code pricing_unavailable).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": ["code", "message"]
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "Bearer": []
          }
        ]
      }
    }
  },
  "info": {
    "title": "Moneybees Rates API",
    "version": "1.0.0",
    "description": "Read-only exchange rates for partner integrations. Send your API key on every request."
  },
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "Bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
