DeepLX on EdgeOne Pages
Free · Fast · Open Source · Self-hostable
English | 简体中文
- Free - No payment required, free forever
- Fast - Based on EdgeOne edge computing, globally accelerated
- Secure - Fully open source, self-hostable
- Simple - RESTful API, easy integration into any application
- Multi-language UI - Supports English and Chinese interface with auto-detection
curl -X POST https://your-domain.com/translate \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, World!",
"source_lang": "auto",
"target_lang": "ZH"
}'Response Example:
{
"code": 200,
"data": "你好,世界!",
"source_lang": "EN",
"target_lang": "ZH",
"provider": "deepl"
}Main translation endpoint with multi-provider auto-failover (DeepL → Google).
Request Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
text |
string | Yes | Text to translate (max 5000 characters) |
source_lang |
string | No | Source language code, default auto |
target_lang |
string | Yes | Target language code |
Language Code Examples: EN, ZH, JA, KO, DE, FR, ES, PT-BR
Directly call DeepL Provider.
Directly call Google Translate Provider (text limit 1500 characters).
Get service monitoring statistics.
This project is deployed on Tencent Cloud EdgeOne Pages.
- Node.js >= 18
- EdgeOne Pages account
# 1. Clone repository
git clone https://github.com/0XwX/deeplx.git
cd deeplx
# 2. Install dependencies
npm install
cd frontend && npm install && cd ..
# 3. Login to EdgeOne
npx edgeone login
# 4. One-click deploy
npm run deployFirst deployment will create the project. To deploy to overseas region (no real-name verification required), add
-a overseasparameter to the deploy command.
| Variable | Description | Default |
|---|---|---|
TOKEN |
API authentication token (optional) | None (allow all requests) |
When TOKEN is configured, API requests must include authentication:
Method 1: URL Query Parameter (Recommended)
curl -X POST "https://your-domain.com/translate?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text": "Hello", "target_lang": "ZH"}'Method 2: Authorization Header
curl -X POST https://your-domain.com/translate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"text": "Hello", "target_lang": "ZH"}'# Start frontend dev server
npm run dev
# Lint code
npm run lint
npm run format:check
# Build frontend
npm run buildBackend:
- EdgeOne Edge Functions
- KV Storage (health checks + logs)
Frontend:
- React 19 + TypeScript
- Vite 7
- Tailwind CSS 4
- Lucide Icons
- DeepLX - Original DeepL free API project
- xixu-me/DeepLX - DeepLX Cloudflare Workers deployment
- EdgeOne Pages - Tencent Cloud edge computing platform
MIT License