/api/translate
publicTranslates a batch of strings through the configured project provider while honoring cache, glossary, bot, quota, and velocity rules.
Auth: Project API key via Authorization: Bearer or ?api_key= query parameter.
Source: src/app/api/translate/route.ts
Request
curl https://deepglot.ai/api/translate \
-H "Authorization: Bearer dg_live_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 9b9e42d8-7ef2-4a91-82ff-b5ec71ba5832" \
-d '{
"l_from": "de",
"l_to": "en",
"words": [{ "w": "Hallo Welt", "t": 1 }],
"request_url": "https://example.com/",
"bot": 0
}'Response
{
"l_from": "de",
"l_to": "en",
"request_url": "https://example.com/",
"title": "",
"bot": 0,
"from_words": ["Hallo Welt"],
"to_words": ["Hello world"]
}- Word type t follows the plugin contract. Human traffic uses bot=0; every bot value >=1 is cache-only and never invokes a provider.
- Only fresh provider-billed words consume monthly quota. A 402 means quota exhaustion; a 429 includes Retry-After for request or fresh-word velocity limits.
- Idempotency-Key is optional. Repeating the same body and key within 24 hours replays the first response without repeating side effects; a different body returns 409.