Difference between API token and key, and how to get a token?

Hi! I am a new user using ChatGPT in OpenAI with Java, and I want to ask for the difference between an OpenAI ChatGPT API key and the API token. If they are different, how do I retrieve an API token from an API key using Java? Thanks.

I’m using this library from GitHub.

Sorry for my silly mistakes, I searched the forum but I can’t find similar topics, or maybe there’s one that I overlooked.

I think its the same

From what I can see, “key” and “token” are interchangeable in the context of OpenAI’s API and the Java wrapper. I would personally recommend using the word “key”, just to prevent anyone who is reading your code (and is unfamiliar with APIs and/or Natural Language Processing) from confusing API tokens/keys with the API’s NLP-token limits

1 Like