How to create own api key? [closed]

I create an library for my REST API and want to send for my customers to use it, but before it I want to create an API KEY (which must be generated in main app) which must be pass to my library in the main class constructor. And right now i have a question, what is the best way to generate API KEY? Right now i create this key as JWT like below:

return jwt.sign(payload, "SECRET KEY");

but JWT is very very long, and I want to create key which will be much shorter that JWT. How is the best approach to generate KEYS? How for example Github generate API KEY for his REST API?

thanks for any help!