Safety and optimal traffic flow are important priorities in intelligent transportation systems. This paper presents a collaborative method for collision avoidance between autonomous vehicles at an unsignalized intersection. The collision conditions are expressed in terms of the vehicles' speed ratios. The problem is then formulated and solved as an optimization problem with the safety constraints represented by the speed ratios. The cost function is defined in terms of the deviation from the current speeds. Both pairwise and three vehicle formulations are discussed. The proposed formulation allows to easily scale the solution to higher number of vehicles. The method is highly effective in resolving conflicts and achieving smooth flow. The results are formally proven and illustrated using simulation.