Are there rest APIs that can be called directly for Tokenization?

Are there rest APIs that can be called directly?

I need to tokenize a credit card information, but I can't have the CC# hitting my backend server at all. After the user enters their CC info...within the page, I need to make a rest api call, and when the token arrives then save that to our backend server/db.

Some questions/issues:
1. Is this possible?
2. These rest api calls are running on client side. What publishable key do I use? Is there a concept of a public and secret key, like Stripe?
3. I've seen questions here about IFrame and tokenization. Is IFrames the way to achieve this?

Thanks,