Local API key management & configuraition

Hey everyone. I have a question about how API keys are used.

I am running the LibreTranslate on my own server, and I am making the requests to localhost:5000

I encounter the error Please contact the server operator to obtain an API key.

When I started the web server, I did not pass any arguments at all. (my command libretranslate)

I am doing this on an Ubuntu machine, in case that matters.

How do I turn off API keys entirely so no key needs to be passed along with it.

I have seen this question on the forums before, however everyone was talking about thelibretranslate.com endpoint which requires an API key. I am running this locally, so please help me out here.

I am running this locally. I do not need to purchase an API key.

How can I disable API keys and make local calls without getting the error I mentioned above.

Thanks in advance for the help.

1 Like

api keys are disabled by default ( https://github.com/LibreTranslate/LibreTranslate#arguments ), could you show how you start your libretranslate instance ?

I simply type libretranslate into console, with no arguments supplied. I then get the normal startup message and the port the service is running on (5000) default.

Strange. Do you have an Idea @pierotofy ?

Strange indeed.

Are you sure you are using localhost as your host? Can you share information about how you’re making the calls to the API?

If you unplug the computer from the internet, do you get a different error message? (Just trying to rule out you’re not mistakenly making requests to libretranslate.com).

I uninstalled the LibreTranslate API wrapper, after noticing it was redirecting some of the requests to a LibreTranslate mirror server.

I now have another error, yay. When I try to detect a language, I get a 404 error saying that /detect does not exist

here’s me starting the server:


The request:

and the output:

I tried it with /languages, which works.

Could this be due to me doing the request on http://localhost and not https://localhost?

That’s strange;

https vs. http should not make a difference (it should be http when you’re on localhost).

Perhaps you have another service running on 5000? (double check).