CAPTCHA / TEXT

Text

Character recognition on an image. The model for a specific site is chosen by the model field; the response holds the string for the captcha field.

Input

Save the original captcha image as captcha.png. Image requirements differ between models — see the models table.

Parameters

ParameterTypeRequiredDefaultDescription
imagestringYes—Source image in base64.
modelstringYes—Model: gaijin, mojeid, nova.

Models

modelSiteImageResponse specifics
gaijinlogin.gaijin.netThe original captcha image without the page frame, caption or input field.extra.char_confidences — the score of each character in text order; extra.length — the string length.
mojeidMojeIDThe whole image. Do not cut out characters by hand: the server separates them itself.Only text and confidence. Do not change the letter case unless the site requires it.
novaNova88The original color image. Do not convert it to black and white: the color filter is part of the processing.text is already normalized: if at least four digits are found, the first four are taken. extra.raw_ocr is the raw OCR before corrections; do not submit it. confidence may be 0.

Response

Recognition dataTypeDescription
modelstringThe model from the request.
textstringThe recognized string. Enter it into the captcha field as is.
confidencenumberAverage per-character confidence.
extraobjectFields of the specific model — see the models table.

Applying the answer

Enter result["text"] into the captcha field in the same site session in which the image was received.

Common mistakes

  • The model is not detected from the image: without model the server answers 400.
  • Transparency, color and the original scale affect preprocessing; the original file is preferred.
Scenario errors and retries →

Request example

Python · requests
import base64
from pathlib import Path
import os
import uuid
import requests

def image64(filename):
    return base64.b64encode(Path(filename).read_bytes()).decode("ascii")

payload = {
    "image": image64("captcha.png"),
    "model": "nova",
}

# One ID per task; keep it for network retries.
request_id = str(uuid.uuid4())
response = requests.post(
    "https://capi.z3n.pro/v1/solve/text",
    headers={
        "Authorization": f"Bearer {os.environ['CAPI_API_KEY']}",
        "Content-Type": "application/json",
        "Idempotency-Key": request_id,
    },
    json=payload,
    timeout=90,
)
response.raise_for_status()
result = response.json()
print(result["text"])
Payment and all routes →