Alocação de tarifas de transmissão; otimização binível; custos marginais de longo prazo; geração renovável. proposes a new approach to the transmission usage cost allocation problem, combining the power flow and tariff computation problems, usually solved separately, in a bilevel optimization model. The proposal is based on the multiplicity of feasible solutions to allocate costs by power flow components.Such a feasible set exists because of the different hypothesis that can be assumed to calculate the base case power flow, and to decompose the obtained power flows, assigning its components to generators and demands. Given the diversity of solutions, it is proposed that the chosen one should optimally meet the objectives specified by the system regulator and users concerning the costs allocation. Because of the interdependence between the mentioned problems, such objectives are inserted into a bilevel optimization problem in which the upper level defines the power flow results, having the lower level as a constraint that gives the power flow decomposition solution and, as a consequence, the cost allocation through tariffs assigned to generators and demands. In this work, the objectives represented in the optimization model include two main aspects.The first one is to obtain a cost allocation that reflects the system's long run marginal costs (LRMC). Thus, in the upper level, a worst-case power flow model maximizes the lines' flows in order to characterize the base case that causes the greatest need for transmission investments, and reflects the LRMC.The second consists in smooth out the high tariffs assigned to users located at unfavorable regions of the system and that do not have the freedom to choose their location. This is the case, among others, of the renewable generators in the Brazilian transmission system that are part of the system expansion planning, and are placed far away from the load centers due to the geographic availability of the renewable resource. Hence, in the lower level, the transmission tariff amplitude is minimized considering constraints that ensure the locational coherence of the tariffs economic signals. Additionally, the proposed model PUC-Rio -Certificação Digital Nº 1212912/CA admits upper and lower tariff bounds to ensure the desired tariff smooth, if it is feasible. Given these bounds in, the optimal solution of the proposed bilevel model can provide three different situations: (i) the limits are restricted to the point that the problem is infeasible, (ii) the limits are such that the levels are coupled, or (iii) the limits are less restricted, and the optimal solution is equivalent to the common practice of solve both levels sequentially. Numerical results are presented to a 6-bus didactic system and to the IEEE 118-bus system under different demand configurations.