I figured out the issue:
Prerequisites:
Developers and end users have Microsoft 365 Copilot license, as required by Microsoft 365 Copilot API.
Developers and end users have at least Azure AI User RBAC role.
Developers and end users have at least READ access to the SharePoint site.