使用场景

读取并翻译图片和截图中的文字

把图片里的文字转成 JSON,可以是整段文本,也可以包含段落、行、单词及其位置,并能在同一次调用中完成翻译。

预付费,无订阅REST 或 MCP一个密钥搞定模型、数据和智能体
Google LensImageslovelyjsonitems[0]"text": "Spend 199, save 20. O…"language": "en""detail": "lines""translated_to": "es""image": "promo-banner.png"

很多有用的文字根本不是以文本形式存在的:促销横幅、截图、扫描页面、包装照片,还有外语菜单。手动抄写很慢,而图片既不能搜索,也不能翻译。Lovely Router 通过 Google Lens 替你读取图片。发送图片链接,以 JSON 返回文字,按图片张数从预付费余额中计费,还可以在同一次调用中要求翻译。用一个 API 密钥,就能从脚本、数据管道或 AI 智能体中使用。

交给你的 AI 智能体

把这段提示词复制到 Claude Code、Cursor、Codex 或任何编程智能体中。它会告诉智能体文档在哪里,以及如何使用你的 API 密钥。

读取并翻译图片和截图中的文字. Use the Lovely Router data tools: each returns JSON and is billed per result.

- Docs (read first): https://lovelyrouter.com/docs/tools/find.md and https://lovelyrouter.com/docs/tools/run.md
- Plan first: POST https://lovelyrouter.com/v1/tools/suggest with `{"task": "<my task in plain words>"}` (free). It returns the tools to run in order, each with an example `input`, the `input_required` fields, an estimated cost and a ready-made `run` request. Replace the example values with my task's; if a field is unclear, read the tool with GET https://lovelyrouter.com/v1/tools/<id>. To browse instead, POST https://lovelyrouter.com/v1/tools/discover searches the catalog.
- Show me the plan and its estimated cost (`total_est_cost_usd`) before running anything large.
- Run: POST https://lovelyrouter.com/v1/tools/<id>/run with `{"input": {...}, "max_results": N}`. A 200 has the finished run with `items`; a 202 means it is still running, so poll the `poll` path until `status` is `succeeded`, `failed`, `timed_out` or `stopped`.
- Only delivered results are billed. Keep max_results small on the first run, check the output, then scale up.
- If you support MCP, connect https://lovelyrouter.com/mcp instead (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.

My task: <the inputs (links, keywords or accounts) and how many results you need>
01

工作原理

010203
  1. 托管或找到图片

    工具读取公开的图片链接,支持 JPEG、PNG、WebP、BMP、TIFF 和 HEIC。

  2. 选择需要的详细程度

    把 outputDetail 设为 text_only 只获取纯文本;如果还需要结构和位置,就设为 paragraphs、lines、words 或 full。用 language 提示图片中的语言;需要翻译时再加上 translateTo。

  3. 使用这些文字

    搜索、存储、交给模型处理,或者与同一张图片的上一个版本做对比。

02

一次请求读取图片中的文字

读取图片中的文字(OCR)在 imageUrl 中接受一个图片链接。一张图片对应一条结果:

curl https://lovelyrouter.com/v1/tools/image-ocr/run \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "input": {
      "imageUrl": "https://tesseract.projectnaptha.com/img/eng_bw.png",
      "outputDetail": "text_only"
    },
    "max_results": 1
  }'

运行超过 60 秒仍未结束时会返回 202;轮询方法见运行工具。要处理很多张图片,请为每张图片各发起一次运行。

03

每张图片返回什么

字段组你能获得的内容
文本图片中找到的全部文字
结构段落、行或单词,取决于 outputDetail
位置段落、行或单词在图片中的位置
翻译以 translateTo 中设置的语言给出的文字

使用 text_only 时只返回文字。需要工具能返回的全部内容时,选择 full。

04

实用配方

翻译竞争对手的促销横幅。

从外语网站收集横幅图片,逐张运行并把 translateTo 设为 en,给商品运营团队一张英文的优惠对照表。

让截图可以被搜索。

把客服截图交给工具处理,把文字与工单一起存储,这样只出现在图片里的错误信息也能搜到。

从扫描页面提取文字。

用 paragraphs 保持阅读顺序,再把文字交给模型来总结或提取所需字段。

横幅上线前检查。

用 text_only 读取你自己的设计稿,与批准的文案对比,找出错别字和过期的价格。

让智能体读懂它看不懂的图片。

把这个工具提供给 AI 智能体,当页面返回的是图片而不是文字时,它可以读取图片,而不是直接放弃。

更想直接用自然语言提问?连接 MCP 服务器,然后对 Claude Code 或 Cursor 说:"读取这个图片 URL 中的文字,翻译成英文,并告诉我优惠内容是什么。把 max_results 设为 1。"

06

费用说明

按图片付费:启动运行时会预留它的最高费用,即每次调用费加上每张图片的费用乘以 max_results,结束后按实际返回的结果结算,预留的剩余部分退回你的余额。失败或超时的运行只为已交付的图片付费,在开始时就被拒绝的运行不收费。

读取 500 张图片,就按 500 张图片计费。没有订阅,也没有每月最低消费:最低充值 $5,工具和模型共用一个余额。上方卡片显示的是当前价格;价格页面列出了所有工具。

07

常见问题

?
它能读取哪些图片格式?+

通过公开链接读取 JPEG、PNG、WebP、BMP、TIFF 和 HEIC。

能读取私有文件或本地文件吗?+

输入必须是公开的图片链接。请把文件上传到可以被访问的地方,再传入该链接。

它能翻译文字吗?+

可以。把 translateTo 设为 ISO 639-1 代码,例如 en、de 或 es,文字就会同时被翻译。用 language 提示图片中的语言。

怎样获取单词的位置?+

把 outputDetail 设为 words、lines 或 paragraphs 可获得带位置的文字,设为 full 也可以。text_only 只返回文字。

需要订阅吗?+

不需要。你向预付费余额充值,每次运行从中扣费。失败的运行只为已交付的结果付费,不会自动续费。

除了图片,还要处理网页?请看网页数据提取和其余的工具目录。

一个预付费密钥,搞定模型、数据和智能体

无需订阅。充值后按需使用,每笔费用都能在日志中查看。