Assuming that the AP classes are being offered at the high school, your initial thought is correct. Qualified expenses have to be related to enrollment or attendance at an eligible educational institution, which is any college, university, vocational school, or other postsecondary educational institution eligible to participate in a student aid program administered by the U.S. Department of Education.