feishu-upload-image

feishu-upload-image is a skill for Claude Code, Codex from smallnest/goclaw. It costs 21 tokens per session (728 once invoked), scanned A, original, MIT.

A tool for uploading image files to Feishu, also called Lark, a workplace messaging and collaboration app. It returns an image key that Feishu messages can use to display the image.

In plain words
What is it for?
Use it to upload images for Feishu messages or avatars and obtain the image key needed by Feishu's messaging API.
Why use it?
It removes the need to handle Feishu image uploads manually before sending pictures in messages. It accepts local files, web URLs, and base64-encoded images.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to upload images for Feishu messages or avatars and obtain the image key needed by Feishu's messaging API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/smallnest/goclaw/feishu-upload-image
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add smallnest/goclaw --skill feishu-upload-image
Clone the repo
git clone --depth 1 https://github.com/smallnest/goclaw

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for feishu-upload-image

README.md
[![agentmods](https://agentmods.dev/badge/skills/smallnest/goclaw/feishu-upload-image/github.svg)](https://agentmods.dev/skills/smallnest/goclaw/feishu-upload-image)
Your own site
<a href="https://agentmods.dev/skills/smallnest/goclaw/feishu-upload-image"><img src="https://agentmods.dev/badge/skills/smallnest/goclaw/feishu-upload-image/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for feishu-upload-image

Your own site · 80×15
<a href="https://agentmods.dev/skills/smallnest/goclaw/feishu-upload-image"><img src="https://agentmods.dev/badge/skills/smallnest/goclaw/feishu-upload-image.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 728 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.00728
Opus 5 $0.00010 $0.00364
Sonnet 5 $0.00004 $0.00146
Haiku 4.5 $0.00002 $0.00073

Measured 10d ago against content hash cc3fb6a320b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

feishu-upload-image scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/upload_image.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X POST https://open.feishu.cn/open-apis/im/v1/messages \
internal/builtin_skills/feishu-upload-image/SKILL.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Feishu Upload Image

Upload images to Feishu/Lark and get the image_key for use in messages.

Usage

Upload from Local File

python3 ./scripts/upload_image.py /path/to/image.jpg

Upload via HTTP

python3 ./scripts/upload_image.py --type message --image-type message https://example.com/image.jpg

Upload from Base64

python3 ./scripts/upload_image.py --base64 "iVBORw0KGgoAAAANS..."

Options

Option Description Default
`--type message avatar` Image usage type
`--image-type message avatar` Same as --type

Limits

  • Max file size: 10MB
  • Supported formats: JPEG, PNG, WEBP, GIF, TIFF, BMP, ICO
  • GIF resolution ≤ 2000×2000
  • Other formats ≤ 12000×12000

Response

Returns image_key which can be used in Feishu messages:

{
  "code": 0,
  "data": {
    "image_key": "img_v2_xxx"
  }
}

发送图片消息指南

获取必要信息

  1. 飞书访问令牌 (tenant_access_token 或 app_access_token)
  2. 接收者ID (open_id, user_id, chat_id, 或 email)

发送图片消息API

方式1:直接发送图片消息

curl -X POST https://open.feishu.cn/open-apis/im/v1/messages \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "receive_id": "{chat_id}",
    "msg_type": "image",
    "content": "{\"image_key\":\"{image_key}\"}"
  }'

方式2:在富文本中嵌入图片

curl -X POST https://open.feishu.cn/open-apis/im/v1/messages \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "receive_id": "{chat_id}",
    "msg_type": "post",
    "content": "{\"post\":{\"zh_cn\":{\"title\":\"图片消息\",\"content\":[[{\"tag\":\"img\",\"image_key\":\"{image_key}\"}]]}}}"
  }'

获取群聊chat_id

  1. 在飞书中打开群聊,查看URL中的chat_id
  2. 或者通过API查询群聊列表:
curl -X GET https://open.feishu.cn/open-apis/im/v1/chats \
  -H "Authorization: Bearer {access_token}"

实践经验

  • 上传图片后获得 image_key,有效期通常为7天
  • 使用前需确保有正确的访问令牌权限
  • 发送消息需要 im:message:send_as_bot 权限
  • 建议先上传图片,再发送消息,两步操作分离

Read the full file on GitHub · 106 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 106 lines · 21 tokens per session scan A cc3fb6a320b2

Subscribe to this mod's changes

feishu-upload-image is a skill published in the GitHub repository smallnest/goclaw (602 stars, last pushed 5mo ago), licensed MIT. It adds 21 tokens to every session and 728 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories