There are two things to be considered here. Is there a cost associated with the textbook or other course materials? Is there a need for proctored testing?
There are free textbooks available. Whether the author writes a textbook for a service that makes them free for a fee in lieu of royalties, or writes the book as a fulfillment of a need to publish before applying for tenure, some free textbooks are available. The question is, Does the course use a free textbook? That is up to the designer of the course. Another question is, Are free textbooks high quality? Many are not. I taught for a university that offered free courses, and insisted on free textbooks. Students complained about the lack of quality, and many went to the free tutorials of Khan Academy. Others bought a textbook to help them understand the material. But, some free textbooks are written with care and quality.
I am positively impressed by the free textbooks from OpenStax. This is a free textbook source from Rice University, and I am convinced the university is committed to quality. I use one in an online course I teach as a community college, and it is working out with no complaints. I also looked another over in detail and feel it is worth using.
One reason some institutions are serving the academic community by maintaining free open source textbooks is that students struggle with the high cost of a textbook, and the need to purchase a new book exists when another now frequent new edition comes out. In the past used textbooks helped students. Now new editions might be as frequent as every two or three years.
Proctored tests are needed for academic integrity. One big complaint companies have is that people are getting college degrees and know very little. Online courses are difficult as far as policing cheating. One option is ProctorU, and many online credit courses are requiring the service. This requires the student pay a fee for every test, and that fee varies according to how long in advance the student makes arrangements. Earlier scheduling means less expense. A camera connected to the computer is required, and the entire room must be shown to the proctor before starting a test. The proctor then monitors the test remotely via the camera and listens for audible cheating.
These are costs potentially associated with an online class, and not with registration at a university. If you have no current registration at the university offering the online class you hope to intend, there may be a fee that is not course specific.