For class assignments, consult your instructor and your syllabus
For MLA style see the entry on "How do I cite generative AI in MLA Style?" from the official MLA Style website.
For APA style see the entry on " How to cite ChatGPT" from the official APA style website.
You should also take care to vet the secondary sources cited by a generative AI tool—with the caveat that AI tools do not always cite sources or, when they do, do not always indicate precisely what a given source has contributed. If you cite an AI summary that includes sources and do not go on to consult those sources yourself, we recommend that you acknowledge secondary sources in your work. You need to click through to the source listed in the text in order to get more information than just a URL for the source.