360 Secure SkillHub
360 安全技能中心

ucloud-deepseek-ocr

通过 shell 脚本把本地图片以 base64 方式提交给 DeepSeek-OCR 接口,返回识别文本,支持 markdown、纯文本或 JSON 等输出格式。需要配置 API key 并具备网络;远程图片需先手动下载到本地。

qianjunye
qianjunye
热度 79.73
最近更新 2026-05-17 12:58:50
分类:效率依赖:代码执行 / 读写文件 / 第三方 API应用场景:文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add ucloud-deepseek-ocr
Metadata
name
deepseek-ocr
description
OCR text recognition using DeepSeek-OCR model. Use when user asks for OCR, text recognition, image text extraction, screenshot recognition, or converting images to text/markdown.
metadata
{"openclaw":{"emoji":"🔍","requires":{"bins":["curl","jq","base64"],"env":["DEEPSEEK_OCR_API_KEY"]},"primaryEnv":"DEEPSEEK_OCR_API_KEY"}}

DeepSeek OCR

Recognize text in images using the DeepSeek-OCR model.

Quick start

{baseDir}/scripts/ocr.sh /path/to/image.jpg

Usage

{baseDir}/scripts/ocr.sh <image_path> [output_format]

Parameters:

  • <image_path>: Local image file (jpg, png, webp, gif, bmp)
  • [output_format]: Optional, defaults to markdown. Can be text, json, etc.

Examples

# Convert to markdown (default)
{baseDir}/scripts/ocr.sh /path/to/image.jpg

# Convert to plain text
{baseDir}/scripts/ocr.sh /path/to/image.png text

# Extract table as JSON
{baseDir}/scripts/ocr.sh /path/to/table.jpg "extract table as json"

Remote URL images

The model only supports base64-encoded images. For remote URLs, download first:

curl -s -o /tmp/image.jpg "https://example.com/image.jpg"
{baseDir}/scripts/ocr.sh /tmp/image.jpg

API key

Set DEEPSEEK_OCR_API_KEY, or configure in ~/.openclaw/openclaw.json:

{
  skills: {
    "deepseek-ocr": {
      apiKey: "YOUR_KEY_HERE",
    },
  },
}

Default API URL: https://api.modelverse.cn/v1/chat/completions Override with DEEPSEEK_OCR_API_URL if needed.