Risk budgeting is one of the recent and successful strategies for asset portfolio selection. In this strategy, risk budgets are associated with assets, and the amount of investment is adjusted so that the contribution of each asset to the portfolio risk is proportional to its risk budget. To the best of our knowledge, no specific method has been presented in the literature to systematically determine the value of risk budgets. To fill this research gap, in this article, we consider the risk budgets as decision variables and present a bi-level programming model where the upper level decides the risk budgets and the lower level determines the risk budgeting portfolio. Three approaches are introduced to solve the model. The first is a single-level reformulation of the bi-level model, the second is a novel gradient-based algorithm, and the third is the particle swarm optimization algorithm. Moreover, the k-means clustering method is utilized to determine the assets involved in the portfolio. Computational results over real-world datasets demonstrate the significance of the bi-level model. In addition, the results confirm the proficiency of our gradient-based algorithm from both solution quality and running time.