API · MCP

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.

All tools

Got an idea?

Missing a tool or something we could do better? We read every message.