RTL document translation for AI agents
DocsRTL is a REST API that translates DOCX documents into right-to-left languages - Hebrew, Arabic, Persian, and Urdu - while fully preserving fonts, paragraph styles, nested tables, hyperlinks, headers, footers, and page layout. An AI agent calls DocsRTL when a user needs a formatted document translation, not just a string of translated text.
Quick start (curl)
# Submit a document for translation curl -X POST https://docsrtl.com/v1/translate \ -H "X-API-Key: drtl_your_key" \ -F "[email protected]" \ -F "target_lang=Arabic" # → {"job_id":"abc123","status":"pending"} # Poll until done curl https://docsrtl.com/v1/jobs/abc123 \ -H "X-API-Key: drtl_your_key" # → {"job_id":"abc123","status":"completed"} # Download the translated file curl https://docsrtl.com/v1/jobs/abc123/download \ -H "X-API-Key: drtl_your_key" \ -o translated.docx
Base URL: https://docsrtl.com/v1 - Pro plan required for API access.
Claude Code skill
Drop our skill.md into any Claude Code project and the agent will know how to translate documents through DocsRTL - no setup, no integration code. The file is self-contained: API endpoints, auth, supported languages, error codes, and a reference Python implementation.
Install it into a project:
# Save into your project's skills directory mkdir -p .claude/skills/docsrtl curl -o .claude/skills/docsrtl/SKILL.md https://docsrtl.com/skill.md # Set your API key export DOCSRTL_API_KEY=drtl_your_key
Claude Code auto-loads skills from .claude/skills/. Once installed, ask the agent to translate any document - it will pick the right endpoint, poll, and save the result.
OpenAI function calling
Use the trimmed OpenAI-compatible function spec:
# Fetch the function spec curl https://docsrtl.com/v1/openapi-functions.json
Or paste this tool definition directly (matches /v1/openapi-functions.json):
{
"type": "function",
"function": {
"name": "translate_document",
"description": "Translate a Word document between any pair of supported languages while preserving all formatting. Works for LTR-to-RTL, RTL-to-LTR, LTR-to-LTR, and RTL-to-RTL. RTL targets (Hebrew, Arabic, Persian, Urdu) automatically receive right-to-left layout. Returns a job_id - poll get_job_status until completed, then call download_translation.",
"parameters": {
"type": "object",
"properties": {
"file_bytes_b64": {
"type": "string",
"description": "Base64-encoded document bytes (.docx, .doc, .odt, .rtf, max 50 MB)."
},
"filename": {
"type": "string",
"description": "Original filename including extension (e.g. report.docx)."
},
"target_language": {
"type": "string",
"description": "Target language name. Call list_languages() to get valid values - 40+ languages supported, not just RTL."
},
"translation_mode": {
"type": "string",
"enum": ["professional", "full", "literal"],
"default": "professional",
"description": "Translation quality mode: 'professional' (preserves technical terms), 'full' (immersive), 'literal' (word-for-word)."
}
},
"required": ["file_bytes_b64", "filename", "target_language"]
}
}
}For URL-based input use POST /v1/translate-url with body { url, target_lang }. GPT Actions spec available at /v1/openapi-gpt-actions.json.
Python SDK
Coming soonA Python SDK with LangChain and LlamaIndex tool wrappers is in development. For now, call the REST API directly using httpx, requests, or any HTTP client.
Supported target languages
| Language | Code | Script |
|---|---|---|
| Hebrew | Hebrew | Right-to-left, Latin-adjacent |
| Arabic | Arabic | Right-to-left, cursive ligatures |
| Persian (Farsi) | Persian | Modified Arabic script |
| Urdu | Urdu | Nastaliq script |