Translate API
Send your own documents to Edgepedia Translate from a script and get the translations back. It is the same service as the Translate page, at the same prices, paid from the same credits.
Getting a key
Make a key on the Translate page: sign in, open your account at the top right, and choose Create under API keys.
Send the key on every request as Authorization: Bearer ept_…. Keep it secret: anyone holding it spends your credits.
Prices
- Standard: 1 credit per 250 words (at least 1).
- Pro: 1 credit per 75 words (at least 2).
- Between two languages that are both not English, the price is doubled.
- 100 credits = USD 1.
A failed translation returns its credits.
Routes
Base URL: https://translate.edgepedia.ai. Requests and replies are JSON; an error is {"error": "…"}.
GET /api/v1/languages
The languages, with whether Pro is offered for each.
curl -H "Authorization: Bearer $KEY" https://translate.edgepedia.ai/api/v1/languages
GET /api/v1/balance
Your credits.
curl -H "Authorization: Bearer $KEY" https://translate.edgepedia.ai/api/v1/balance
POST /api/v1/quote
The price and expected time of a translation, without starting it. mode is standard or pro.
A quote also takes "source": "auto": its reply names the language it found in "source", with "detected": true, and a translation is then started with that code.
curl -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"text": "Your text here.", "source": "en", "target": "ar", "mode": "standard"}' \
https://translate.edgepedia.ai/api/v1/quote
POST /api/v1/translations
Start a translation of a text, or of a .txt, .md, .docx, or .pdf file up to 10 MB. Add "expect_credits" to be refused (409) if the price is not the one you expect. Add "wait" (up to 120 seconds) to get the finished translation in the same reply.
curl -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"text": "Your text here.", "source": "en", "target": "ar", "mode": "standard", "wait": 60}' \
https://translate.edgepedia.ai/api/v1/translations
curl -H "Authorization: Bearer $KEY" -F file=@report.docx -F source=en -F target=ar -F mode=standard \
https://translate.edgepedia.ai/api/v1/translations
GET /api/v1/translations/{id}
A translation's status (queued, running, done, or failed) and, when done, its text. A failed one says why. A finished translation can be fetched for 30 days.
curl -H "Authorization: Bearer $KEY" https://translate.edgepedia.ai/api/v1/translations/$ID
GET /api/v1/translations/{id}/download
A file translation's result: a .docx for .docx and .pdf files, text for .txt and .md.
curl -H "Authorization: Bearer $KEY" -o translated.docx https://translate.edgepedia.ai/api/v1/translations/$ID/download
GET /api/v1/translations
Your translations, newest first, up to 50.
curl -H "Authorization: Bearer $KEY" https://translate.edgepedia.ai/api/v1/translations
Status codes
| Code | Meaning |
|---|---|
| 200 | OK; for a start with wait, the translation is done or failed. |
| 202 | Started, or still running after wait. |
| 400 | The request cannot be translated as sent; the error says why. |
| 401 | Missing, unknown, or revoked key. |
| 402 | Not enough credits. |
| 404 | No such translation in your account. |
| 409 | The price is not your expect_credits; nothing was charged. |
| 413 | The file is over 10 MB. |
| 429 | More than 60 requests in a minute; retry after the Retry-After seconds. |