Use your own domain and Cloudflare's Worker service to reverse proxy the Google Translate API, allowing you to use the Google Translate API without needing a VPN.
Creating a Worker in Cloudflare to Reverse Proxy the API
Here are the detailed steps:
Open the Cloudflare Console: Visit https://dash.cloudflare.com/
Create a Worker:
After logging in, select "Workers" from the left panel, then click "Create" to create a new Worker service.

Name your Worker, then click Save.
After saving, continue by clicking "Done" in the bottom right corner.

Edit the Code:
After completing the above steps, click "Edit code" in the top right to enter the code editor. Delete the default code, replace it with the following code, and then click the "Deploy" button in the top right to deploy.
This code already parses the translation result and will directly return the assembled result text.
A successful response will look similar to:
A failure response:

export default {
async fetch(request, env, ctx) {
let url = new URL(request.url);
if(url.pathname.startsWith('/')){
url.hostname="translate.googleapis.com";
let new_request = new Request(url, request)
let response=await fetch(new_request)
if(response.status!==200){
return new Response(JSON.stringify({code:1,msg:response.text}), {
status: 200,
headers: {
'content-type': 'application/json',
},
});
}
let jsonData = await response.json();
let str=jsonData[0].map(it=>{
return it[0]
})
let data={code:0,msg:"ok",text:str.join('')}
return new Response(JSON.stringify(data), {
status: 200,
headers: {
'content-type': 'application/json',
},
});
}
return await env.ASSETS.fetch(request);
},
};Get the Route URL Address:
After successful deployment, click "Back" on the left, then click "Settings" -> "Triggers".


Click "Add custom domain" at the top to bind your own domain. It is highly recommended to do this because the
workers.devdomain is blocked in China and cannot be used directly. By binding a custom domain, you can avoid the need for a VPN.
Using it in Video Translation Software
Open the top-left settings menu -> Custom Translation API, fill in your API address and key (any value is fine), then test it.
If there are no issues, select "TransAPI" in the translation channel list, and you can happily use the Google Translate API for free.


