{
  "openapi": "3.1.0",
  "info": {
    "title": "CalcX Investment API",
    "version": "Unversioned",
    "description": "Model simple and compound returns, ROI, capital-gains tax and APY through single or batch calculations.",
    "x-pricing-model": "payg",
    "x-free-tier-calls": 0,
    "x-docs-url": "",
    "x-dakidarts-contract-status": "published",
    "x-dakidarts-execution-status": "source-only"
  },
  "servers": [
    {
      "url": "https://api.dakidarts.com/calcx-investment",
      "description": "Dakidarts direct gateway"
    }
  ],
  "tags": [
    {
      "name": "Operations",
      "description": "Operations endpoints sourced from the CalcX Investment API implementation."
    },
    {
      "name": "Investment calculations",
      "description": "Investment calculations endpoints sourced from the CalcX Investment API implementation."
    }
  ],
  "paths": {
    "/status": {
      "get": {
        "summary": "Ping",
        "description": "Returns Calcx Investment service health and availability.",
        "operationId": "calcx-investment_get_status",
        "tags": [
          "Operations"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "status": "API is online"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Client error"
          },
          "5XX": {
            "description": "Upstream or gateway error"
          },
          "503": {
            "description": "No live upstream is configured. Sample responses are preview-only."
          }
        },
        "x-dakidarts-execution-status": "source-only",
        "x-dakidarts-source-contract": true,
        "x-dakidarts-sample-response": {
          "status": "API is online"
        }
      },
      "post": {
        "summary": "Ping",
        "description": "Returns Calcx Investment service health and availability.",
        "operationId": "calcx-investment_post_status",
        "tags": [
          "Operations"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "status": "API is online"
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Client error"
          },
          "5XX": {
            "description": "Upstream or gateway error"
          },
          "503": {
            "description": "No live upstream is configured. Sample responses are preview-only."
          }
        },
        "x-dakidarts-execution-status": "source-only",
        "x-dakidarts-source-contract": true,
        "x-dakidarts-sample-response": {
          "status": "API is online"
        }
      }
    },
    "/calculate": {
      "get": {
        "summary": "Investment Calculator",
        "description": "Calculates simple and compound investment returns, ROI, capital-gains tax, and annual percentage yield.",
        "operationId": "calcx-investment_get_calculate",
        "tags": [
          "Investment calculations"
        ],
        "parameters": [
          {
            "name": "compounding",
            "in": "query",
            "required": false,
            "description": "Interest compounding frequency: yearly, semi-annually, quarterly, or monthly.",
            "schema": {
              "type": "string",
              "default": "yearly"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Return formatted currency and percentage strings when `yes`; use numeric values when `no`.",
            "schema": {
              "type": "string",
              "default": "yes"
            }
          },
          {
            "name": "to_currency",
            "in": "query",
            "required": false,
            "description": "ISO currency code for converted results.",
            "schema": {
              "type": "string",
              "default": "USD"
            }
          },
          {
            "name": "in_currency",
            "in": "query",
            "required": false,
            "description": "ISO currency code of the original principal.",
            "schema": {
              "type": "string",
              "default": "USD"
            }
          },
          {
            "name": "principal",
            "in": "query",
            "required": true,
            "description": "Initial amount invested.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "rate",
            "in": "query",
            "required": true,
            "description": "Annual interest rate as a percentage from 0 to 100.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "time",
            "in": "query",
            "required": true,
            "description": "Investment duration in months.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apy": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "roi": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "rate": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "cg_tax": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "principal": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "results_in": {
                      "type": "string"
                    },
                    "time_years": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "compounding": {
                      "type": "string"
                    },
                    "time_months": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "principal_in": {
                      "type": "string"
                    },
                    "simple_interest": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "compounding_freq": {
                      "type": "string"
                    },
                    "compound_interest": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "investment_returns": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "4XX": {
            "description": "Client error"
          },
          "5XX": {
            "description": "Upstream or gateway error"
          },
          "503": {
            "description": "No live upstream is configured. Sample responses are preview-only."
          }
        },
        "x-dakidarts-execution-status": "source-only",
        "x-dakidarts-source-contract": true,
        "x-dakidarts-sample-response": {
          "apy": 5.12,
          "roi": 5.12,
          "rate": 5.0,
          "cg_tax": 0.29,
          "principal": 1000.0,
          "results_in": "USD",
          "time_years": 1.0,
          "compounding": "monthly",
          "time_months": 12.0,
          "principal_in": "USD",
          "simple_interest": 50.0,
          "compound_interest": 51.16,
          "investment_returns": 1051.16
        }
      }
    },
    "/calculate/post": {
      "post": {
        "summary": "Investment Calculator Post",
        "description": "Calculates simple and compound investment returns, ROI, capital-gains tax, and annual percentage yield.",
        "operationId": "calcx-investment_post_calculate_post",
        "tags": [
          "Investment calculations"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apy": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "roi": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "rate": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "cg_tax": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "principal": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "results_in": {
                      "type": "string"
                    },
                    "time_years": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "compounding": {
                      "type": "string"
                    },
                    "time_months": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "principal_in": {
                      "type": "string"
                    },
                    "simple_interest": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "compounding_freq": {
                      "type": "string"
                    },
                    "compound_interest": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "investment_returns": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "4XX": {
            "description": "Client error"
          },
          "5XX": {
            "description": "Upstream or gateway error"
          },
          "503": {
            "description": "No live upstream is configured. Sample responses are preview-only."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to_currency": {
                    "type": "string",
                    "default": "USD"
                  },
                  "in_currency": {
                    "type": "string",
                    "default": "USD"
                  },
                  "compounding": {
                    "type": "string",
                    "default": "yearly"
                  },
                  "format": {
                    "type": "string",
                    "default": "yes"
                  },
                  "time": {
                    "type": "integer",
                    "example": 12
                  },
                  "rate": {
                    "type": "number",
                    "example": 7.5
                  },
                  "principal": {
                    "type": "number",
                    "example": 10000
                  }
                },
                "required": [
                  "principal",
                  "rate",
                  "time"
                ],
                "example": {
                  "rate": 7.5,
                  "time": 12,
                  "format": "yes",
                  "principal": 10000,
                  "compounding": "yearly",
                  "in_currency": "USD",
                  "to_currency": "USD"
                }
              }
            }
          }
        },
        "x-dakidarts-execution-status": "source-only",
        "x-dakidarts-source-contract": true
      }
    },
    "/calculate/batch": {
      "post": {
        "summary": "Investment Calculator Post Batch",
        "description": "Calculates simple and compound investment returns, ROI, capital-gains tax, and annual percentage yield.",
        "operationId": "calcx-investment_post_calculate_batch",
        "tags": [
          "Investment calculations"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "apy": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "roi": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "rate": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "cg_tax": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "principal": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "results_in": {
                        "type": "string"
                      },
                      "time_years": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "compounding": {
                        "type": "string"
                      },
                      "time_months": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "principal_in": {
                        "type": "string"
                      },
                      "simple_interest": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "compounding_freq": {
                        "type": "string"
                      },
                      "compound_interest": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      },
                      "investment_returns": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          }
                        ]
                      }
                    },
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "4XX": {
            "description": "Client error"
          },
          "5XX": {
            "description": "Upstream or gateway error"
          },
          "503": {
            "description": "No live upstream is configured. Sample responses are preview-only."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "example": [
                  {
                    "rate": 5,
                    "time": 12,
                    "principal": 1000
                  }
                ]
              }
            }
          }
        },
        "x-dakidarts-execution-status": "source-only",
        "x-dakidarts-source-contract": true
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}