Long2Text
← Long2Text

API

One POST turns a long screenshot into Markdown: split, read, put back together with speakers, timestamps and the pictures inside it.

Get an API key →$0.89 per screenshot of any length · prepaid · failed conversions are free

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=text

Options

modetext | rich | bothtext: pictures become one-line descriptions · rich: pictures returned as files · both: files and descriptions
sceneauto | chat | meeting | articleLayout; auto detects it
proofreadtrue | falseAI correction of uncertain lines (default true)
langzh | enLabels and descriptions; detected by default
imagestrue | falseInclude 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

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 left

Limits and behaviour

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.