- Setting up an API Key once allows it to be called from anywhere.
- Unlimited requests, billed by usage.
- Deployed on overseas servers, it can bypass the Great Firewall (GFW).
- text: string
- source_lang: string
- target_lang: string
{
"code": 200,
"cost": 0.000013,
"data": "Hello world.",
"source_lang": "ZH",
"target_lang": "EN",
"token_consumed": 10
}
mkdir openai-translate && cd openai-translate
wget https://raw.githubusercontent.com/missuo/openai-translate/main/compose.yaml
nano compose.yaml # Modify OPENAI_KEY
docker compose up -d
# ghcr.io
docker run -itd -p 23333:23333 -e OPENAI_KEY=YOUR_API_KEY ghcr.io/missuo/openai-translate:latest
# dockerhub
docker run -itd -p 23333:23333 -e OPENAI_KEY=YOUR_API_KEY missuo/openai-translate:latest
Setup on Bob App
Important
This project is fully compatible with the bob-plugin-deeplx plugin.
-
Install bob-plugin-deeplx on Bob.
-
Setup the API. (If you use Brew to install locally you can skip this step)
import httpx, json
openai_api = "http://127.0.0.1:23333/translate"
data = {
"text": "Hello World",
"source_lang": "EN",
"target_lang": "ZH"
}
post_data = json.dumps(data)
r = httpx.post(url = openai_api, data = post_data).text
print(r)
- Support GPT-4, GPT-4-Turbo
- Support set access token
- Maximum request per second limit