I want to create a sort of private Q&A site to allow university students of the same courses to communicate. Is it possible by using the Stack Exchange API?
No, the API only allows you to connect to existing Stack Exchange sites, and Stack Exchange no longer sells public-facing sites. Stack Overflow Enterprise is available for internal use, but it is really meant for larger organizations only.
It looks like you want one of the clones listed on Meta.
Since it's not clear which, if any, of those clones offer an API, there is another approach...
If you submit your site through the Area 51 proposal process and it goes to beta, then you can access the new site through the API. It won't be private, but you could potentially get a lot more people helping as well.
2I added another possibility to your answer rather than create my own half-duplicate answer. If you object, then I apologize and you can revert the edit. Sep 23, 2014 at 21:42
I do not object! You're making the internet a better place with the only possible issue being that we have a different allocation of fake internet points, about which I don't really care. Sep 24, 2014 at 13:52
Yes, you can now use Stack Overflow for Teams to create a private Q&A site with all the Stack-Overflowy goodness. (Plus an "ask" pinging feature suitable for closed/private organizations.)
See the Teams landing page and note that they do have an educational discount:
Do you offer special pricing to nonprofit organizations and educational institutions?
Yes, contact us to learn about our special pricing structure.
For more information see the stack-overflow-for-teams tag on Meta Stack Overflow.
Teams do have API support, although it is read-only at the moment.