I am not sure the question makes sense. You don't "generate REST API" for Confluence. Confluence has a REST API you can make calls to. There's nothing to "generate"
See https://developer.atlassian.com/server/confluence/confluence-server-rest-api/ for how to use it.
If you are thinking of generating API tokens or keys, see https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.