MTCaptcha is the captcha that sometimes shows a line of distorted text and sometimes shows nothing at all. That split is the whole story of solving it. The widget first tries to verify the visitor in the background, and only a visitor it distrusts is shown the text challenge. The MtCaptchaToken tasks work on the first path: they let the widget verify itself and return the verifiedToken it issues. This guide explains how to find the site key, which outcomes to expect, how to submit the token, and what to do when the widget insists on showing text.
How MTCaptcha verifies a visitor
A page that uses MTCaptcha loads the vendor script from service.mtcaptcha.com and configures the widget with window.mtcaptchaConfig. The widget asks the MTCaptcha service for a challenge, checks the visitor in the background and, when it is satisfied, calls the page's verified-callback with a verified token. The page puts that token into a hidden form field named mtcaptcha-verifiedtoken. When the form is posted, the site's server asks MTCaptcha's API to check the token with the site's private key.
Two consequences matter for a solver:
- The token is useless on its own. It works only on a form that belongs to the site the key was issued to, and only once.
- The widget decides how hard to make it. The same page can pass one IP in the background and ask another for typed text, so the exit IP is part of the outcome.
Find the MTCaptcha site key
The public key starts with MTPublic-. There are three places to read it, from fastest to most thorough.
- The console. Type
window.mtcaptchaConfig.sitekeyand press Enter. This works when the page sets the global before the vendor script runs. - The page source. Search for
mtcaptchaConfigor for the stringMTPublic-. The configuration object is usually an inline script above the widget container. - The Network panel. Reload with the panel open, filter for
getchallenge, and read theskquery parameter of that request.

The bd parameter in the same request is the domain the widget runs on. MTCaptcha keys are issued per site, so a key copied from another domain will not produce a token that this site accepts. Send the exact page URL that shows the widget as websiteURL.
Create the task
MtCaptchaTokenProxyLess runs from SurSolver's network. MtCaptchaToken takes your proxy in proxy. Both need websiteURL, websiteKey and a supported userAgent.
{
"clientKey": "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"task": {
"type": "MtCaptchaTokenProxyLess",
"websiteURL": "https://example.com/register",
"websiteKey": "MTPublic-AbCdEf123",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
}
}
Fields that are not accepted are as important as the ones that are:
pageActionandisInvisibleare refused withERROR_INVALID_REQUEST. Some other solver APIs take them; this task does not, and adding them cannot switch on a widget mode the page does not have.websiteKeymust matchMTPublic-<id>. Anything else answerswebsiteKey must have the form MTPublic-<id>.before the task is charged.testKeyis optional and has its own form,MTPrivQA-<id>-<secret>. See the section on test mode below.
The API replies with a taskId. Poll getTaskResult every 3 seconds. MTCaptcha verification is quick when it passes, so a long wait usually means the task has already failed and the status will show it.
Read the result
{
"errorId": 0,
"status": "ready",
"solution": { "token": "the verifiedToken issued by the widget" }
}
solution.token is the whole result. It does not return a userAgent, so keep the one you sent and use it when you submit the form.
Submit mtcaptcha-verifiedtoken
Put the token into the hidden input and post the form. A plain requests script works when the form is a normal POST:
# mtcaptcha-python.py - solve MTCaptcha and post the token with the form.
# Install: pip install requests
# Run: python mtcaptcha-python.py
import json
import time
from urllib.parse import urlsplit
import requests
# Your SurSolver API key.
CLIENT_KEY = "sur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# The page that renders the widget, with its path and query string.
TARGET_URL = "https://example.com/page"
# The MTPublic- key in mtcaptchaConfig.sitekey or getchallenge.json.
SITE_KEY = "YOUR_SITE_KEY"
# The MTPrivQA- key for QA mode on a site you control; omit for normal solves.
TEST_KEY = None
# The User-Agent the solve runs with; send the result with this same user agent.
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
# Current application session as a Cookie header value; used on form submission.
SESSION_COOKIES = None
# Where the page posts the form (the form action, or the request in DevTools, Network).
FORM_URL = "https://example.com/submit"
# The form's other fields as a JSON object, such as {"username": "demo"}.
FORM_FIELDS = None
# Text that appears only in a response the site accepted.
SUCCESS_TEXT = "PASTE_ACCEPTED_MARKER"
API = "https://api.sursolver.com"
POLL_ATTEMPTS = 60
def call(path, body):
# API errors are HTTP 200 with errorId 1; anything else is a transport failure.
response = requests.post(f"{API}{path}", json=body, timeout=30)
response.raise_for_status()
data = response.json()
if data["errorId"] != 0:
raise RuntimeError(f'{data["errorCode"]}: {data["errorDescription"]}')
return data
def solve(task):
created = call("/createTask", {"clientKey": CLIENT_KEY, "task": task})
for _ in range(POLL_ATTEMPTS):
result = call("/getTaskResult", {"clientKey": CLIENT_KEY, "taskId": created["taskId"]})
if result["status"] == "ready":
return result["solution"]
time.sleep(3)
raise TimeoutError(f'task {created["taskId"]} was not ready in {POLL_ATTEMPTS} polls')
def without_empty(fields):
# Optional task fields are sent only when they have a value.
return {name: value for name, value in fields.items() if value not in (None, "")}
def main():
session = requests.Session()
if SESSION_COOKIES:
for part in SESSION_COOKIES.split(";"):
if "=" in part:
name, value = part.strip().split("=", 1)
session.cookies.set(name, value, domain=urlsplit(FORM_URL).hostname, path="/")
solution = solve({
"type": "MtCaptchaTokenProxyLess",
"websiteURL": TARGET_URL,
"websiteKey": SITE_KEY,
"userAgent": USER_AGENT,
**without_empty({
"testKey": TEST_KEY,
}),
})
# The solve ran with USER_AGENT; the submit presents the same one.
headers = {"User-Agent": USER_AGENT}
# Send the token the way the page does; some sites name it differently or send JSON.
response = session.post(
FORM_URL,
data={**(FORM_FIELDS or {}), "mtcaptcha-verifiedtoken": solution["token"]},
headers=headers,
timeout=30,
)
session.close()
if not response.ok or SUCCESS_TEXT not in response.text:
raise SystemExit(f"The site did not accept the result (HTTP {response.status_code}).")
print("The site accepted the result.")
if __name__ == "__main__":
main()
If the page does not use a plain form, call the verified-callback function that the page registered in mtcaptchaConfig, or set the hidden input's value with page.evaluate() in Playwright and click the real submit button. Submit right after the task: the token is single-use, and a second submit of the same value is the most common reason a "valid" token is rejected.
Visible text challenges
When the widget decides to show a text challenge, nothing in the token task can type the answer. The task then ends as failed and returns its original charge once, instead of handing back a token that would never verify. That outcome depends on the IP that loaded the widget and on how that IP scores with MTCaptcha.
What helps:
- Try
MtCaptchaTokenwith a clean sticky proxy whose location matches the site's audience. A different exit IP can turn a text challenge into a background pass. - Keep the
userAgentrealistic and identical for the task and your own requests. - Retry on a new proxy session rather than hammering the same IP.
Image to Text reads text from an image you send. It is a separate task and does not complete this widget's verification, so do not use it to fill the widget's text box.
Test mode with testKey
A site owner can switch a widget to MTCaptcha's QA mode by using a test key that begins MTPrivQA-. In that mode the widget answers itself and the server issues a verified token, with no text challenge. testKey exists for that case: pass it only for a site you control, and omit it for any normal solve.
A test-mode pass proves that your form handles a token. It does not prove that a production widget will pass from the same IP. Keep test keys out of public repositories and examples.
Common rejections
| What you see | Cause | Fix |
|---|---|---|
ERROR_INVALID_REQUEST: websiteKey must have the form MTPublic-<id>. |
A private key, a script URL or a typo | Read the public key from mtcaptchaConfig.sitekey |
ERROR_INVALID_REQUEST: pageAction is not supported by this task type. |
A field from another service | Remove pageAction and isInvisible |
ERROR_WRONG_USERAGENT |
The User-Agent is not a supported identity | Copy one from supportedUserAgents |
ERROR_FAILED |
The widget showed a visible challenge, or the key does not belong to that page | Retry on a clean proxy and confirm the key and URL |
| The site rejects a fresh token | The token was used twice, or the form needs another field | Submit once, and compare with a browser submission |
The MTCaptcha solver page lists the fields at a glance, and the API reference has the schemas. How to submit a captcha token compares the form, callback and cookie routes for other widgets.
Current input and replay contract
The token task requires websiteURL, a public MTPublic-... site key and userAgent. testKey is optional QA configuration for a site you control; omit it for normal solves. pageAction and isInvisible are not supported.
This integration handles background verification and QA mode. A visible text CAPTCHA is unsupported by this token task. ImageToTextTask returns text only and does not finish MTCaptcha verification. A ready widget token belongs in mtcaptcha-verifiedtoken or the callback registered by the page; preserve the application's normal submit and CSRF/session state. See the token-versus-image decision and integration example.