API
One POST turns a long screenshot into Markdown: split, read, put back together with speakers, timestamps and the pictures inside it.
Request
Send the screenshot one of four ways: a multipart `file` field (up to 4 MB), JSON with a public `url` (up to 30 MB), JSON with a base64 `image`, or a raw `image/*` body. JPG, PNG and WebP only.
curl -X POST https://long2text.com/api/v1/convert \
-H "Authorization: Bearer $LONG2TEXT_API_KEY" \
-F file=@chat.png \
-F mode=textOptions
| mode | text | rich | both | text: pictures become one-line descriptions · rich: pictures returned as files · both: files and descriptions |
| scene | auto | chat | meeting | article | Layout; auto detects it |
| proofread | true | false | AI correction of uncertain lines (default true) |
| lang | zh | en | Labels and descriptions; detected by default |
| images | true | false | Include base64 picture data (default: true unless mode=text) |
Response
`markdown` follows the mode; `text` is always the plain-text version. Picture files are returned as base64 in `images[].data` unless you ask for `images=false`.
{
"mode": "text",
"scene": "chat",
"lang": "zh",
"markdown": "**林晓**:周五的评审我可能要晚到半小时…",
"text": "林晓:周五的评审我可能要晚到半小时…",
"images": [
{ "id": "img1", "file": "images/img1.jpg", "x": 96, "y": 1421,
"width": 220, "height": 232, "ocr_text": "收到!",
"description": "表情包:黄色笑脸配星星,下方写着“收到!”" }
],
"corrections": [{ "original": "李子玻不在", "corrected": "李子玄不在" }],
"stats": { "width": 750, "height": 6506, "parts": 1, "characters": 860,
"paragraphs": 63, "seconds": 6.2, "skipped": [] }
}Command line and agents
The repository ships a dependency-free CLI and a Claude Code / Codex skill, so an agent can convert a screenshot without opening the site:
node l2t.mjs chat.png --mode text
# → chat.mdLimits and behaviour
- ·One request converts one screenshot; there is no job queue — a very tall image takes a few seconds longer.
- ·60 requests per ten minutes per key.
- ·AI proofreading fixes misread characters using the surrounding text, and every change is listed in `corrections`.
- ·`text` and `both` send the cropped pictures — never the whole screenshot — to a vision model for descriptions. `rich` sends nothing.
- ·If a step runs out of time it is named in `stats.skipped` instead of failing the request.
Errors
Failures return `{ "error": { "code", "message" } }` with a matching HTTP status: 401 invalid key, 413 image too large, 415 unsupported image, 429 rate limited, 502 recognition failed.
Getting a key
Keys are issued by hand for now — write to support@long2text.com with what you want to convert and roughly how often.