A fluid machine comprising a casing, the casing containing therein (i) a compression mechanism for compressing fluid and (ii) an expansion mechanism for generating rotational power by the expansion of fluid, wherein: a rotating shaft of the compression mechanism and a rotating shaft of the expansion mechanism are coupled together; oil supply grooves (74, 84) in fluid communication with each other are formed respectively in the rotating shafts (70, 80); and the fluid machine is characterized in that in one of the rotating shaft of the compression mechanism and the rotating shaft of the expansion mechanism, a convex portion projecting axially outwardly from a shaft end surface of the rotating shaft (80, 70) is formed; in the other of the rotating shaft of the compression mechanism and the rotating shaft of the expansion mechanism, a concave portion concaved axially from a shaft end surface of the rotating shaft (70, 80) is formed; one of the oil supply grooves (84, 74) formed in one of the rotating shaft of the compression mechanism and the rotating shaft of the expansion mechanism opens to an end surface of the convex portion; the other of the oil supply grooves (74, 84) formed in the other of the rotating shaft of the compression mechanism and the rotating shaft of the expansion mechanism opens to a bottom surface of the concave portion; the oil supply groove formed in the rotating shaft of the compression mechanism and the oil supply groove formed in the rotating shaft of the expansion mechanism are connected together by engagement of the convex portion and the concave portion; a seal mechanism (S, R) for providing sealing between coupling portions of the rotating shafts (70, 80) is provided, and the seal mechanism (S, R) comprises a seal groove formed in a peripheral surface of either one of the convex portion and the concave portion over the circumferential direction, and a seal member engaged into the seal groove. a rotating shaft of the compression mechanism and a rotating shaft of the expansion mechanism are coupled together; oil supply grooves (74, 84) in fluid communication with each other are formed respectively in the rotating shafts (70, 80); and the fluid machine is characterized in that in one of the rotating shaft of the compression mechanism and the rotating shaft of the expansion mechanism, a convex portion projecting axially outwardly from a shaft end surface of the rotating shaft (80, 70) is formed; in the other of the rotating shaft of the compression mechanism and the rotating shaft of the expansion mechanism, a concave portion concaved axially from a shaft end surface of the rotating shaft (70, 80) is formed; one of the oil supply grooves (84, 74) formed in one of the rotating shaft of the compression mechanism and the rotating shaft of the expansion mechanism opens to an end surface of the convex portion; the other of the oil supply grooves (74, 84) formed in the other of the rotating shaft of the compression mechanism and the rotating shaft of the expansion mechanism opens to a bottom surface of the concave portion; the oil supply groove formed in the rotating shaft of the compression mechanism and the oil supply groove formed in the rotating shaft of the expansion mechanism are connected together by engagement of the convex portion and the concave portion; a seal mechanism (S, R) for providing sealing between coupling portions of the rotating shafts (70, 80) is provided, and the seal mechanism (S, R) comprises a seal groove formed in a peripheral surface of either one of the convex portion and the concave portion over the circumferential direction, and a seal member engaged into the seal groove.