1👍
Ok, it turned out to be quite obvious, documented etc etc.
The api.run command takes the same args as the mypy commandline invocation. So the following worked for me…
results = api.run(['--show-error-codes', settings.BASE_DIR])
Source:stackexchange.com