API & MCP for developers
The same tools as on the website — in your scripts, apps and AI agents (Claude, ChatGPT, Cursor). One key, one credit balance.
1. Key
Create a key in your account → “API & MCP”. Send it in the Authorization header. The key is shown once — keep it in secrets, not in code.
Authorization: Bearer x2_live_…
2. Start a job
POST a file (multipart). Converters — /api/jobs, AI tools — /api/ai/jobs. Tool options go as JSON in the opts field.
3. Get the result
Poll the status until done or failed, then download files with the same key. Files are kept for 2 hours.
cURL
curl -s -H "Authorization: Bearer $X2_KEY" \ -F "[email protected]" \ "https://x2tool.com/api/jobs?tool=pdf-to-word" # → {"id":"7f3c…","status":"queued"} curl -s "https://x2tool.com/api/jobs/7f3c…" # → {"status":"done","files":[{"name":"report.docx","url":"/api/files/7f3c…/report.docx"}]} curl -s -H "Authorization: Bearer $X2_KEY" -o report.docx \ "https://x2tool.com/api/files/7f3c…/report.docx"
Python
import os, time, requests
KEY = os.environ["X2_KEY"]
H = {"Authorization": f"Bearer {KEY}"}
# ШІ / AI tool with options (no file)
job = requests.post("https://x2tool.com/api/ai/jobs?tool=translate-text", headers=H,
data={"opts": '{"text": "Hello!", "to": "uk"}'}).json()
while True:
st = requests.get(f"https://x2tool.com/api/ai/jobs/{job['id']}").json()
if st["status"] in ("done", "failed"): break
time.sleep(1)
for f in st["files"]:
open(f["name"], "wb").write(requests.get("https://x2tool.com" + f["url"], headers=H).content)MCP for AI agents
Connect X2TOOL as an MCP server — the agent finds the right tool, runs it and returns a link to the result.
https://x2tool.com/mcp · Streamable HTTP · Bearer
Claude Desktop / Cursor — mcp.json
{
"mcpServers": {
"x2tool": {
"type": "http",
"url": "https://x2tool.com/mcp",
"headers": { "Authorization": "Bearer x2_live_…" }
}
}
}Claude Code
claude mcp add --transport http x2tool https://x2tool.com/mcp \ --header "Authorization: Bearer x2_live_…"
MCP tools
search_tools- find a tool by task or file format
run_tool- run: file_url or file_base64, options, waits for the result
get_job- status of a long job
get_balance- plan and credits left
Limits & plans
- API and MCP are included in the Business plan. Free and Pro get 20 trial calls a day.
- Converters cost no credits; AI tools cost from 1 credit per successful run.
- File size follows your plan limit; MCP accepts files up to 100 MB.
- Results are available for 2 hours, then deleted for good.
Error codes
401 bad_api_key- wrong or revoked key
402 no_credits- not enough credits — top up
403 api_plan_required- trial calls used up for today — Business required
413 plan_file_too_large- file exceeds your plan limit
429 rate_limited / daily_limit- too many requests — wait a bit
415 unsupported_type- the tool does not accept this format
Tools available via API
893 server and AI tools. The slug is the tool page address.
pdf-to-wordword-to-pdfpdf-to-jpgcompress-pdfpdf-to-pngpowerpoint-to-pdfpdf-to-exceldjvu-to-pdfepub-to-pdfexcel-to-pdftranslate-pdfAIchat-pdfAIdelete-pdf-pagesocr-pdfAIscan-to-excelAIscan-to-wordAIsummarize-pdfAIfb2-to-pdfhtml-to-pdfpdf-to-epubpdf-to-txtextract-images-pdfextract-pdf-pagesheic-to-pdforganize-pdfpdf-extract-dataAIpdf-page-numberspdf-to-pdfapdf-to-powerpointpdf-to-quizAIpdf-to-svgprotect-pdfredact-pdfrepair-pdftxt-to-pdfunlock-pdfurl-to-pdfwatermark-pdfwebp-to-pdfazw3-to-pdfcrop-pdfflatten-pdfgrayscale-pdfmarkdown-to-pdfmobi-to-pdfodt-to-pdfpdf-n-uppdf-to-azw3pdf-to-bookletpdf-to-fb2pdf-to-htmlpdf-to-markdownpdf-to-mobipdf-to-odtpdf-to-rtfpdf-to-tiffpdf-to-webpremove-pdf-metadatartf-to-pdftiff-to-pdfxps-to-pdfdoc-to-docxfb2-to-epubepub-to-fb2epub-to-mobimobi-to-epubazw3-to-epubazw3-to-fb2azw3-to-mobidocx-to-epubdocx-to-txtepub-to-azw3fb2-to-azw3fb2-to-mobimarkdown-to-docxmobi-to-azw3mobi-to-fb2odt-to-docxppt-to-pptxpptx-to-jpgcompress-pptxdjvu-to-epubdjvu-to-jpgdoc-to-odtdoc-to-rtfdoc-to-txtdocx-to-docdocx-to-htmldocx-to-jpgdocx-to-markdowndocx-to-odtdocx-to-rtfepub-to-docxepub-to-txtfb2-to-txthtml-to-docxkeynote-to-pptxmerge-wordodp-to-pptxodt-to-docodt-to-rtfodt-to-txtpages-to-docxpptx-to-videortf-to-docrtf-to-docxrtf-to-odtrtf-to-txttxt-to-doctxt-to-docxtxt-to-odttxt-to-rtfremove-backgroundAIupscale-imageAIheic-to-jpgcompress-image-to-sizetext-to-imageAIimage-to-textAIpng-to-icoavif-to-jpgMissing a tool or something we could do better? We read every message.