Add api to guard in config/sanctum.php so it becomes:
api
guard
config/sanctum.php
'guard' => ['web', 'api'],
By default it's only web.
web