lmfiles
Use lmfiles.com as a lightweight file host for OpenClaw/LLM workflows.
Provenance & trust
- - Service docs: https://lmfiles.com/docs
- OpenAPI schema: https://lmfiles.com/openapi.json
- API host: https://lmfiles.com
Primary credential:
- -
LMFILES_API_KEY (required for authenticated operations)
Bootstrap credential:
- -
LMFILES_BOOTSTRAP_TOKEN (used only for first-time account registration)
Security notes:
- - Treat credentials as secrets and avoid logging/pasting them.
- Rotate bootstrap token if exposed.
- INLINECODE2 usually means missing/invalid
LMFILES_API_KEY.
Before first use (required)
- 1. Register an account once with a bootstrap token.
- Save returned
api_key as LMFILES_API_KEY. - Use
LMFILES_API_KEY for all authenticated operations.
Quick setup:
CODEBLOCK0
Common auth error:
- -
401 Unauthorized = missing/invalid LMFILES_API_KEY.
Required env vars
- -
LMFILES_API_KEY for authenticated file operations (primary credential). - INLINECODE10 only for account registration (bootstrap credential).
Register account (one-time)
CODEBLOCK1
Or use helper script:
CODEBLOCK2
Save returned api_key as LMFILES_API_KEY.
Upload file (max 100 MB)
CODEBLOCK3
Expected response includes:
- - INLINECODE13
- INLINECODE14 (public download link)
Download (public)
CODEBLOCK4
File metadata (public)
CODEBLOCK5
Account info and usage
CODEBLOCK6
List account files
CODEBLOCK7
Or helper script:
CODEBLOCK8
Delete file (owner only)
CODEBLOCK9
Or helper script:
CODEBLOCK10
Constraints
- - Max upload size: 100 MB.
- Executable file types are rejected (for example
.php, .sh, .py, .exe). - Files expire after 90 days of inactivity; downloads reset the expiry clock.
- Downloads are public for anyone with the URL.
Safety checks before upload
- - Confirm file is safe to publish publicly.
- Avoid uploading secrets or credentials.
- If uncertain, ask user before upload.
lmfiles
使用 lmfiles.com 作为 OpenClaw/LLM 工作流的轻量级文件托管服务。
来源与信任
- - 服务文档:https://lmfiles.com/docs
- OpenAPI 模式:https://lmfiles.com/openapi.json
- API 主机:https://lmfiles.com
主要凭证:
引导凭证:
- - LMFILESBOOTSTRAPTOKEN(仅用于首次账户注册)
安全说明:
- - 将凭证视为机密,避免记录或粘贴。
- 如果引导令牌泄露,请轮换。
- 401 Unauthorized 通常表示缺少或无效的 LMFILESAPIKEY。
首次使用前(必需)
- 1. 使用引导令牌注册一次账户。
- 将返回的 apikey 保存为 LMFILESAPIKEY。
- 对所有认证操作使用 LMFILESAPI_KEY。
快速设置:
bash
export LMFILESBOOTSTRAPTOKEN=
curl -sS -X POST https://lmfiles.com/api/v1/accounts/register \
-H Content-Type: application/json \
-d {username:my-bot,bootstraptoken:$LMFILESBOOTSTRAP_TOKEN}
从响应中复制 api_key,然后:
export LMFILES
APIKEY=lmf_...
常见认证错误:
- - 401 Unauthorized = 缺少或无效的 LMFILESAPIKEY。
必需的环境变量
- - LMFILESAPIKEY 用于认证文件操作(主要凭证)。
- LMFILESBOOTSTRAPTOKEN 仅用于账户注册(引导凭证)。
注册账户(一次性)
bash
curl -sS -X POST https://lmfiles.com/api/v1/accounts/register \
-H Content-Type: application/json \
-d {username:my-bot,bootstraptoken:$LMFILESBOOTSTRAP_TOKEN}
或使用辅助脚本:
bash
bash scripts/register.sh my-bot
将返回的 apikey 保存为 LMFILESAPI_KEY。
上传文件(最大 100 MB)
bash
curl -sS -X POST https://lmfiles.com/api/v1/files/upload \
-H X-API-Key: $LMFILESAPIKEY \
-F file=@/absolute/path/to/file.ext
预期响应包括:
下载(公共)
bash
curl -L https://lmfiles.com/f/ -o downloaded.file
文件元数据(公共)
bash
curl -sS https://lmfiles.com/api/v1/files/
账户信息与使用情况
bash
curl -sS https://lmfiles.com/api/v1/accounts/me \
-H X-API-Key: $LMFILESAPIKEY
列出账户文件
bash
curl -sS https://lmfiles.com/api/v1/accounts/me/files \
-H X-API-Key: $LMFILESAPIKEY
或使用辅助脚本:
bash
bash scripts/list.sh
删除文件(仅限所有者)
bash
curl -sS -X DELETE https://lmfiles.com/api/v1/files/ \
-H X-API-Key: $LMFILESAPIKEY
或使用辅助脚本:
bash
bash scripts/delete.sh
限制
- - 最大上传大小:100 MB。
- 可执行文件类型被拒绝(例如 .php、.sh、.py、.exe)。
- 文件在 90 天不活动后过期;下载会重置过期时钟。
- 任何拥有 URL 的人都可以公共下载。
上传前的安全检查
- - 确认文件可以安全地公开发布。
- 避免上传机密或凭证。
- 如果不确定,在上传前询问用户。