"We've just seen the close of an incredible season," the City captain wrote to fans on his Facebook page. "My 11th as a Blue. And I cannot believe I'm writing this but ... also my last as a Blue."
The 33-year-old Belgian central defender said he would be posting a second part of the letter "shortly" to tell of his plans.
City crushed Watford 6-0 in the FA Cup final to complete the treble, with Kompany saying they were the world's best team.
Kompany scored with a thunderous long-range strike to decide their penultimate league match of the season against Leicester City - a key moment in retaining the Premiership title.
He also hailed manager Pep Guardiola and his staff as a "superb" crew who had "followed me through so much hardship. You made me come back stronger every time. Thank you so much."
In turn, Guardiola was hailing City's consistency in achieving the treble.
The one blip on City's season has been their failure to crack Europe. That will be central to Guardiola's thinking next season, but for the present he is enjoying the glory of the treble.
"I love the Champions League, but it is more difficult to do what we have done," Guardiola said. "We won the league by one point. We are not in a position to be relaxed. Always you can improve."