Enhance Django OAuth Library for Clean JSON Responses in API Development

What is the recommended approach for using the Django OAuth library in API development to ensure that the API returns clean JSON responses instead of rendering Django HTML templates? I need JSON results for the front-end (built with Next.js) to redesign the pages, without relying on Django’s HTML templates.