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 $L2T_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`. `usage` says what the request cost and what is left.
{
"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": [] },
"usage": { "request_id": "3f0c…", "credits_charged": 1, "credits_remaining": 49 }
}Pricing
- ·One credit converts one screenshot of any length, in any mode: $0.89.
- ·Credits are prepaid in packs of 10 / 50 / 200 from the dashboard, and never expire.
- ·A credit is only spent when the conversion succeeds. Bad input, timeouts and errors on our side give it back automatically.
- ·Want to see the output first? The website converts screenshots with the same engine, free to try.
Keys and usage
Create keys in the dashboard after signing in with Google. Each key can have its own monthly limit, and every request is listed there with its result and cost. Every response carries a `usage` block (also as `X-Credits-Remaining`), and the balance can be read from code:
curl https://long2text.com/api/v1/usage \
-H "Authorization: Bearer $L2T_API_KEY"
{ "credits_remaining": 49, "used_this_month": 12,
"key": { "name": "laptop", "monthly_limit": 100, "used_this_month": 7 } }Questions or a bigger volume? Write to support@long2text.com.
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.md
node l2t.mjs --usage
# → 49 credits leftLimits and behaviour
- ·One request converts one screenshot; there is no job queue — a very tall image takes a few seconds longer.
- ·Up to 4 conversions run at the same time per account; more get 429 until one finishes.
- ·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, 402 `insufficient_credits`, 413 image too large, 415 unsupported image, 429 `key_limit_reached` (the key's monthly limit) or `too_many_requests`, 502 recognition failed, 503 briefly unavailable. None of them costs a credit.