If you are using axios inside Inertia and you are running into 401 responses when trying to make axios requests on a Laravel API you should check your app/Http/Kernel.php.
Ensure that the Class EnsureFrontendRequestsAreStateful
is not commented out.
app/Http/Kernel.php:
'api' => [
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',